public override void SetUpReference()
 {
     if (waypointsManagerAdaptor != null)
     {
         IWaypointCurveCycleManager waypointsManager = waypointsManagerAdaptor.GetWaypointsManager();
         thisFollower.SetWaypointsManager(waypointsManager);
     }
 }
        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
                    );
            }
        }
Exemple #3
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));
        }
Exemple #5
0
 public void SetWaypointsManager(IWaypointCurveCycleManager waypointsManager)
 {
     thisWaypointsManager = waypointsManager;
 }