Ejemplo n.º 1
0
        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();
 }
Ejemplo n.º 4
0
        public void ActivateStaticShootingTargetAtDrawnSpawnPoint()
        {
            IStaticTargetSpawnPoint spawnPoint = (IStaticTargetSpawnPoint)thisStaticTargetSpawnPointGroup.Draw();

            thisStaticShootingTargetReserve.ActivateShootingTargetAt(spawnPoint);

            thisStaticTargetSpawnPointGroup.Log();
        }
 void ClearSpawnPoint()
 {
     if (thisSpawnPoint != null)
     {
         thisSpawnPoint.CheckAndClearTarget(this);
     }
     thisSpawnPoint = null;
 }
Ejemplo n.º 6
0
        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();
 }