Ejemplo n.º 1
0
 public void OnStartChanting(SbiEvent e)
 {
     TimerEventData data = e.data as TimerEventData;
     if(gameObject == data.role) {
         animator.SetBool("isChanting", true);
     }
 }
Ejemplo n.º 2
0
 public void OnStopGuiding(SbiEvent e)
 {
     TimerEventData data = e.data as TimerEventData;
     if(gameObject == data.role) {
         animator.SetBool("isGuiding", false);
     }
 }
Ejemplo n.º 3
0
 public void OnDead(SbiEvent e)
 {
     DeadEventData data = e.data as DeadEventData;
     if(gameObject == data.role) {
         animator.SetBool("isDead", true);
     }
 }
Ejemplo n.º 4
0
 public void OnStopGuiding(SbiEvent e)
 {
     TimerEventData data = e.data as TimerEventData;
     if((role == data.role) && (null != data.timer)) {
         guideTimer = null;
         gameObject.SetActive(false);
     }
 }
Ejemplo n.º 5
0
 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;
 }
Ejemplo n.º 6
0
 public void OnStopChanting(SbiEvent e)
 {
     TimerEventData data = e.data as TimerEventData;
     if(role == data.role) {
         chantTimer = null;
         gameObject.SetActive(false);
     }
 }
Ejemplo n.º 7
0
 protected override void OnSkillButtonDown(SbiEvent e)
 {
     SkillButtonEventData data = e.data as SkillButtonEventData;
     if (index!= data.index)
     {
         if (guideTimer.isTiming) { StopGuide(); }
         return;
     }
     StartGuide();
 }
Ejemplo n.º 8
0
    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);
        }
    }
Ejemplo n.º 9
0
 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);
     }
 }
Ejemplo n.º 10
0
 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;
     }
 }
Ejemplo n.º 11
0
 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;
     }
 }
Ejemplo n.º 12
0
 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);
         }
     }
 }
Ejemplo n.º 13
0
 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;
     }
 }
Ejemplo n.º 14
0
 protected override void OnSkillButtonUp(SbiEvent e)
 {
     SkillButtonEventData data = e.data as SkillButtonEventData;
     if (index != data.index) { return; }
     CancelChant();
 }
Ejemplo n.º 15
0
 public void OnConnected(SbiEvent e)
 {
     GetComponentInChildren<Text>().text = "Disconnect";
     GetComponentInChildren<EventButton>().eventName = "disconnectButtonClick";
 }
Ejemplo n.º 16
0
 protected override void OnPlayerMove(SbiEvent e)
 {
     CancelChant();
 }
Ejemplo n.º 17
0
 protected override void OnSkillButtonDown(SbiEvent e)
 {
     SkillButtonEventData data = e.data as SkillButtonEventData;
     if (index != data.index) {
         CancelChant();
         return;
     }
     if (!cooldownTimer.isTiming) { StartChant(); }
 }
Ejemplo n.º 18
0
 public void OnJoined(SbiEvent e)
 {
     GetComponentInChildren<Text>().text = "Leave";
     GetComponentInChildren<EventButton>().eventName = "leaveButtonClick";
 }
Ejemplo n.º 19
0
 private void FinishChant(SbiEvent e)
 {
     photonView.RPC(
         "FinishChantRPC", PhotonTargets.All, chantTimer.GetFinishTime() , position, direction
     );
 }
Ejemplo n.º 20
0
 protected override void OnPlayerMove(SbiEvent e)
 {
     StopGuide();
 }
Ejemplo n.º 21
0
 public void Connect(SbiEvent e)
 {
     PhotonNetwork.offlineMode = false;
     if (!PhotonNetwork.connected)
         PhotonNetwork.ConnectUsingSettings(GameManager.gameVersion);
 }
Ejemplo n.º 22
0
 public void Match(SbiEvent e)
 {
     if (PhotonNetwork.connectedAndReady && !PhotonNetwork.inRoom)
     {
         PhotonNetwork.JoinRandomRoom();
     }
 }
Ejemplo n.º 23
0
 public void Leave(SbiEvent e)
 {
     if (PhotonNetwork.inRoom)
     {
         PhotonNetwork.LeaveRoom();
     }
 }
Ejemplo n.º 24
0
 protected override void OnSkillButtonUp(SbiEvent e)
 {
     SkillButtonEventData data = e.data as SkillButtonEventData;
     if (index != data.index) return;
     StopGuide();
 }