Example #1
0
    private void SendVideoPhoneChange(uint groupId, Action action = null, uint npcId = 0)
    {
        PlayParameter playParameter = new PlayParameter();

        playParameter.groupId = (int)groupId;
        playParameter.action  = action;
        playParameter.npcId   = npcId;
        GameFacade.Instance.SendNotification(NotificationName.VideoPhoneChange, playParameter);
    }
Example #2
0
    /// <summary>
    /// 修改通讯列表
    /// </summary>
    /// <param name="groupId">组id</param>
    private void ChangeVideoList(PlayParameter parameter)
    {
        List <VideoPhone?> videoPhones = m_CfgEternityProxy.GetVideoPhoneList(parameter.groupId);

        if (videoPhones.Count == 0 || videoPhones == null)
        {
            return;
        }
        int GroupPriority = videoPhones[0].Value.GroupPriority;

        if (GroupPriority >= m_GroupPriority)
        {
            if (m_VideoPhones.Count > 0)
            {
                m_PlayParameter.action?.Invoke();
                if (m_Root.anchoredPosition.x == m_StartValue)
                {
                    m_Root.gameObject.SetActive(false);
                    m_VideoPhones   = videoPhones;
                    m_GroupPriority = GroupPriority;
                    m_PlayParameter = parameter;
                    ShowVideoPhoneList(0);
                }
                else
                {
                    m_Tween.DOPlayBackwards();
                    m_Tween.onRewind.AddListener(() =>
                    {
                        m_Root.gameObject.SetActive(false);
                        m_VideoPhones   = videoPhones;
                        m_GroupPriority = GroupPriority;
                        m_PlayParameter = parameter;
                        ShowVideoPhoneList(0);
                        m_Tween.onRewind.RemoveAllListeners();
                    });
                }
            }
            else
            {
                m_VideoPhones   = videoPhones;
                m_GroupPriority = GroupPriority;
                m_PlayParameter = parameter;
                ShowVideoPhoneList(0);
            }
        }
        else
        {
            parameter.action?.Invoke();
        }
    }
    public void PlayVideoSound(int groupID, string key)
    {
        PlayParameter playParameter = new PlayParameter();

        playParameter.groupId = groupID;
        playParameter.action  = () =>
        {
            if (!string.IsNullOrEmpty(key) && m_Index.ContainsKey(key))
            {
                m_Index[key]++;
            }
        };
        GameFacade.Instance.SendNotification(NotificationName.VideoPhoneChange, playParameter);
        BehaviorManager.Instance.LogFormat(m_Agent, $"PlayVideoSound groupID:{groupID}");
    }
    public void PlayVideoSoundToNpc(EnumSoundType type, string key)
    {
        int groupId = GetGroupId(type);

        if (groupId == 0)
        {
            BehaviorManager.Instance.LogFormat(m_Agent, $"PlayVideoSoundToNpc type:{type} groupId{groupId}");
            return;
        }
        PlayParameter playParameter = new PlayParameter();

        playParameter.groupId = groupId;
        playParameter.action  = () =>
        {
            if (!string.IsNullOrEmpty(key) && m_Index.ContainsKey(key))
            {
                m_Index[key]++;
            }
        };
        GameFacade.Instance.SendNotification(NotificationName.VideoPhoneChange, playParameter);
        BehaviorManager.Instance.LogFormat(m_Agent, $"PlayVideoSoundToNpc type:{type} groupId{groupId}");
    }