Пример #1
0
    void UpdatePlayingState()
    {
        if (Input.GetKeyDown("p"))
        {
            Debug.Log("PAUSE ! ");
            GameStateManagert.setGameState(GameStatet.Pause);
        }

        if (Input.GetKeyDown("z") || Input.GetKeyDown("w"))
        {
            PlayerManagert.UP();
        }

        if (Input.GetKeyDown("q") || Input.GetKeyDown("a"))
        {
            PlayerManagert.LEFT();
        }

        if (Input.GetKeyDown("s"))
        {
            PlayerManagert.DOWN();
        }

        if (Input.GetKeyDown("d"))
        {
            PlayerManagert.RIGHT();
        }
    }
 void Awake()
 {
     if(m_instance == null){
         //If I am the first instance, make me the Singleton
         m_instance = this;
     }else{
         //If a Singleton already exists and you find
         //another reference in scene, destroy it!
         if(this != m_instance)
             Destroy(this.gameObject);
     }
 }
 void Awake()
 {
     if (m_instance == null)
     {
         //If I am the first instance, make me the Singleton
         m_instance = this;
     }
     else
     {
         //If a Singleton already exists and you find
         //another reference in scene, destroy it!
         if (this != m_instance)
         {
             Destroy(this.gameObject);
         }
     }
 }