Ejemplo n.º 1
0
    void UseTalk(LocalNotification e)
    {
        if (e == null)
        {
            Debug.LogError("语音为空");
            return;
        }

        ArgsTalk args = e.param as ArgsTalk;

        Debug.Log("玩家" + args.talkPid + "正在发送语音");
        EPlayerPositionType type = EPlayerPositionType.ENull;

        if (args.talkPid == PlayerInfo.Instance.mPlayerPid)
        {
            type = EPlayerPositionType.ESelf;
        }
        else
        {
            type = RoomInfo.Instance.GetPlayerPosById(args.talkPid);
        }

        GameObject gm = UIManagers.Instance.GetSingleUI(UIType.ChatMessageTip);

        gm.transform.localScale = Vector3.one;
        gm.transform.SetParent(GetHeadPos(type));
        gm.transform.localPosition = Vector3.zero;
        PlayerInfo.Instance.AddNewEmoticon(type, gm, false);
        if (args.voiceName != null && args.voiceName.Length != 0)
        {
            StartCoroutine(gm.GetComponent <UIChatMessagTipView>().WaitOneDelta(null, args.voiceName, type));
        }
    }
Ejemplo n.º 2
0
    void ExecuteTalk(ArgsTalk info)
    {
        ArgsTalk args = new ArgsTalk();

        args.voiceName = info.voiceName;
        args.talkPid   = (uint)info.talkPid;
        SDKManager.Instance.yayaPlay(info.voiceName);

        // 表现谁在说话
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ETalkNotify, args);
    }