private void showMessage(SimpleMessage messageObject)
    {
        List <int> allAvatarIds = _avatarAreaManager.GetAllAvatarIds();

        print(messageObject.id + "id");
        if (allAvatarIds.Count == 0)
        {
            Debug.Log("No avatars available to show text through:" + messageObject.text);
            return;
        }

        AvatarView avatarView = _avatarAreaManager.GetAvatarView(messageObject.id);

        avatarView.Say(messageObject.text);
    }
示例#2
0
    private void ShowMessage(string pText)
    {
        //This is a stub for what should actually happen
        //What should actually happen is use an ID that you got from the server, to get the correct avatar
        //and show the text message through that
        List <int> allAvatarIds = avatarAreaManager.GetAllAvatarIds();

        if (allAvatarIds.Count == 0)
        {
            Debug.Log("No avatars available to show text through:" + pText);
            return;
        }

        int        randomAvatarId = allAvatarIds[UnityEngine.Random.Range(0, allAvatarIds.Count)];
        AvatarView avatarView     = avatarAreaManager.GetAvatarView(randomAvatarId);

        avatarView.Say(pText);
    }
示例#3
0
    private void showMessage(string pText, int pID)
    {
        AvatarView avatarView = _avatarAreaManager.GetAvatarView(pID);

        avatarView.Say(pText);

        #region Given Code
        //List<int> allAvatarIds = _avatarAreaManager.GetAllAvatarIds();

        //if (allAvatarIds.Count == 0)
        //{
        //    Debug.Log("No avatars available to show text through:" + pText);
        //    return;
        //}

        //int randomAvatarId = allAvatarIds[UnityEngine.Random.Range(0, allAvatarIds.Count)];
        //AvatarView avatarView = _avatarAreaManager.GetAvatarView(randomAvatarId);
        //avatarView.Say(pText);
        #endregion
    }