Exemple #1
0
 void MakeSingleton()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
 }
Exemple #2
0
        void Start()
        {
            Instance = this;

            ObjectManager = gameObject.AddComponent <ObjectManager>();

            FlashLightController  = gameObject.AddComponent <FlashLightController>();
            InputController       = gameObject.AddComponent <InputController>();
            SelectionController   = gameObject.AddComponent <SelectionController>();
            WeaponController      = gameObject.AddComponent <WeaponController>();
            InteractionController = gameObject.AddComponent <InteractionController>();
            MasterSoundController = gameObject.AddComponent <MasterSoundController>();

            EnableDefaults();
        }