Esempio n. 1
0
        protected void RegisterState(BoolEvent evt, UnityAction <bool> call, OwnershipMode mode = OwnershipMode.OnGrabbed)
        {
            if (networkMode == NetworkMode.Standalone)
            {
                evt.AddListener(call);
            }
 #if USING_PHOTON
            else
            {
                PhotonBool photon = gameObject.GetComponent <PhotonBool>();
                if (photon == null)
                {
                    photon = gameObject.AddComponent <PhotonBool>();
                }

                photon.AddClient(evt, call);

                if (mode == OwnershipMode.OnGrabbed)
                {
                    onGrab.AddListener(photon.ChangeOwnership);
                }
                else
                {
                    onFocus.AddListener(photon.ChangeOwnership);
                }
            }
#endif
        }
Esempio n. 2
0
 public Elm(PhotonBool s, BoolEvent evt, UnityAction <bool> call, int w)
 {
     state = s;
     which = w;
     onChanged.AddListener(call);
     evt.AddListener(Change);
 }
Esempio n. 3
0
        protected void RegisterState(BoolEvent evt, UnityAction <bool> call)
        {
            if (networkMode == NetworkMode.Standalone)
            {
                evt.AddListener(call);
            }
 #if USING_PHOTON
            else
            {
                PhotonBool photon = gameObject.AddComponent <PhotonBool>();
                photon.onChanged.AddListener(call);
                evt.AddListener(photon.Change);
                if (networkMode == NetworkMode.NetworkOnGrab)
                {
                    onGrab.AddListener(photon.ChangeOwnership);
                }
                else
                {
                    onFocus.AddListener(photon.ChangeOwnership);
                }
            }
#endif
        }