Exemple #1
0
    public IEnumerator disableMovementsForPeriod(float disableDuration, Collider2D pep)
    {
        Platformer2DUserControl pepController = pep.GetComponent <Platformer2DUserControl> ();

        pepController.disableMovement();
        yield return(new WaitForSeconds(disableDuration));

        pepController.enableMovement();
        yield return(null);
    }
    public void switchTo(int sceneCode)
    {
        SceneType sceneType = (SceneType)sceneCode;
        Scene     scene     = Lookup.sceneLookup(sceneType);

        GameManager.getInstance().switchScene(scene);

        GameObject pep = GameObject.FindGameObjectWithTag("Player");

        if (pep != null)
        {
            Platformer2DUserControl pepController = pep.GetComponent <Platformer2DUserControl> ();
            pepController.enableMovement();
        }
    }