Example #1
0
    private void Start()
    {
        actionsUI = FindObjectOfType <ActionsReciever>();
        actions   = new Queue <Direction> [actionsArray.Length];

        for (int i = 0; i < actions.Length; i++)
        {
            actions[i] = new Queue <Direction>();
        }


        for (int i = 0; i < actions.Length; i++)
        {
            for (int j = 0; j < actionsArray[i].directions.Length; j++)
            {
                actions[i].Enqueue(actionsArray[i].directions[j]);
            }
        }

        StartCoroutine(SwitchPhases());
        ShowTutorial();
    }
Example #2
0
    void Start()
    {
        level     = FindObjectOfType <Level>();
        actionsUI = FindObjectOfType <ActionsReciever>();
        tutorial  = FindObjectOfType <Tutorial>();

        if (tutorial != null)
        {
            tutorialMode = true;
            tutorial.onTutorialFinish += OnFinishTutorial;
        }

        x          = Mathf.RoundToInt(transform.position.x);
        y          = Mathf.RoundToInt(transform.position.y);
        movesQueue = new Queue <Vector2>();

        for (int i = 0; i < tail.Length; i++)
        {
            tail[i].SetParent(null);
        }

        GameManager.Instance.onPhaseChange += OnPhaseChange;
    }