예제 #1
0
 /// <summary>
 /// Handle variables sent from the remote client.
 /// </summary>
 public void HandleSyncedVariables(float[] variables)
 {
     if (variables != null)
     {
         Steering      = variables[0];
         Throttle      = variables[1];
         Brake         = variables[2];
         TargetSpeed   = variables[3];
         WaypointSet   = TrafficManager.GetWaypoint(variables[4], (int)variables[5]);
         WaypointStart = Convert.ToInt32(variables[6]);
         WaypointEnd   = Convert.ToInt32(variables[7]);
         if (isClockwise != variables[8])
         {
             isClockwise = variables[8];
             if (isClockwise == 1)
             {
                 navigationFsm = Utils.GetPlaymakerScriptByName(parentGameObject.transform.FindChild("NavigationCW").gameObject, "Navigation");
             }
             else
             {
                 navigationFsm = Utils.GetPlaymakerScriptByName(parentGameObject.transform.FindChild("NavigationCCW").gameObject, "Navigation");
             }
         }
     }
 }