public void Grab() { // take ownership of each of the selected node foreach (var node in MPO.SelectedNodes) { int i = 0; while (Nodes[i] != node) { i++; } if (PhotonNetwork.connected) { photonView.RPC("GrabNode", PhotonTargets.MasterClient, i); } //if (!node.GameObject.GetComponent<MultiuserMPOPartInterface>().photonView.isMine) // node.GameObject.GetComponent<MultiuserMPOPartInterface>().photonView.RequestOwnership(); /*foreach (var task in TaskList.Tasks) { * if (task.GameObject == node.GameObject) * task.Enabled = true; * }*/ } MPO.GrabIfPointingAt(); }
public IEnumerator TaskListCoroutine() { while (CurrentTaskId != Tasks.Count) { if (CurrentTaskId == -1) { yield return(null); } int tempTaskId = CurrentTaskId; // destroy previous hint if any if (Hint != null) { Destroy(Hint); } // get the task Task task = Tasks[tempTaskId]; // unlock node ChangeLockOfTaskNode(task, false); // fire task start event if (TaskStartListeners != null) { TaskStartListeners.Invoke(task); } task.DrawTaskHint(); while (tempTaskId == CurrentTaskId) { task.UpdateTaskHint(); yield return(null); } MPO.Release(); MPO.Deselect(task.GameObject); ChangeLockOfTaskNode(task, true); // destroy hint if any if (Hint != null) { Destroy(Hint); } // run task event coroutine if exists if (task.TaskEvent != null) { yield return(StartCoroutine(task.TaskEvent.TaskEventCoroutine())); } yield return(null); } yield return(null); }
public void GrabCage() { // take ownership of the cage if (!photonView.isMine) { photonView.RequestOwnership(); } MPO.GrabCage(); }
public void Release() { MPO.Release(); }
public void ToggleSelect() { MPO.ToggleSelect(); }
public void Deselect() { MPO.Deselect(); }
public void Select() { MPO.Select(); }