public void Start()
 {
     menuControl = gameObject.GetComponentInParent <menuController>();
     audioSource = GetComponent <AudioSource>();
     scene       = SaveSystem.GetInt("sceneCount");
     if (all != null)
     {
         all.SetActive(true);
     }
     if (main != null)
     {
         main.SetActive(true);
     }
     if (credits != null)
     {
         credits.SetActive(false);
     }
     if (controls != null)
     {
         controls.SetActive(false);
     }
     Cursor.visible = true;
     if (menuControl != null)
     {
         menuControl.resetButton();
     }
 }
Example #2
0
    public void YouLose()
    {
        GameObject     theController  = GameObject.Find("GameManager");
        menuController menuController = theController.GetComponent <menuController>();

        menuController.gameStart = false;
        Time.timeScale           = 0f;
        deathCanvas.SetActive(true);
    }
Example #3
0
 private void Start()
 {
     dificultad = -1;
     mapa       = -1;
     botonStart.SetActive(false);
     escenarioActual    = null;
     controlPuerta      = GameObject.FindObjectOfType <controlPuerta>();
     menuController     = GameObject.FindObjectOfType <menuController>();
     lastPosicionPirata = null;
     audioSource        = GetComponent <AudioSource>();
 }
Example #4
0
 void Start()
 {
     if (instatnce == null)
     {
         instatnce = this;
     }
     homeState.gameObjectsInThisState                  = gameObjectsInHomeState;
     selectLevelState.gameObjectsInThisState           = gameObjectsSelectLevelState;
     selectNumberOfPlayersState.gameObjectsInThisState = gameObjectsSelectNumberOfPlayersState;
     currentState = homeState;
     currentState.enterState();
 }
Example #5
0
    // Update is called once per frame
    void Update()
    {
        if (currentHealth <= 0)
        {
            Debug.Log("Enemy Dead");
            Instantiate(deathEffect, this.transform.position, Quaternion.identity);
            if (this.gameObject.name == "BossBird")
            {
                victoryScreen.SetActive(true);
                GameObject     theController  = GameObject.Find("GameManager");
                menuController menuController = theController.GetComponent <menuController>();
                menuController.gameStart = false;

                Time.timeScale = 0f;
            }
            Destroy(gameObject);
            //Death sound
        }
    }
Example #6
0
    void Awake()
    {
        character      = GameObject.Find("Character").GetComponent <PlayerMovement>();
        checkpointStat = GameObject.Find("Character").GetComponent <PlayerHealth>();
        input          = GameObject.Find("Character").GetComponent <PlayerInput>();
        menuControl    = gameObject.GetComponentInChildren <menuController>();
        audioSource    = GetComponent <AudioSource>();

        if (controller != null && controller != this)
        {
            Destroy(gameObject);
            return;
        }

        paused         = false;
        Time.timeScale = 1f;

        controller = this;

        Cursor.visible = false;

        DontDestroyOnLoad(gameObject);
    }