private void UpdateWindow(TutorialInfo info) { SetActive(true); m_uiAnchor.side = info.attachAnchorType; m_talkWindow.transform.localPosition = info.npcPopupPos; m_talkWindow.gameObject.SetActive(true); Hashtable hash = new Hashtable(); hash.Add("amount", new Vector3(0.05f, 0.05f, 0f)); hash.Add("time", 1f); hash.Add("ignoretimescale", true); iTween.PunchScale(m_talkWindow.gameObject, hash); #region NPC string spriteName = ""; for (int i = 0; i < info.npcGroup.Length; i++) { if (info.npcGroup[i].npcBody.Equals("0") == false) { spriteName = info.npcGroup[i].npcBody; } else if (info.npcGroup[i].npcFace.Equals("0") == false) { spriteName = info.npcGroup[i].npcFace; } else { continue; } break; } m_npcSprite.spriteName = spriteName; m_npcSprite.MakePixelPerfect(); #endregion #region Text m_textLabel.text = info.GetNpcScriptString(); #endregion SoundManager.instance.PlayAudioClip("UI_PopupOpen"); }
private void PlayScenario(TutorialInfo info) { m_isActive = true; m_curTutorialInfo = info; float delayTime = 0; for (int i = 0; i < m_uiScenarioNpcGroup.Length; i++) { bool isView = (i.Equals((int)NPC_POSITION.CENTER) || i.Equals((int)NPC_POSITION.EMPTY)) ? true : m_uiScenarioNpcGroup[i].CheckViewNpc; bool isExists = (i.Equals((int)NPC_POSITION.CENTER) || i.Equals((int)NPC_POSITION.EMPTY)) ? true : !info.npcGroup[i].npcBody.Equals("0"); if (isExists) { m_uiScenarioNpcGroup[i].SetNpc(info.npcGroup[i]); } m_uiScenarioNpcGroup[i].ViewNpc(isExists, isExists ? isView : false); delayTime = Mathf.Max(isView ? isExists ? 0 : NPC_PLAY_TIME : isExists ? NPC_PLAY_TIME : 0, delayTime); } for (int i = 0; i < m_uiScenarioNpcGroup.Length; i++) { m_uiScenarioNpcGroup[i].SetNarraterNpc(i.Equals((int)info.GetNpcPosType)); } m_uiScenarioNpcGroup[(int)info.GetNpcPosType].SetDialogue( info.npcPosType.Equals(NPC_POSITION.EMPTY) ? "" : info.GetNpcNameString(info.npcGroup[(int)info.GetNpcPosType].npcBody), info.GetNpcScriptString()); m_uiScenarioNpcGroup[(int)info.GetNpcPosType].SetNextButton(true); }