3 years ago

Hey! More than half of Unity game development is spent on programming.

How well do you know C#? Let's check!

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.Sample1
{
    public class SampleScript : MonoBehaviour
    {
        private void Start()
        {
            int firstValue = 0;
            for (int i = 0; i < 5; i++)
                firstValue = PostfixIncrement(firstValue);

            int secondValue = 0;
            for (int i = 0; i < 5; i++)
                secondValue = PrefixIncrement(secondValue);

            print(quot;First value = {firstValue}, second value = {secondValue}");
        }

        private int PostfixIncrement(int value)
            => value++;

        private int PrefixIncrement(int value)
            => ++value;
    }
}
		
	
  50 votes Voting finished



9 comments

Loading...

Next up

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

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

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

@pm-studios ' Bandit Trap has an open beta RIGHT NOW! It's open until 3 am ET on Nov 30th.

Quests celebrating the beta have entered your quest log.

Play the game for FREE: https://bit.ly/BanditTrapSteam

Help wanted!

Animator

More information in the article

🏆Meet the winners of the Narrative Jam presented by Game Jolt and @NEOWIZ_QUEST ! Where every story finds its voice!

Help wanted!

Translator (English -> Portuguese)

More information in the article

Help wanted!

Translator (English -> Hindi)

More information in the article

🥉✨ I won 3rd place in the Narrative Jam! ✨🥉

My game Luna Magica made it into the winners of the Game Jolt + NEOWIZ jam ÒwÓ They really loved the worldbuilding and the dark magical-girl vibe, 🌙

Thank you so much to everyone who played it! #GameDev #JotaDev

The project is in the final stages of development - game balance and testing team will begin forming very soon.

But before that, some animations need to be finished.

More information in the article