Ejemplo n.º 1
0
 public void Message(int Msg, int Param1, int Param2)
 {
     if (StageManagerScript != null)
     {
         StageManagerScript.Message(Msg, Param1, Param2);
     }
     if (HudManagerScript != null)
     {
         HudManagerScript.Message(Msg, Param1, Param2);
     }
 }
Ejemplo n.º 2
0
    void OnCollisionEnter(Collision collision)
    {
        if (this.gameObject.transform.position.x > -24)
        {
            Debug.Log("GameOver");
            // hasEnded = true;
            // print(hasEnded);
            Instantiate(particleObject, this.transform.position, Quaternion.identity);
            GameObject[] stop        = GameObject.FindGameObjectsWithTag("stage");
            GameObject   noMoreStage = GameObject.Find("StageManager");
            _stageManagerScript           = noMoreStage.GetComponent <StageManagerScript>();
            _stageManagerScript.countDown = 200000;

            GameObject[] gemsStop   = GameObject.FindGameObjectsWithTag("gem");
            GameObject   gemManager = GameObject.Find("GemManager");

            Destroy(collision.gameObject);
            foreach (var gems in gemsStop)
            {
                _gemScript       = gemManager.GetComponent <GemScript>();
                _gemScript.speed = 0;
                _gemScript.count = 200000;
            }

            foreach (var stage in stop)
            {
                _stageMoveScript       = stage.GetComponent <StageMoveScript>();
                _stageMoveScript.speed = 0;
            }

            // Destroy(this.gameObject);
            GameObject childParticle = GameObject.Find("ParticleOnPlayer");
            Destroy(childParticle);
            _rb            = GameObject.Find("Cube").GetComponent <Rigidbody>();
            _rb.useGravity = false;


            GameObject cubeScore = GameObject.Find("Cube");
            _playerScript = cubeScore.GetComponent <PlayerScript>();

            _playerScript.hasEnded = true;
            if (highScore < _playerScript.score)
            {
                highScore = _playerScript.score;

                PlayerPrefs.SetInt("SCORE", highScore);
                PlayerPrefs.Save();
            }

            // print("your highscore: " + highScore);

            print(PlayerPrefs.GetInt("SCORE", highScore));
        }
    }
Ejemplo n.º 3
0
 private void ReleaseScript()
 {
     if (InputManagerScript)
     {
         InputManagerScript.Release();
     }
     if (DataManagerScript != null)
     {
         DataManagerScript.Release();
     }
     if (StageManagerScript != null)
     {
         StageManagerScript.Release();
     }
     if (HudManagerScript != null)
     {
         HudManagerScript.Release();
     }
 }
Ejemplo n.º 4
0
 public void Update()
 {
     if (m_LoadStep != LOAD_STEP._NULL)
     {
         LoadStep();
     }
     if (GameManagerScript != null)
     {
         GameManagerScript.Update();
     }
     if (StageManagerScript != null)
     {
         StageManagerScript.Update();
     }
     if (HudManagerScript != null)
     {
         HudManagerScript.Update();
     }
 }
    private void Awake()
    {
        Debug.Log("Stage Manager(Awake)");

        if (instance == null)
        {
            instance = this;
            if (save == null)
            {
                save = new SaveScript();
                save.saveInfo.GetLevel(1, 1).available = true;
            }
        }
        else if (instance != this)
        {
            Destroy(this.gameObject);
        }

        DontDestroyOnLoad(this);
    }