コード例 #1
0
        void OnTurnerTurn(Vector3 targetDirection, float angleWithMoveDirection)
        {
            int layerToUse = playerLayer;// suppliedEventsForTurn ? playerLayer : playerLayer+1;

            //take control of the players end play to call it when we're facing the target
            endEventPlayerPlay = eventPlayer.OverrideEndPlay(layerToUse, OnEndPlayAttempt, "turning");

            /*
             *  below is only used if we're using animation events
             *
             *  else:
             *      eventPlayer.SkipPlay(layerToUse, MovementController.animationPackName);
             *
             *      if turner.disableSlerp == false:
             *          turner is in charge of ending our turn
             */

            turner.disableSlerp = true;// inTurnAnimation;


            //set the angle parameter
            eventPlayer[turnAngleName].SetValue(angleWithMoveDirection);
            //check if turn is to right
            eventPlayer[turnRightName].SetValue(Vector3.Angle(transform.right, targetDirection) <= 90);

            if (!suppliedEventsForTurn)
            {
                Playlist.InitializePerformance("Turn Default", behavior.defaultTurnEvents, eventPlayer, false, layerToUse, MiniTransform.zero, forceInterrupt: true, onEndPerformanceCallbacks: null);
            }
        }
コード例 #2
0
 void OnEndTurn(bool immediate)
 {
     if (endEventPlayerPlay != null)
     {
         endEventPlayerPlay.EndPlay("turn");
         endEventPlayerPlay = null;
     }
 }
コード例 #3
0
 void OnWaypointArrive(bool immediate)
 {
     if (immediate)
     {
         eventPlayer.SkipPlay(workingLayer, MovementController.animationPackName);
     }
     else
     {
         if (waypoint_endEventPlayerPlay != null)
         {
             waypoint_endEventPlayerPlay.EndPlay("end waypoint ");// + reason);
             waypoint_endEventPlayerPlay = null;
         }
     }
 }
コード例 #4
0
        /*
         *  parameters:
         *      layer (internally set), vector3 target
         *
         *  makes the controller set up waypoint tracking to go to the specified position
         *  (cue's runtime interest position)
         *
         *  the cue ends when the transform is within the arrive threshold
         *
         *  waypoint cue hiearchy:
         *      base
         *          start movement cue
         *          waypoint cue <-- cue calls method below
         *
         *  so movement should already have been started by the time this method is called
         */
        void GoToWaypoint(object[] parameters)
        {
            Debug.Log("going to waypoint in tracker event");
            int l = parameters.Length;

            //unpack parameters
            // int layer
            workingLayer = (int)parameters[0];


            waypointTracker.GoToWaypointManual((Vector3)parameters[1], OnWaypointArrive);

            if (waypointTracker.hasDestination)
            {
                //take control of the player's end play callback, to call it when arriving at waypoint
                waypoint_endEventPlayerPlay = eventPlayer.OverrideEndPlay(workingLayer, null, "Go to waypoint");
                Debug.Log("going to waypoint in tracker 2");
            }
            // else {
            //     //movement within threshold, skip playing any animation and end the cue/event right after
            //     eventPlayer.SkipPlay(workingLayer, MovementController.animationPackName);
            // }
        }