// EXECUTABLE: ---------------------------------------------------------------------------- public override bool InstantExecute(GameObject target, IAction[] actions, int index, params object[] parameters) { if (PhotonNetwork.InRoom) { PhotonNetwork.CurrentRoom.IsOpen = open.GetValue(target); PhotonNetwork.CurrentRoom.IsVisible = visible.GetValue(target); } return(true); }
public override IEnumerator Execute(GameObject target, IAction[] actions, int index) { button = canvasButton.GetComponent <ButtonActions>(); if (canvasButton != null) { if (interact.GetValue(target) == false) { button.interactable = false; } else if (interact.GetValue(target) == true) { button.interactable = true; } } yield return(0); }
// EXECUTABLE: ---------------------------------------------------------------------------- public override bool InstantExecute(GameObject target, IAction[] actions, int index) { if (PhotonNetwork.InRoom) { Room room = PhotonNetwork.CurrentRoom; if (permission == Permission.MasterClient && !PhotonNetwork.IsMasterClient) { return(true); } switch (variableType) { case VariableType.Int: if (operation == Operation.Set) { room.SetInt(propertyName.GetValue(target), intValue.GetValue(target), webForward); } else { room.AddInt(propertyName.GetValue(target), intValue.GetValue(target), webForward); } break; case VariableType.Float: if (operation == Operation.Set) { room.SetFloat(propertyName.GetValue(target), floatValue.GetValue(target), webForward); } else { room.AddFloat(propertyName.GetValue(target), floatValue.GetValue(target), webForward); } break; case VariableType.String: room.SetString(propertyName.GetValue(target), stringValue.GetValue(target), webForward); break; case VariableType.Bool: room.SetBool(propertyName.GetValue(target), boolValue.GetValue(target), webForward); break; } } else { Debug.LogWarning("You need to be inside a room in order to change a Room property.", gameObject); } return(true); }
// EXECUTABLE: ---------------------------------------------------------------------------- public override bool InstantExecute(GameObject target, IAction[] actions, int index) { if (PhotonNetwork.InRoom) { Player player = this.target.GetPhotonPlayer(target); if (player == null) { return(true); } if (permission == Permission.LocalPlayer && !player.IsLocal) { return(true); } if (permission == Permission.MasterClient && !PhotonNetwork.IsMasterClient) { return(true); } if (player != null) { switch (variableType) { case VariableType.Int: if (operation == Operation.Set) { player.SetInt(propertyName.GetValue(target), intValue.GetValue(target), webForward); } else { player.AddInt(propertyName.GetValue(target), intValue.GetValue(target), webForward); } break; case VariableType.Float: if (operation == Operation.Set) { player.SetFloat(propertyName.GetValue(target), floatValue.GetValue(target), webForward); } else { player.AddFloat(propertyName.GetValue(target), floatValue.GetValue(target), webForward); } break; case VariableType.String: player.SetString(propertyName.GetValue(target), stringValue.GetValue(target), webForward); break; case VariableType.Bool: player.SetBool(propertyName.GetValue(target), boolValue.GetValue(target), webForward); break; } } } else { Debug.LogWarning("You need to be inside a room in order to change a PhotonPlayer property.", gameObject); } return(true); }
public bool equals(BoolProperty other) { return(this.GetValue() == other.GetValue()); }