protected void EnemyRemove(int eTeam, GameObject enemy, PuppetType type) { if (eTeam != this.team) { enemyList.Remove(enemy); } }
/* * Shouldn't need to touch these much, mostly automated by events. */ protected void EnemyAdd(int puppetTeam, GameObject enemy, PuppetType type) { if (puppetTeam != this.team) { enemyList.Add(enemy); } }
void ChangeStrat(int team, int beatNum, UnitScript.Strategies newAction, ConstFile.PuppetType type) { switch (type) { case ConstFile.PuppetType.TREBLE: UpdateTrebleInstructs(newAction); break; case ConstFile.PuppetType.BASS: UpdateBassInstructs(newAction); break; } }
void ActionChange(int team, int beatNum, UnitScript.Strategies newAction, PuppetType type) { //Debug.Log(string.Format("Action Change\nTeam: {0}\nBeatNum: {1}\nAction: {2}",team,beatNum,newAction)); switch (team) { case 0: switch (type) { case PuppetType.BASS: actionPatternZeroBass[0] = newAction; break; case PuppetType.TREBLE: actionPatternZeroTreble[0] = newAction; break; } break; case 1: switch (type) { case PuppetType.BASS: actionPatternOneBass[0] = newAction; break; case PuppetType.TREBLE: actionPatternOneTreble[0] = newAction; break; } break; } switch (type) { case PuppetType.BASS: UpdateBassUnits(team); break; case PuppetType.TREBLE: UpdateTrebleUnits(team); break; } }
// Adds new unit to proper list and sends event to all listeners. public static void AddNewUnit(int team, GameObject unit, PuppetType type) { switch (team) { case 0: _LeftUnits.Add(unit); switch (type) { case PuppetType.BASS: _LeftBass.Add(unit); _LeftUnitBass.Add(unit.GetComponent <UnitScript>()); break; case PuppetType.TREBLE: _LeftTreble.Add(unit); _LeftUnitTreble.Add(unit.GetComponent <UnitScript>()); break; } break; case 1: _RightUnits.Add(unit); switch (type) { case PuppetType.BASS: _RightBass.Add(unit); _RightUnitBass.Add(unit.GetComponent <UnitScript>()); break; case PuppetType.TREBLE: _RightTreble.Add(unit); _RightUnitTreble.Add(unit.GetComponent <UnitScript>()); break; } break; } if (AddUnit != null) { AddUnit(team, unit, type); } }
void NewUnit(int team, GameObject unit, PuppetType type) { UpdateBassUnits(team); UpdateTrebleUnits(team); }
public static void RemoveDeadUnit(int team, GameObject unit, PuppetType type) { int ind = -1; switch (team) { case 0: _LeftUnits.Remove(unit); switch (type) { case PuppetType.BASS: for (int i = 0; i < _LeftBass.Count; i++) { if (_LeftBass[i] == unit) { ind = i; } } _LeftBass.RemoveAt(ind); _LeftUnitBass.RemoveAt(ind); break; case PuppetType.TREBLE: for (int i = 0; i < _LeftTreble.Count; i++) { if (_LeftTreble[i] == unit) { ind = i; } } _LeftTreble.RemoveAt(ind); _LeftUnitTreble.RemoveAt(ind); break; } break; case 1: _RightUnits.Remove(unit); switch (type) { case PuppetType.BASS: for (int i = 0; i < _RightBass.Count; i++) { if (_RightBass[i] == unit) { ind = i; } } _RightBass.RemoveAt(ind); _RightUnitBass.RemoveAt(ind); break; case PuppetType.TREBLE: for (int i = 0; i < _RightTreble.Count; i++) { if (_RightTreble[i] == unit) { ind = i; } } _RightTreble.RemoveAt(ind); _RightUnitTreble.RemoveAt(ind); break; } break; } if (RemoveUnit != null) { RemoveUnit(team, unit, type); } }