void DrawSpawnPointForEachTarget(Rect rect) { if (thisSystemIsReady) { IStaticShootingTarget[] targets = thisStaticShootingTargetReserve.GetStaticShootingTargets(); string result = ""; foreach (IStaticShootingTarget target in targets) { IStaticTargetSpawnPoint spawnPoint = target.GetShootingTargetSpawnPoint(); result += "target # " + target.GetIndex().ToString() + ", "; if (spawnPoint == null) { result += "null"; } else { result += spawnPoint.GetIndex().ToString(); } result += "\n"; } GUI.Label( rect, result ); } }
public override void ActivateShootingTargetAt(IShootingTargetSpawnPoint point) { IStaticShootingTarget target = GetNext(); IStaticTargetSpawnPoint typedPoint = (IStaticTargetSpawnPoint)point; target.ActivateAt(typedPoint); }
void SetSpawnPoint(IStaticTargetSpawnPoint point) { thisSpawnPoint = point; point.SetTarget(this); SetParent(point); ResetLocalTransform(); }
public void ActivateStaticShootingTargetAtDrawnSpawnPoint() { IStaticTargetSpawnPoint spawnPoint = (IStaticTargetSpawnPoint)thisStaticTargetSpawnPointGroup.Draw(); thisStaticShootingTargetReserve.ActivateShootingTargetAt(spawnPoint); thisStaticTargetSpawnPointGroup.Log(); }
void ClearSpawnPoint() { if (thisSpawnPoint != null) { thisSpawnPoint.CheckAndClearTarget(this); } thisSpawnPoint = null; }
void SetStaticShootingTargetsAtSpawnPoints() { IStaticTargetSpawnPoint[] points = CollectStaticTargetSpawnPonints(); IStaticShootingTarget[] targets = thisStaticShootingTargetReserve.GetStaticShootingTargets(); int targetCount = targets.Length; for (int i = 0; i < targetCount; i++) { IStaticTargetSpawnPoint point = points[i]; thisStaticShootingTargetReserve.ActivateShootingTargetAt(point); } thisStaticTargetsAreSet = true; }
public void ActivateAt(IStaticTargetSpawnPoint point) { Deactivate(); SetSpawnPoint(point); Activate(); }