Exemple #1
0
        private void OnUnuse(object sender, ObjectInteractEventArgs e)
        {
            netvrkSyncedBase syncScript = e.target.GetComponent <netvrkSyncedBase>();

            if (syncScript != null)
            {
                ushort viewId = e.target.GetComponent <netvrkView>().id;
                netView.Rpc("UseRpc", netvrkTargets.Other, 0, false, viewId);
            }
        }
Exemple #2
0
        private void OnGrab(object sender, ObjectInteractEventArgs e)
        {
            netvrkSyncedBase syncScript = e.target.GetComponent <netvrkSyncedBase>();

            if (syncScript != null)
            {
                netvrkView ioView = e.target.GetComponent <netvrkView>();
                ioView.RequestOwnership();
                syncScript.enabled = false;
                netView.Rpc("GrabRpc", netvrkTargets.Other, 0, true, ioView.id);
            }
        }