Example #1
0
 internal static void Callback(CustomEventData customEventData)
 {
     if (customEventData.type == "AssignPlayerToTrack")
     {
         Track track = GetTrack(customEventData.data);
         if (track != null)
         {
             PlayerTrack.AssignTrack(track);
         }
     }
 }
 internal static void Callback(CustomEventData customEventData)
 {
     if (customEventData.type == ASSIGNPLAYERTOTRACK)
     {
         NoodlePlayerTrackEventData noodleData = (NoodlePlayerTrackEventData)NoodleEventDatas[customEventData];
         Track track = noodleData.Track;
         if (track != null)
         {
             PlayerTrack.AssignTrack(track);
         }
     }
 }
        internal static void AssignTrack(Track track)
        {
            if (_instance == null)
            {
                GameObject gameObject = GameObject.Find("GameCore/Origin");
                _origin          = gameObject.transform;
                _instance        = gameObject.AddComponent <PlayerTrack>();
                _pauseController = FindObjectOfType <PauseController>();
                _startLocalRot   = _origin.localRotation;
                _startPos        = _origin.localPosition;
            }

            _track = track;
        }
Example #4
0
 internal static void Callback(CustomEventData customEventData)
 {
     if (customEventData.type == ASSIGNPLAYERTOTRACK)
     {
         NoodlePlayerTrackEventData?noodleData = TryGetEventData <NoodlePlayerTrackEventData>(customEventData);
         if (noodleData != null)
         {
             Track track = noodleData.Track;
             if (track != null)
             {
                 PlayerTrack.AssignTrack(track);
             }
         }
     }
 }
        internal static void AssignTrack(Track track)
        {
            if (_instance == null)
            {
                GameObject gameObject   = GameObject.Find("LocalPlayerGameCore");
                GameObject noodleObject = new GameObject("NoodlePlayerTrack");
                _origin = noodleObject.transform;
                _origin.SetParent(gameObject.transform.parent, true);
                gameObject.transform.SetParent(_origin, true);

                _instance        = noodleObject.AddComponent <PlayerTrack>();
                _pauseController = FindObjectOfType <PauseController>();
                if (_pauseController != null)
                {
                    _pauseController.didPauseEvent += _instance.OnDidPauseEvent;
                }

                _startLocalRot = _origin.localRotation;
                _startPos      = _origin.localPosition;
            }

            _track = track;
        }