2 months ago

It's been almost 2 years since the last poll. So it's time for a new one!

What will be output to the console when the Start() method is executed?

Choose the answer below!

(Full code in the article)


SampleScript.cs

		
			
using UnityEngine;

namespace Assets.Samples.Sample4
{
    public class SampleScript : MonoBehaviour
    {
        private readonly Person _field = new Person();
        private Person _property => new Person();

        private void Start()
        {
            _field.Init("Mike", 25);
            _property.Init("Lucas", 35);

            _field.Introduce();
            _property.Introduce();
        }
    }
}
		
	

Person.cs

		
			
using UnityEngine;

namespace Assets.Samples.Sample4
{
    public class Person
    {
        public string Name { get; private set; } = "John";
        public int Age { get; private set; } = 18;

        public void Init(string name, int age)
        {
            Name = name;
            Age = age;
        }

        public void Introduce()
        {
            Debug.Log(quot;Hey, I'm {Name}, {Age} yo.");
        }
    }
}
		
	
  22 votes Voting finished



6 comments

Loading...

Next up

Help wanted!

Translator (English -> Hindi)

More information in the article

Main menu demonstration

Interface has reached final form. Drawing icons, writing logic and supporting many languages - all this was done by me.

UI/UX design is quite an interesting experience, I'll definitely continue to learn it in my new projects

2025

Help wanted!

Translator (any language), Animator

More information in the article

Welcome @PQubeGames to Game Jolt by giving them a follow!

Their upcoming game Discounty is a cozy supermarket management game 🛒 Make friends (and enemies) as you grow your shop!

Learn more about Discounty: https://gamejolt.com/games/Discounty/1006923

Introducing the voice acting team!

2 roles, 4 languages, 8 voice actors. So much work went into this - all to make your gameplay even better!

Links and contacts will be on the new game page that will be created soon

2025

Happy #WIPWednesday! Are you working on a game? Making some art? Practicing a song? Something else? Tell us in the comments!

Gameplay screenshots

Tutorial is an important part of almost any game.

The game has task system, marker system and voice explanation (with subtitles) - all to make it as clear and comfortable for the player to play the game

2025

Preparations for the release are in full swing!

A new page will be created for the new version of the game. I have already created a description for it

2025

Artist Richard Hogg illustrated over 60 different puzzles for Wilmot Works It Out! Watch his process for one of our favorites here!

This chill game is available now for PC, Mac, and Switch! https://store.steampowered.com/app/2060590/Wilmot_Works_It_Out/

After 3.5+ years, I changed the logo. I liked the old one quite well, but I decided to redesign it because of the upcoming change in my direction in game development.

What do I mean?

You'll find out soon.