Пример #1
0
    public void Start()
    {
        if(_instance == null)
        {
            _instance = this;
        }

        running = true;
    }
    public static void CheckForRunningChange()
    {
        if(running != EditorApplication.isPlaying){

            if(running != null){
                running = EditorApplication.isPlaying;
                Debug.LogWarning(running == true ? "Game is now running": "Game is now not running");

                if(running == true){
                    //Debug.Log("yup where get to here");

                    soundMetronome = GameObject.Find("SoundMetronome").GetComponent<SoundMetronome>();
                }
                else if(lastState == true && running == false)
                {
                    Debug.Log("start or stops the game");
                    Launch();
                }
            }
            else{
                running = true;
            }
        }

        lastState = EditorApplication.isPlaying;
    }