public void CheckForWaypointEvent(
     IWaypointsFollower follower,
     float normalizedPositionOnCurve
     )
 {
     while (true)
     {
         if (thisCurrentWaypontCurveEvents.Count != 0)
         {
             IWaypointEvent nextWaypontEvent = thisCurrentWaypontCurveEvents.Peek();
             float          eventPoint       = nextWaypontEvent.GetEventPoint();
             if (eventPoint <= normalizedPositionOnCurve)
             {
                 if (eventPoint >= thisInitialEventPoint)
                 {
                     nextWaypontEvent = thisCurrentWaypontCurveEvents.Dequeue();
                     if (!nextWaypontEvent.IsExecuted())
                     {
                         nextWaypontEvent.Execute(follower);
                     }
                 }
             }
             else
             {
                 break;
             }
         }
         else
         {
             break;
         }
     }
 }
Ejemplo n.º 2
0
 protected override void ExecuteImple(IWaypointsFollower follower)
 {
     Debug.Log(
         "normPos: " + thisFollower.GetNormalizedPositionInCurve().ToString() + ", \n" +
         thisString
         );
 }
Ejemplo n.º 3
0
 public void Execute(IWaypointsFollower follwer)
 {
     if (this.IsExecutable())
     {
         thisIsExecuted = true;
         ExecuteImple(follwer);
     }
 }
        protected override void ExecuteImple(IWaypointsFollower follower)
        {
            IPCWaypointCurve nextCurve = thisPCWaypointsManager.GetNextPCCurve();

            if (nextCurve != null)
            {
                nextCurve.SetUpTargetSpawnEvents();
            }
        }
Ejemplo n.º 5
0
 public void CheckAndClearWaypointsFollower(IWaypointsFollower follower)
 {
     if (thisFollower != null)
     {
         if (thisFollower == follower)
         {
             thisFollower = null;
         }
     }
 }
Ejemplo n.º 6
0
 protected override void ExecuteImple(
     IWaypointsFollower follower
     )
 {
     if (follower.GetCurrentWaypointCurve() == thisDeactivateGliderWaypointEventAdaptor.GetThisGlidingTargetWaypointCurve())
     {
         IGliderWaypointsFollower gliderWaypointsFollower = (IGliderWaypointsFollower)follower;
         IGlidingTarget           glider = gliderWaypointsFollower.GetGlider();
         glider.Deactivate();
     }
 }
        public override void SetUpReference()
        {
            if (waypointsFollowerAdaptor != null)
            {
                IWaypointsFollower follower = waypointsFollowerAdaptor.GetWaypointsFollower();
                thisWaypointsManager.SetWaypointsFollower(follower);
            }

            List <IWaypointCurve> waypointCurves = GetWaypointCurvesInChildren();

            thisWaypointsManager.SetWaypointCurves(waypointCurves);
        }
        public override void SetUpReference()
        {
            base.SetUpReference();

            IWaypointsFollower follower = thisWaypointsFollowerAdaptor.GetWaypointsFollower();

            thisGlidingTarget.SetWaypointsFollower(follower);

            thisGlidingTarget.SetGlidingTargetReserve(
                thisGlidingTargetReserve
                );
        }
 public void ExecuteWaypointEventsUpTo(
     IWaypointsFollower follower,
     float eventPoint
     )
 {
     foreach (IWaypointEvent wpEvent in thisCurrentCurve.GetWaypointEvents())
     {
         if (wpEvent.GetEventPoint() < eventPoint)
         {
             wpEvent.Execute(follower);
         }
     }
 }
Ejemplo n.º 10
0
        void DrawWaypointsFollower(Rect rect)
        {
            if (thisSystemIsReady)
            {
                IWaypointsFollower follower = waypointsFollowerAdaptor.GetWaypointsFollower();
                int   currentCurveIndex     = follower.GetCurrentWaypointCurveIndex();
                float normalizedPosInCurve  = follower.GetNormalizedPositionInCurve();

                GUI.Label(
                    rect,
                    "curveID: " + currentCurveIndex.ToString() + ", " +
                    "normPos: " + normalizedPosInCurve.ToString()
                    );
            }
        }
