Exemple #1
0
        protected void RegisterState(Vector3Event evt, UnityAction <Vector3> call, OwnershipMode mode = OwnershipMode.OnGrabbed)
        {
            if (networkMode == NetworkMode.Standalone)
            {
                evt.AddListener(call);
            }
#if USING_PHOTON
            else
            {
                PhotonVector3 photon = gameObject.GetComponent <PhotonVector3>();
                if (photon == null)
                {
                    photon = gameObject.AddComponent <PhotonVector3>();
                }

                photon.AddClient(evt, call);

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

                if (networkMode == NetworkMode.NetworkOnGrab)
                {
                    onGrab.AddListener(photon.ChangeOwnership);
                }
                else
                {
                    onFocus.AddListener(photon.ChangeOwnership);
                }
            }
#endif
        }