public void OnStartChanting(SbiEvent e) { TimerEventData data = e.data as TimerEventData; if(gameObject == data.role) { animator.SetBool("isChanting", true); } }
public void OnStopGuiding(SbiEvent e) { TimerEventData data = e.data as TimerEventData; if(gameObject == data.role) { animator.SetBool("isGuiding", false); } }
public void OnDead(SbiEvent e) { DeadEventData data = e.data as DeadEventData; if(gameObject == data.role) { animator.SetBool("isDead", true); } }
public void OnStopGuiding(SbiEvent e) { TimerEventData data = e.data as TimerEventData; if((role == data.role) && (null != data.timer)) { guideTimer = null; gameObject.SetActive(false); } }
public void OnRoleChange(SbiEvent e) { PlayerChangeEventData data = e.data as PlayerChangeEventData; role = data.player; roleHealthBar.role = role.GetComponent<Role>(); roleChantingBar.role = role; roleGuidingBar.role = role; }
public void OnStopChanting(SbiEvent e) { TimerEventData data = e.data as TimerEventData; if(role == data.role) { chantTimer = null; gameObject.SetActive(false); } }
protected override void OnSkillButtonDown(SbiEvent e) { SkillButtonEventData data = e.data as SkillButtonEventData; if (index!= data.index) { if (guideTimer.isTiming) { StopGuide(); } return; } StartGuide(); }
public void OnEventTriggered(SbiEvent e) { bool isLeft = (e.type == "leftButtonClick"); if (CanMove()) { float delay = NetworkManager.Instance.RPCDelay; this.photonView.RPC("StartMove",PhotonTargets.All, (float)PhotonNetwork.time + delay, isLeft); } }
public void OnStartGuiding(SbiEvent e) { TimerEventData data = e.data as TimerEventData; if((role == data.role) && (null != data.timer)) { guideTimer = data.timer; fillImage.color = guideTimer.gameObject.GetComponent<SkillCasterBase>().buttonColor; backgroundImage.color = fillImage.color - new Color(0.5f, 0.5f, 0.5f, 0f); gameObject.SetActive(true); } }
public void OnEventTriggered(SbiEvent e) { Rigidbody rigidbody = GetComponent<Rigidbody>(); float speed = 10; Role role = GetComponent<Role>(); if(null != role) { speed = (float)role.speed; } Vector3 velocity = transform.localToWorldMatrix.MultiplyVector(direction*speed); if(null != rigidbody) { rigidbody.velocity = velocity; } }
public void OnPlayerSkillsReady(SbiEvent e) { PlayerSkillsReadyEventData data = (PlayerSkillsReadyEventData)e.data; Role role = (Role)data.player.GetComponent<Role>(); if(playerId != role.playerId) { return; } GameObject[] playerSkillCasters = data.skillCasters; if(playerSkillCasters.Length > skillIndex) { skillProperties = playerSkillCasters[skillIndex].GetComponent<SkillProperties>(); } if(null != skillProperties) { GetComponentInChildren<Text>().text = skillProperties.skillName; name = skillProperties.skillName + " Button"; GetComponent<Image>().color = skillProperties.buttonColor; } }
public void CastEvent(Object caster, string type, SbiEventData data) { PushString(ref castedTypes, type); foreach(Hearing h in hearings) { if(((caster == h.target) || (this == h.target)) && (type == h.type)) { SbiEvent e = new SbiEvent(); e.target = caster; e.listener = h.listener; e.type = h.type; e.data = data; e.time = (System.DateTime.UtcNow - epochStart).TotalMilliseconds; h.method(e); } } }
public void OnCasterReady(SbiEvent e) { CasterReadyEventData data = (CasterReadyEventData)e.data; if(GameManager.Instance.GetPlayer() != data.player) { return; } if(skillIndex == data.skillIndex) { skillCasterBase = data.skillCaster.GetComponent<SkillCasterBase>(); coolDownTimer = skillCasterBase.GetTimerByType("Cooldown"); } if(null != skillCasterBase) { Debug.Log("OnCasterReady color:" + skillCasterBase.buttonColor.ToString() ); GetComponentInChildren<Text>().text = skillCasterBase.skillName; name = skillCasterBase.skillName + " Button"; GetComponent<Image>().color = skillCasterBase.buttonColor; } if(null != coolDownTimer) { coolDownTimeText = GetComponentsInChildren<Text>()[1] as Text; coolDownIndicatorRectTransform = (GetComponentsInChildren<Image>()[1] as Image).rectTransform; } }
protected override void OnSkillButtonUp(SbiEvent e) { SkillButtonEventData data = e.data as SkillButtonEventData; if (index != data.index) { return; } CancelChant(); }
public void OnConnected(SbiEvent e) { GetComponentInChildren<Text>().text = "Disconnect"; GetComponentInChildren<EventButton>().eventName = "disconnectButtonClick"; }
protected override void OnPlayerMove(SbiEvent e) { CancelChant(); }
protected override void OnSkillButtonDown(SbiEvent e) { SkillButtonEventData data = e.data as SkillButtonEventData; if (index != data.index) { CancelChant(); return; } if (!cooldownTimer.isTiming) { StartChant(); } }
public void OnJoined(SbiEvent e) { GetComponentInChildren<Text>().text = "Leave"; GetComponentInChildren<EventButton>().eventName = "leaveButtonClick"; }
private void FinishChant(SbiEvent e) { photonView.RPC( "FinishChantRPC", PhotonTargets.All, chantTimer.GetFinishTime() , position, direction ); }
protected override void OnPlayerMove(SbiEvent e) { StopGuide(); }
public void Connect(SbiEvent e) { PhotonNetwork.offlineMode = false; if (!PhotonNetwork.connected) PhotonNetwork.ConnectUsingSettings(GameManager.gameVersion); }
public void Match(SbiEvent e) { if (PhotonNetwork.connectedAndReady && !PhotonNetwork.inRoom) { PhotonNetwork.JoinRandomRoom(); } }
public void Leave(SbiEvent e) { if (PhotonNetwork.inRoom) { PhotonNetwork.LeaveRoom(); } }
protected override void OnSkillButtonUp(SbiEvent e) { SkillButtonEventData data = e.data as SkillButtonEventData; if (index != data.index) return; StopGuide(); }