public override void Interact() { Debug.Log("Try in insert key"); if (isUsable) { // Force activate switch networkRPC.Interact(keyHoleToPutIn.ID); Destroy(gameObject); } }
public void Interact(int ID) { // do network thing here; IInteractable interactable = InteractableFactory.Instance.GetInteractable(ID); if (isOffline) { // logic at here networkRPC.Interact(interactable.ID); return; } switch (interactable.effectType) { case EffectType.EFFECT_BOTH: photonView.RPC("Interact", RpcTarget.AllBuffered, ID); break; case EffectType.EFFECT_OWN: networkRPC.Interact(interactable.ID); break; case EffectType.EFFECT_OTHER: photonView.RPC("Interact", RpcTarget.OthersBuffered, ID); interactable.SelfInteract(); break; } }