public static void Send_Acnt_VoiceState(CS_VOICESTATE_TYPE type)
        {
            CSPkg cSPkg = NetworkModule.CreateDefaultCSPKG(4850u);

            cSPkg.stPkgData.get_stAcntVoiceState().bVoiceState = type;
            Singleton <NetworkModule> .GetInstance().SendGameMsg(ref cSPkg, 0u);
        }
示例#2
0
            public void updateHeroVoiceState(Player curPlayer)
            {
                if (curPlayer != null && curPlayer.Captain && curPlayer.Captain.get_handle().ValueComponent.mActorValue != null)
                {
                    this.SetEventParam(curPlayer.PlayerUId);
                    Player hostPlayer = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer();

                    if (hostPlayer == null)
                    {
                        return;
                    }
                    bool flag = Singleton <GamePlayerCenter> .get_instance().IsAtSameCamp(hostPlayer.PlayerId, curPlayer.PlayerId);

                    this.voiceIconsNode.CustomSetActive(flag);
                    if (flag)
                    {
                        if (curPlayer.Computer && !Singleton <BattleLogic> .GetInstance().GetCurLvelContext().m_isWarmBattle)
                        {
                            this.voiceIconsNode.CustomSetActive(false);
                        }
                        if (hostPlayer.PlayerUId == curPlayer.PlayerUId)
                        {
                            this._updateVoiceIcon(this.voiceIconsNode, MonoSingleton <VoiceSys> .get_instance().curVoiceState, false);
                        }
                        else
                        {
                            CS_VOICESTATE_TYPE value = MonoSingleton <VoiceSys> .GetInstance().TryGetVoiceState(curPlayer.PlayerUId);

                            this._updateVoiceIcon(this.voiceIconsNode, value, MonoSingleton <VoiceSys> .get_instance().IsForbid(curPlayer.PlayerUId));
                        }
                    }
                }
            }
示例#3
0
            public void updateHeroVoiceState(Player curPlayer)
            {
                if (((curPlayer != null) && (curPlayer.Captain != 0)) && (curPlayer.Captain.handle.ValueComponent.mActorValue != null))
                {
                    Player hostPlayer = Singleton <GamePlayerCenter> .instance.GetHostPlayer();

                    if (hostPlayer != null)
                    {
                        bool bActive = Singleton <GamePlayerCenter> .instance.IsAtSameCamp(hostPlayer.PlayerId, curPlayer.PlayerId);

                        this.voiceIconsNode.CustomSetActive(bActive);
                        if (bActive)
                        {
                            if (curPlayer.Computer && !Singleton <BattleLogic> .GetInstance().GetCurLvelContext().m_isWarmBattle)
                            {
                                this.voiceIconsNode.CustomSetActive(false);
                            }
                            if (hostPlayer.PlayerUId == curPlayer.PlayerUId)
                            {
                                this._updateVoiceIcon(this.voiceIconsNode, MonoSingleton <VoiceSys> .instance.curVoiceState);
                            }
                            else
                            {
                                CS_VOICESTATE_TYPE cs_voicestate_type = MonoSingleton <VoiceSys> .GetInstance().TryGetVoiceState(curPlayer.PlayerUId);

                                this._updateVoiceIcon(this.voiceIconsNode, cs_voicestate_type);
                            }
                        }
                    }
                }
            }
示例#4
0
            private void _updateVoiceIcon(GameObject node, CS_VOICESTATE_TYPE value)
            {
                if (node != null)
                {
                    GameObject gameObject = node.transform.Find("AllOpen").gameObject;
                    GameObject obj3       = node.transform.Find("AllClose").gameObject;
                    GameObject obj4       = node.transform.Find("HalfOpen").gameObject;
                    switch (value)
                    {
                    case CS_VOICESTATE_TYPE.CS_VOICESTATE_NONE:
                        gameObject.CustomSetActive(false);
                        obj3.CustomSetActive(true);
                        obj4.CustomSetActive(false);
                        return;

                    case CS_VOICESTATE_TYPE.CS_VOICESTATE_PART:
                        gameObject.CustomSetActive(false);
                        obj3.CustomSetActive(false);
                        obj4.CustomSetActive(true);
                        return;

                    case CS_VOICESTATE_TYPE.CS_VOICESTATE_FULL:
                        gameObject.CustomSetActive(true);
                        obj3.CustomSetActive(false);
                        obj4.CustomSetActive(false);
                        return;
                    }
                }
            }
示例#5
0
        public static void Send_Acnt_VoiceState(CS_VOICESTATE_TYPE type)
        {
            CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x12f2);

            msg.stPkgData.stAcntVoiceState.bVoiceState = (byte)type;
            Singleton <NetworkModule> .GetInstance().SendGameMsg(ref msg, 0);
        }
示例#6
0
 public void SetVoiceState(ulong uid, CS_VOICESTATE_TYPE state)
 {
     for (int i = 0; i < this.m_voiceStateList.Count; i++)
     {
         VoiceState state2 = this.m_voiceStateList[i];
         if ((state2 != null) && (state2.uid == uid))
         {
             state2.state = state;
             return;
         }
     }
     this.m_voiceStateList.Add(new VoiceState(uid, state));
 }
示例#7
0
            private void _updateVoiceIcon(GameObject node, CS_VOICESTATE_TYPE value, bool bForbidden = false)
            {
                if (node == null)
                {
                    return;
                }
                GameObject gameObject  = node.transform.Find("AllOpen").gameObject;
                GameObject gameObject2 = node.transform.Find("AllClose").gameObject;
                GameObject gameObject3 = node.transform.Find("HalfOpen").gameObject;
                GameObject gameObject4 = node.transform.Find("Forbidden").gameObject;

                if (bForbidden)
                {
                    gameObject.CustomSetActive(false);
                    gameObject2.CustomSetActive(false);
                    gameObject3.CustomSetActive(false);
                    gameObject4.CustomSetActive(true);
                    return;
                }
                gameObject4.CustomSetActive(false);
                switch (value)
                {
                case 0:
                    gameObject.CustomSetActive(false);
                    gameObject2.CustomSetActive(true);
                    gameObject3.CustomSetActive(false);
                    return;

                case 1:
                    gameObject.CustomSetActive(false);
                    gameObject2.CustomSetActive(false);
                    gameObject3.CustomSetActive(true);
                    return;

                case 2:
                    gameObject.CustomSetActive(true);
                    gameObject2.CustomSetActive(false);
                    gameObject3.CustomSetActive(false);
                    return;

                default:
                    return;
                }
            }
示例#8
0
 public VoiceState(ulong uid, CS_VOICESTATE_TYPE state)
 {
     this.uid   = uid;
     this.state = state;
 }