Ejemplo n.º 1
0
 void Awake()
 {
     hourGlass             = transform.Find("Cooldown Image").GetComponent <Image>();
     timer                 = GetComponentInParent <UnitTimer>();
     timer.onTimerStarted += StartTimer;
     timer.onTimerRemoved += StopTimer;
     StopTimer(Unit.UnitState.unselected);
 }
Ejemplo n.º 2
0
 void Start()
 {
     sceneManager          = FindObjectOfType <SceneManager>().GetComponent <SceneManager>();
     grid                  = GameGrid.instance;
     worldManager          = WorldManager.instance;
     Debug.Assert(unit     = GetComponent <Unit>());
     timer                 = GetComponent <UnitTimer>();
     timer.onTimerRemoved += SetState;
 }
Ejemplo n.º 3
0
	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);
			}
		}
	}
Ejemplo n.º 4
0
	private void timerStartup(){
		UT = unitInfo.unitTimer;
	}