Пример #1
0
        private void Awake()
        {
            lm = GameObjectReferences.GetGlobalScriptsGameObject().GetComponent <LevelManager>();

            string sceneName = Application.loadedLevelName;

            if (Application.isEditor && !sceneName.Equals(LevelsEnum.Menu.ToString()))
            {
                if (lm.CurrentLevel == null)
                {
                    foreach (LevelsEnum pl in (LevelsEnum[])Enum.GetValues(typeof(LevelsEnum)))
                    {
                        if (pl.ToString() == sceneName)
                        {
                            lm.LoadLevel(pl);
                            break;
                        }
                    }
                }
            }
            movement           = GameObject.Find("_Scripts").GetComponent <Movement>();
            highlight          = GameObject.Find("_Scripts").GetComponent <Highlight>();
            capBuildings       = GameObject.Find("_Scripts").GetComponent <CaptureBuildings>();
            productionOverlay  = GameObject.Find("_Scripts").GetComponent <ProductionOverlayMain>();
            dayStateController = GameObject.Find("_Scripts").GetComponent <DayStateController>();
            animInfo           = GameObject.Find("_Scripts").GetComponent <Assets.Scripts.UnitActions.AnimationInfo>();
        }
Пример #2
0
 private void Start()
 {
     levelManager    = GameObjectReferences.GetGlobalScriptsGameObject().GetComponent <LevelManager>();
     highlight       = GameObjectReferences.GetScriptsGameObject().GetComponent <Highlight>();
     attack          = GameObjectReferences.GetScriptsGameObject().GetComponent <Attack>();
     dayStateControl = GameObjectReferences.GetScriptsGameObject().GetComponent <DayStateController>();
 }