void Awake() { hourGlass = transform.Find("Cooldown Image").GetComponent <Image>(); timer = GetComponentInParent <UnitTimer>(); timer.onTimerStarted += StartTimer; timer.onTimerRemoved += StopTimer; StopTimer(Unit.UnitState.unselected); }
void Start() { sceneManager = FindObjectOfType <SceneManager>().GetComponent <SceneManager>(); grid = GameGrid.instance; worldManager = WorldManager.instance; Debug.Assert(unit = GetComponent <Unit>()); timer = GetComponent <UnitTimer>(); timer.onTimerRemoved += SetState; }
public void loadUnit(UnitSaving unitSave){ //if(unitSave.controlType != null) // controlType = unitSave.controlType; if(unitSave.currentAttackPow != null) currentAttackPower = unitSave.currentAttackPow; if(unitSave.currentMaxAttackActions != null) currentMaxPosibleAttackActions = unitSave.currentMaxAttackActions; if(unitSave.currentMaxLength != null) maxProgramLength = unitSave.currentMaxLength; if(unitSave.currentMaxMove != null) maximumMovment = unitSave.currentMaxMove; if(unitSave.unitNameToLoad != null) name = unitSave.unitNameToLoad; if(unitSave.unitNameToLoad != null) name = unitSave.unitNameToLoad; if(unitSave.currentUnitTimer != null) unitTimer = unitSave.currentUnitTimer; if(unitSave.currentBlockLocations != null){ for(int i = 0; i < unitSave.currentBlockLocations.Length; i++){ addBlock(grid.gridLocationToGameGrid(unitSave.currentBlockLocations[i]), false); } } }
private void timerStartup(){ UT = unitInfo.unitTimer; }