Beispiel #1
0
    void Start()
    {
        stagemusic = FindObjectOfType <Music_Manager>();
        loseMusic  = FindObjectOfType <Music_Manager>();
        winMusic   = FindObjectOfType <Music_Manager>();

        rb2d        = GetComponent <Rigidbody2D>();
        audioSource = GetComponent <AudioSource>();

        Locks             = 2;
        time              = 12;
        jail              = 0;
        gameOver          = false;
        restart           = false;
        restartText.text  = "";
        gameOverText.text = "";
        controls.text     = "Press 'W' to Jump and 'Space' to shoot!";
        WinText.text      = "";
        LoseText.text     = "";
        Instructions.text = "Shoot both locks before time is up";
        LockCount.text    = "Locks Left: " + Locks;
        SetAllText();

        StartCoroutine("Countdown");
        Time.timeScale = 1;
    }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        musicManager = GameObject.FindObjectOfType <Music_Manager>();

        volumeSlider.value     = PlayerPrefsManager.GetMasterVolume();
        difficultySlider.value = PlayerPrefsManager.GetDifficulty();
    }
    public void Start()
    {
        PlayerName     = "Player Name";
        numSettings[0] = 0;         //Save file not set;
        music          = GetComponent <Music_Manager>();
        utils          = GetComponent <Cat_Utilites>();
        Scene scene = SceneManager.GetActiveScene();

        currentScene = scene.buildIndex;
        lastScene    = scene.buildIndex;
        onSceneChange();
    }
Beispiel #4
0
 void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         GameObject.DontDestroyOnLoad(gameObject);
     }
 }
Beispiel #5
0
 private void Awake()
 {
     if (_Instance == null)
     {
         _Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Beispiel #6
0
    void Awake()
    {
        DontDestroyOnLoad(this);

        if (musicInstance == null)
        {
            musicInstance = this;
        }
        else
        {
            Destroy(gameObject);
        }
    }
Beispiel #7
0
    private void Awake()
    {
        if (Instance != null && Instance != this)
        {
            Destroy(this.gameObject);
        }
        else
        {
            Instance = this;
        }

        DontDestroyOnLoad(this.gameObject);
    }
    void Start()
    {
        Transform f = transform.FindChild("Trigger_Location");
        textMeshChild = f.GetComponent<TextMesh>();
        myId = int.Parse(textMeshChild.text);
        MeshRenderer rend = textMeshChild.GetComponent<MeshRenderer>();
        rend.enabled = false;

        lowerVoiceStyle =GameObject.Find("Environment_Scripts").
                                GetComponent<LowerVoiceGUI>().myStyle;
        upGUI = GameObject.Find("Environment_Scripts").
                                GetComponent<UpperVoiceGUI>();
        lowGUI = GameObject.Find("Environment_Scripts").
                                GetComponent<LowerVoiceGUI>();
        if(GameObject.Find("Music_Manager") != null){
            mng = GameObject.Find("Music_Manager").GetComponent<Music_Manager>();
        }
    }