Y
Y
yraiv2022-02-19 14:27:24
Unity
yraiv, 2022-02-19 14:27:24

How to pass data to a method from another method?

How can you pass data from a method to another method? i want to pass object number to array. Well, select an object with the desired number from the array.

IEnumerator SpawnMob()
    {
        yield return new WaitForSeconds(TimeStep);
        Instantiate(ZombieType[NomberZombie], StartPos.position, Quaternion.identity); // хочу в NomberZombie передать своё число 
        Repeat();

    }


  void Round1()
    {
        TimeStep = 5;
        StartCoroutine(SpawnMob(ZombieType[0])); // я чёт туплю тут как передать нужное мне значение 
    }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question