public static void OnStationEnter(this GameObject obj, VRCStation station)
 {
     foreach (var stationHandler in obj.GetComponents <ICyanEmuStationHandler>())
     {
         stationHandler.OnStationEnter(station);
     }
 }
Exemple #2
0
 private void Start()
 {
     station = (VRCStation)GetComponentInChildren(typeof(VRCStation), true);
     if (Networking.IsMaster)
     {
         station.gameObject.SetActive(true);
     }
 }
Exemple #3
0
        private void Start()
        {
            station = (VRCStation)GetComponent(typeof(VRCStation));
            station.disableStationExit = true;
            triggerCollider            = GetComponent <Collider>();
            initialPosition            = transform.localPosition;

            Log("Info", "Initialized");
        }
Exemple #4
0
        public static void InitializeStations(VRCStation station)
        {
            if (station.gameObject.GetComponent <CyanEmuStationHelper>())
            {
                station.LogWarning("Multiple VRCStation components on the same gameobject! " + VRC.Tools.GetGameObjectPath(station.gameObject));
                return;
            }

            station.gameObject.AddComponent <CyanEmuStationHelper>();
        }
Exemple #5
0
 public void SnowboardEntered(VRC.SDKBase.VRCPlayerApi player, VRCStation station)
 {
     if (player.isLocal)
     {
         this.station       = station;
         localUser          = player;
         transform.position = StartPosition.position;
         transform.rotation = StartPosition.rotation;
         momentum           = Vector2.zero;
         gravityMomentum    = 0;
     }
 }
Exemple #6
0
 // Used to fix non-seated immobilize bug.
 private void CheckAutoEject(VRCPlayerApi player)
 {
     if (player == Networking.LocalPlayer)
     {
         VRCStation tempStation = (VRCStation)this.gameObject.GetComponent(typeof(VRCStation));
         if (tempStation != null && AutoEject)
         {
             AutoEject = false;
             tempStation.ExitStation(player);
             tempStation.seated = false;
         }
     }
 }
        public static void InitializeStations(VRCStation station)
        {
            if (station.gameObject.GetComponent <CyanEmuStationHelper>())
            {
                station.LogWarning("Multiple VRCStation components on the same gameobject! " + VRC.Tools.GetGameObjectPath(station.gameObject));
                return;
            }

            station.gameObject.AddComponent <CyanEmuStationHelper>();

            if (!station.seated && station.PlayerMobility != VRCStation.Mobility.Mobile)
            {
                station.LogWarning("Station has seated unchecked but is not mobile! " + VRC.Tools.GetGameObjectPath(station.gameObject));
            }
        }
        private void Awake()
        {
            station_ = GetComponent <VRCStation>();

            CheckForMissingComponents();

            if (station_.stationEnterPlayerLocation == null)
            {
                station_.stationEnterPlayerLocation = transform;
            }
            if (station_.stationExitPlayerLocation == null)
            {
                station_.stationExitPlayerLocation = transform;
            }
        }
Exemple #9
0
        public void OnStationExit(VRCStation station)
        {
#if VRC_SDK_VRCSDK2
            VRCSDK2.VRC_Station s = (VRCSDK2.VRC_Station)station;
            if (s.OnLocalPlayerExitStation.TriggerObject == null)
            {
                return;
            }

            VRC_Trigger trigger = s.OnLocalPlayerExitStation.TriggerObject.GetComponent <VRC_Trigger>();
            if (trigger != null)
            {
                trigger.ExecuteCustomTrigger(s.OnLocalPlayerExitStation.CustomName);
            }
#endif
        }
        public static void InitializeStations(VRCStation station)
        {
            CyanEmuStationHelper prevHelper = station.gameObject.GetComponent <CyanEmuStationHelper>();

            if (prevHelper != null)
            {
                DestroyImmediate(prevHelper);
                station.LogWarning("Destroying old station helper on object: " + VRC.Tools.GetGameObjectPath(station.gameObject));
            }

            station.gameObject.AddComponent <CyanEmuStationHelper>();

            if (!station.seated && station.PlayerMobility != VRCStation.Mobility.Mobile)
            {
                station.LogWarning("Station has seated unchecked but is not mobile! " + VRC.Tools.GetGameObjectPath(station.gameObject));
            }
        }
Exemple #11
0
        private void Awake()
        {
            station_ = GetComponent <VRCStation>();

            Collider collider = GetComponent <Collider>();

            if (collider == null)
            {
                gameObject.AddComponent <BoxCollider>().isTrigger = true;
            }

            if (station_.stationEnterPlayerLocation == null)
            {
                station_.stationEnterPlayerLocation = transform;
            }
            if (station_.stationExitPlayerLocation == null)
            {
                station_.stationExitPlayerLocation = transform;
            }
        }
Exemple #12
0
        private void ExitStation(VRCPlayerApi player)
        {
            // Used to fix non-seated immobilize bug.
            if (player == Networking.LocalPlayer)
            {
                VRCStation tempStation = (VRCStation)this.gameObject.GetComponent(typeof(VRCStation));
                if (tempStation != null && !tempStation.seated && !AutoEject)
                {
                    tempStation.seated = true;
                    AutoEject          = true;

                    player.UseAttachedStation();
                }

                Collider tempCollider = (Collider)this.gameObject.GetComponent(typeof(Collider));
                if (tempCollider != null)
                {
                    tempCollider.enabled = true;
                }
            }

            Debug.Log("Player Exited seat/station.");
            SendCustomEvent("Show");
        }
Exemple #13
0
 public static void ExitStation(VRCStation station, VRCPlayerApi player)
 {
     station.GetComponent <CyanEmuStationHelper>().ExitStation();
 }
Exemple #14
0
 public void OnStationExit(VRCStation station)
 {
     VRC.SDK3.Components.VRCStation sdk3Station = station as VRC.SDK3.Components.VRCStation;
     udonBehaviour_.RunEvent(sdk3Station.OnLocalPlayerExitStation, ("Player", Networking.LocalPlayer));
 }
 void Start()
 {
     station = (VRCStation)GetComponent(typeof(VRCStation));
     exitbutton.SetActive(false);
 }