public void UseContent(Transform follow, int contentID) { ConversationContent content = freeList[0]; if (conversationDic.ContainsKey(follow)) { if (!usedList.Contains(conversationDic[follow])) { conversationDic[follow] = content; } else { conversationDic[follow].End(); conversationDic[follow] = content; } } else { conversationDic.Add(follow, content); } usedList.Add(content); freeList.RemoveAt(0); float height = (contentID >= 3) ? -1 : 0; content.StartFollow(conversationSprite[contentID], follow, height); }
// Start is called before the first frame update void Awake() { for (int i = 0; i < transform.childCount; i++) { ConversationContent content = new ConversationContent(transform.GetChild(i), this); freeList.Add(content); } }
public void UseContent(Transform follow, int contentID, float blank) { ConversationContent content = freeList[0]; usedList.Add(content); freeList.RemoveAt(0); float height = (contentID >= 3) ? -1 : 0; content.StartFollow(conversationSprite[contentID], follow, blank, height); }
public static ConversationContent CreateConversationContent(string presetDialogue, string cameraTargetGuid, CastDef cast = null) { CastDef castDef = (cast == null) ? RuntimeCastFactory.CreateCast() : cast; if (MissionControl.Instance.IsSkirmish()) { presetDialogue = Regex.Replace(presetDialogue, "{COMMANDER\\..+}", "Commander"); } DialogueContent dialogueContent1 = new DialogueContent( presetDialogue, Color.white, castDef.id, "", cameraTargetGuid, BattleTech.DialogCameraDistance.Medium, BattleTech.DialogCameraHeight.Default, -1 ); ConversationContent conversation = new ConversationContent("Conversation MC Test 1", new DialogueContent[] { dialogueContent1 }); return(conversation); }
public void Recycle(ConversationContent content) { usedList.Remove(content); freeList.Add(content); }