public void Action()
    {
        if (!objectPool || !RandomJudgement())
        {
            return;
        }

        Networking.SetOwner(Networking.LocalPlayer, objectPool.gameObject);

        objectPool.Return(gameObject);
    }
Beispiel #2
0
 public override void OnPlayerLeft(VRCPlayerApi player)
 {
     if (Networking.IsMaster)
     {
         foreach (GameObject o in _objectPool.Pool)
         {
             if (o.activeSelf && Networking.IsOwner(player, o))
             {
                 _objectPool.Return(o);
             }
         }
     }
 }
    public void Action()
    {
        if (!objectPool || !RandomJudgement())
        {
            return;
        }

        Networking.SetOwner(Networking.LocalPlayer, objectPool.gameObject);

        foreach (GameObject obj in objectPool.Pool)
        {
            objectPool.Return(obj);
        }
    }
Beispiel #4
0
    public void OnTriggerEnter(Collider other)
    {
        if (!Utilities.IsValid(other)) //player stations will break this.
        {
            Debug.Log("trigger had something bad enter");
            return;
        }

        VRCPickup temppickup = (VRCPickup)other.GetComponent(typeof(VRCPickup));

        if (temppickup)
        {
            temppickup.Drop();
        }

        if (Networking.LocalPlayer.IsOwner(other.gameObject))
        {
            Networking.SetOwner(Networking.LocalPlayer, gameObject);
            pool.Return(other.gameObject);
        }
    }