Esempio n. 1
0
    private void SetHeroDirection()
    {
        // ----- DIRECTION STORED ON JSON FILE -----

        // Initialize hero direction manager
        heroDirectionManager.InitializeDirection();

        // Get current hero direction
        heroDirectionX = heroDirectionManager.GetDirection();

        // Exception
        if (heroDirectionX == 0)
        {
            Debug.Log("ERROR: Hero's direction can't be zero");
        }

        // ----- DIRECTION ON GAME MANAGERS -----

        mapManager.SetDirection(heroDirectionX);
        heroManager.SetDirection(heroDirectionX);
        obstacleManager.SetDirection(heroDirectionX);
        bossManager.SetDirection(heroDirectionX);
    }