Ejemplo n.º 1
0
 private void Awake()
 {
     StartCoroutine(ReadyUI());
     gameStatus = state.Ready;
     counter.Counting(currentCount, goalCount);
     system        = FindObjectOfType <BeatManager>();
     savedMonsters = new List <Transform>();
 }
Ejemplo n.º 2
0
    IEnumerator Savemonster(List <Transform> line)
    {
        Transform playerTemp = null;

        foreach (var m in line)
        {
            if (m.tag == "Player")
            {
                playerTemp = m;
            }
            else
            {
                m.GetComponent <MonsterController>().isConneted  = false;
                m.GetComponent <MonsterController>().untouchable = true;
                tempList.Add(m);
            }
        }
        line.Clear();
        line.Add(playerTemp);

        foreach (var m in tempList)
        {
            savingSFX.Play();
            m.DOMove(transform.position, 0.15f);
            yield return(new WaitForSeconds(0.15f));

            m.gameObject.SetActive(false);
            savedMonsters.Add(m);
            currentCount = savedMonsters.Count;
            counter.Counting(currentCount);
        }

        tempList.Clear();
        if (goalCount <= currentCount)
        {
            FinishFX.Play();
            nextStatus = state.Win;
            victorySFX.Play();
        }

        /*
         * for (int i = line.Count - 1; i > 0; i--)
         * {
         *  savingSFX.Play();
         *  savedMonsters.Add(line[i]);
         *  line[i].DOMove(transform.position, 0.15f);
         *  yield return new WaitForSeconds(0.15f);
         *
         *  line[i].gameObject.SetActive(false);
         *  line.Remove(line[i]);
         *  currentCount = savedMonsters.Count;
         *  counter.Counting(currentCount);
         * }
         * if (goalCount <= currentCount)
         * {
         *  FinishFX.Play();
         *  nextStatus = state.Win;
         *  victorySFX.Play();
         * }
         */
    }