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

            Log("Info", "Initialized");
        }
Ejemplo n.º 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>();
        }
Ejemplo n.º 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;
     }
 }
Ejemplo n.º 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;
         }
     }
 }
Ejemplo n.º 7
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>();

            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;
            }
        }
Ejemplo n.º 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));
            }
        }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 13
0
 public static void ExitStation(VRCStation station, VRCPlayerApi player)
 {
     station.GetComponent <CyanEmuStationHelper>().ExitStation();
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 15
0
 void Start()
 {
     station = (VRCStation)GetComponent(typeof(VRCStation));
     exitbutton.SetActive(false);
 }