private IEnumerator <IYieldInstruction> SpawnTextBubble(string chatMessage, Camera camera, IGuiManager guiManager) { mTextBubble = new TextBubble(guiManager, chatMessage, this.Entity.UnityGameObject.transform, camera); // Add some time for long chat messages float displayTime = Math.Min(mMaxTextBubbleLiveTime, mMinTextBubbleLiveTime + (chatMessage.Length * mTextBubbleTimePerChar)); yield return(new YieldForSeconds(displayTime)); }
private IEnumerator <IYieldInstruction> SpawnTextBubble(Texture2D chatImage, Camera camera, IGuiManager guiManager) { mTextBubble = new TextBubble(guiManager, chatImage, this.Entity.UnityGameObject.transform, camera); // Add some time for long chat messages float displayTime = mMaxTextBubbleLiveTime; yield return(new YieldForSeconds(displayTime)); }
private void CleanupTextBubble() { if (mTextBubble != null) { mTextBubble.Dispose(); mTextBubble = null; } // Reshow nametag AvatarEntity.Nametag.Visible = true; }