void DrawTargetsBySpawnPoints(Rect rect) { if (thisSystemIsReady) { IStaticTargetSpawnPoint[] spawnPoints = CollectStaticTargetSpawnPonints(); string result = ""; int indexOfPoint = 0; foreach (IStaticTargetSpawnPoint point in spawnPoints) { IShootingTarget assignedTarget = point.GetSpawnedTarget(); result += "spawnPoint #" + indexOfPoint.ToString() + ": "; if (assignedTarget == null) { result += " null "; } else { result += "target # " + assignedTarget.GetIndex().ToString(); } result += "\n"; indexOfPoint++; } GUI.Label( rect, result ); } }
public void CheckAndClearTarget(IShootingTarget target) { if (thisShootingTarget == target) { thisShootingTarget = null; } }
void DrawShootingTargetByDestroyedTarget(Rect rect) { IDestroyedTarget[] destroyedTargets = thisDestroyedTargetReserve.GetTargets(); string result = ""; foreach (IDestroyedTarget dTarget in destroyedTargets) { result += "dTarget #" + dTarget.GetIndex().ToString() + ", "; IShootingTarget sTarget = dTarget.GetShootingTarget(); if (sTarget == null) { result += "null"; } else { result += sTarget.GetIndex().ToString(); } result += "\n"; } GUI.Label( rect, result ); }
public void ActivateAt(IShootingTarget target) { Deactivate(); thisTarget = target; thisTarget.SetDestroyedTarget(this); Vector3 position = target.GetPosition(); Quaternion rotation = target.GetRotation(); SetPosition(position); SetRotation(rotation); Activate(); }
public void DeactivateImple() { if (thisTarget != null) { thisTarget.CheckAndClearDestroyedTarget(this); } thisTarget = null; thisTypedAdaptor.StopDestruction(); thisDestroyedTargetReserve.Reserve(this); if (thisTargetTierDataOnQueue != null) { SetTier(thisTargetTierDataOnQueue); thisTargetTierDataOnQueue = null; } }
void DeactivateSpawnedTargets() { IShootingTargetSpawnWaypointEvent[] spawnEvents = thisSpawnEvents; if (spawnEvents != null) { foreach (IShootingTargetSpawnWaypointEvent spawnEvent in spawnEvents) { IShootingTargetSpawnPoint spawnPoint = spawnEvent.GetSpawnPoint(); IShootingTarget spawnedTarget = spawnPoint.GetSpawnedTarget(); if (spawnedTarget != null) { spawnedTarget.Deactivate(); } } } }
public void RegisterTargetDestroyed(IShootingTarget target, bool isRare) { if (!thisGameplayIsEnded) { float heat = target.GetHeatBonus(); thisHeatManager.AddHeat(heat); int score = target.GetDestructionScore(); thisScoreManager.AddScore(score); if (isRare) { int targetTier = target.GetTier(); int currencyGained = CalculateCurrencyGained(targetTier); thisCurrencyManager.AddGainedCurrency(currencyGained); IDestroyedTarget destroyedTarget = target.GetDestroyedTarget(); destroyedTarget.PopText( currencyGained.ToString(), new Color(.8f, .2f, .9f) ); } } }
public void Construct(IShootingTarget target) { _target = target; }
public void ActivateDestoryedTargetAt(IShootingTarget target) { IDestroyedTarget nextTarget = GetNext(); nextTarget.ActivateAt(target); }
public void SetTarget(IShootingTarget target) { thisShootingTarget = target; }
public void Construct(IProjectileFactory <Bullet> bulletFactory, IShootFrom shootFrom, IShootingTarget target) { _bulletFactory = bulletFactory; _shootFrom = shootFrom; _target = target; }