Пример #1
0
 private void CreateSceneSwitchChecker()
 {
     if (sceneChecker == null)
     {
         GameObject gObject = ConfactoryTools.CreateConGameObject("(Confinder)SceneSwitchChecker");
         sceneChecker = gObject.AddComponent <SceneSwitchChecker>();
         sceneChecker.SceneSwitchEvent += OnSceneSwitchedEvent;
     }
 }
Пример #2
0
        private IConfactory CreateConfectory(Type t)
        {
            IConfactory confectory;

            if (t.IsSubclassOf(typeof(MonoBehaviour)))
            {
                confectory = (IConfactory)ConfactoryTools.CreateConGameObject(t.Name).AddComponent(t);
            }
            else
            {
                confectory = (IConfactory)Activator.CreateInstance(t);
            }

            confectory.ConStruct();

            activeConfectories.Add(confectory.GetType(), confectory);
            return(confectory);
        }