Example #1
0
    private void Awake()
    {
        if (!_instance && GameObject.FindGameObjectsWithTag("GameController").Length == 1)
        {
            //This gameObject becomes persistent if there are no other gameMasters.
            DontDestroyOnLoad(this.gameObject);
            _instance = this;
        }
        else
        {
            Destroy(this.gameObject);
        }

        //Creates an instance of these if not found.
        SceneBehaviour();
        SDKManager();

        //Controller references in sdk are usually f****d, this ensures they are right.
        ControllerSetter.ResetControllers();

        //Call awake in scenemaster.
        SceneMaster.MasterAwake();
    }
Example #2
0
 //Scene manager calls on scene activation
 //Called before unloading previous scene.
 public void SceneStart()
 {
     SceneBehaviour();
     SDKManager();
     ControllerSetter.ResetControllers();
 }