Ejemplo n.º 11
0
        void DrawWaypointEvents(Rect rect)
        {
            if (thisGameIsReady)
            {
                string             result   = "";
                IWaypointsFollower follower = waypointsFollowerAdaptor.GetWaypointsFollower();
                float normalizedPosOnCurve  = follower.GetNormalizedPositionInCurve();
                result += "normPos: " + normalizedPosOnCurve.ToString("N2") + "\n";

                IWaypointCurveCycleManager curveManager = curveCycleManagerAdaptor.GetWaypointsManager();
                int              currentCurveIndex      = gameManager.GetCurrentWaypointGroupIndex();
                IWaypointCurve   currentCurve           = curveManager.GetAllWaypointCurves()[currentCurveIndex];
                IWaypointEvent[] evnets = currentCurve.GetWaypointEvents();
                result += "curve id: " + currentCurve.GetIndex().ToString() + "\n";
                // foreach(IWaypointEvent wpEvent in evnets){
                //  string thisEventString = "\n";
                //  thisEventString += wpEvent.GetName() + ": " + wpEvent.GetEventPoint().ToString("N2");
                //  TargetType thisType = TargetType.Flyer;
                //  bool isRare = false;
                //  if(wpEvent is IShootingTargetSpawnWaypointEvent){
                //      IShootingTargetSpawnWaypointEvent spawnEvent = (IShootingTargetSpawnWaypointEvent)wpEvent;
                //      isRare = spawnEvent.IsRare();
                //      thisType = spawnEvent.GetTargetType();
                //      IShootingTargetSpawnPoint spawnPoint = spawnEvent.GetSpawnPoint();
                //      thisEventString += ", sp: " + spawnPoint.GetName();
                //      IShootingTarget target = spawnPoint.GetSpawnedTarget();
                //      if(target != null)
                //          thisEventString += ", tar: " + target.GetName();
                //      else
                //          thisEventString += ", tar: null";

                //  }
                //  Color col = GetStringColorForType(thisType, isRare);
                //  thisEventString = DKUtility.DebugHelper.StringInColor(thisEventString, col);
                //  result += thisEventString;
                //  string executedString = ", ";
                //  if(!wpEvent.IsExecuted())
                //      executedString += "pending";
                //  else
                //      executedString += DKUtility.DebugHelper.RedString("executed");
                //  result += executedString;
                // }
                GUI.Label(
                    rect,
                    result
                    );
            }
        }
Ejemplo n.º 12
0
            public ConstArg(
                IProcessManager processManager,
                IWaypointsFollower follwer,
                float speed,
                int processOrder,
                IWaypointCurve initialCurve,
                IWaypointCurveCycleManager waypointsManager,

                float initialTime
                ) : base(
                    processManager
                    )
            {
                thisFollower         = follwer;
                thisSpeed            = speed;
                thisProcessOrder     = processOrder;
                thisInitialCurve     = initialCurve;
                thisWaypointsManager = waypointsManager;

                thisInitialTime = initialTime;
            }
        public IFollowWaypointProcess CreateFollowWaypointProcess(
            IWaypointsFollower follower,
            float speed,
            int processOrder,
            IWaypointCurve initialCurve,
            IWaypointCurveCycleManager waypointsManager,
            float initialTime
            )
        {
            FollowWaypointProcess.IConstArg arg = new FollowWaypointProcess.ConstArg(
                thisProcessManager,
                follower,
                speed,
                processOrder,

                initialCurve,
                waypointsManager,

                initialTime
                );
            return(new FollowWaypointProcess(arg));
        }
Ejemplo n.º 14
0
 protected abstract void ExecuteImple(IWaypointsFollower follower);
Ejemplo n.º 15
0
 public void SetWaypointsFollower(IWaypointsFollower follower)
 {
     thisFollower = follower;
 }
 protected override void ExecuteImple(IWaypointsFollower follower)
 {
     thisCameraPivotSmoothLooker.SetSmoothCoefficient(thisSmoothCoefficient);
     thisCameraPivotSmoothLooker.SetLookAtTarget(thisTargetMBAdaptor);
 }
 protected override void ExecuteImple(IWaypointsFollower follower)
 {
     thisGlidingTargetReserve.ActivateShootingTargetAt(
         thisGlidingTargetSpawnPoint
         );
 }
 protected override void ExecuteImple(IWaypointsFollower follower)
 {
     thisTriggeredMotorMechanism.Trigger();
 }
Ejemplo n.º 19
0
        public override void SetUpReference()
        {
            IWaypointsFollower follower = waypointsFollowerAdaptor.GetWaypointsFollower();

            thisWaypointEvent.SetFollower(follower);
        }
Ejemplo n.º 20
0
        void SmoothStartFollower()
        {
            IWaypointsFollower follower = waypointsFollowerAdaptor.GetWaypointsFollower();

            follower.SmoothStart();
        }