Пример #1
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Пример #2
0
 private void Awake()
 {
     fruitSpawnerScript = FindObjectOfType <FruitsSpawner>();
     lastSnakePosition  = transform.position;
     moveTimer          = 0f;
     audioSource        = GetComponent <AudioSource>();
     GetPlayerPrefs();
     isAlive = true;
 }
Пример #3
0
    public void InvokeSpecialPower(CatcherController catcher)
    {
        //Maybe change color of the button when clicked
        catcher.StarClick();

        FruitsSpawner fruitsSpawner = GameObject.FindWithTag("CupcakeSpawner").GetComponent <FruitsSpawner>();

        if (fruitsSpawner != null)
        {
            fruitsSpawner.SetSpawnType(SpawnType.Circular);
        }
    }
Пример #4
0
    // Start is called before the first frame update
    void Awake()
    {
        fruitsSpawner = GameObject.FindWithTag("CupcakeSpawner").GetComponent <FruitsSpawner>();
        animator      = GetComponentInChildren <Animator>();

        switch (fruitsSpawner.GetSpawnType())
        {
        case SpawnType.Regular:
            SetTarget(UnityEngine.Random.Range(0, catchersHolder.transform.childCount));
            break;

        case SpawnType.Circular:
            SetTarget(fruitsSpawner.GetRunningCircularIndex());
            break;
        }
    }