Example #1
0
        //bool displayGUI = false;
        //Progress progressObj;

        private void Awake()
        {
            var playerManager = GameObject.Find("Player Manager");

            selection = playerManager.GetComponent <UnitSelection>();
            manager   = playerManager.GetComponent <GUIManager>();
            gui.type  = "Building";
            if (buildingType == BuildingType.ProgressBuilding)
            {
                InvokeRepeating("Progress", 0, progressRate);
            }
            else if (buildingType == BuildingType.CompleteBuilding)
            {
                gameObject.name = name;
                gui.Awake(gameObject);
                for (int x = 0; x < techEffect.Length; x++)
                {
                    Faction.Tech[techEffect[x].index].AddListener(gameObject);
                    if (Faction.Tech[techEffect[x].index].active)
                    {
                        Upgraded(Faction.Tech[techEffect[x].index].name);
                    }
                }
            }
            grid      = GameObject.Find("UGrid").GetComponent <UGrid>();
            healthObj = GetComponent <Health>();
            //progressObj = GetComponent<Progress>();
        }
Example #2
0
 private void Awake()
 {
     selection = GameObject.Find("Player Manager").GetComponent <UnitSelection>();
     vision    = gameObject.GetComponent <VisionSignal>();
     miniMap   = gameObject.GetComponent <MiniMapSignal>();
     movement  = gameObject.GetComponent <UnitMovement>();
     gui.type  = "Unit";
     gui.Awake(gameObject);
     for (int x = 0; x < techEffect.Length; x++)
     {
         var technology = Faction.Tech[techEffect[x].index];
         technology.AddListener(gameObject);
         if (technology.active)
         {
             Upgraded(technology.name);
         }
     }
     gameObject.name = name;
     healthObj       = GetComponent <Health>();
 }