Beispiel #1
0
        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
                    );
            }
        }
Beispiel #2
0
 public void CheckAndClearTarget(IShootingTarget target)
 {
     if (thisShootingTarget == target)
     {
         thisShootingTarget = null;
     }
 }
Beispiel #3
0
        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
                );
        }
Beispiel #4
0
        public void ActivateAt(IShootingTarget target)
        {
            Deactivate();
            thisTarget = target;
            thisTarget.SetDestroyedTarget(this);

            Vector3    position = target.GetPosition();
            Quaternion rotation = target.GetRotation();

            SetPosition(position);
            SetRotation(rotation);
            Activate();
        }
Beispiel #5
0
 public void DeactivateImple()
 {
     if (thisTarget != null)
     {
         thisTarget.CheckAndClearDestroyedTarget(this);
     }
     thisTarget = null;
     thisTypedAdaptor.StopDestruction();
     thisDestroyedTargetReserve.Reserve(this);
     if (thisTargetTierDataOnQueue != null)
     {
         SetTier(thisTargetTierDataOnQueue);
         thisTargetTierDataOnQueue = null;
     }
 }
Beispiel #6
0
 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)
                        );
                }
            }
        }
Beispiel #8
0
 public void Construct(IShootingTarget target)
 {
     _target = target;
 }
Beispiel #9
0
        public void ActivateDestoryedTargetAt(IShootingTarget target)
        {
            IDestroyedTarget nextTarget = GetNext();

            nextTarget.ActivateAt(target);
        }
Beispiel #10
0
 public void SetTarget(IShootingTarget target)
 {
     thisShootingTarget = target;
 }
Beispiel #11
0
 public void Construct(IProjectileFactory <Bullet> bulletFactory, IShootFrom shootFrom, IShootingTarget target)
 {
     _bulletFactory = bulletFactory;
     _shootFrom     = shootFrom;
     _target        = target;
 }