void Awake() { stDialogueCharacter character = new stDialogueCharacter(); character.pos = gameObject.transform.position; character.rotate = gameObject.transform.rotation; character.character = gameObject; character.name = gameObject.name; character.cameraDis = cameraDis; sdUICharacter.Instance.DialogueCharacterList.Add(character); Hashtable movietable = sdConfDataMgr.Instance().m_Movie; if (movietable.ContainsKey(sdUICharacter.Instance.iCurrentLevelID)) { sdPlayerInfo kPlayerInfo = SDNetGlobal.playerList[SDNetGlobal.lastSelectRole]; string strLevel = sdConfDataMgr.Instance().GetRoleSetting("MovieDialogue_" + kPlayerInfo.mRoleName); if (strLevel.Length != 0 && int.Parse(strLevel) >= sdUICharacter.Instance.iCurrentLevelID) { gameObject.SetActive(false); } stStageMovie stagemovie = (stStageMovie)movietable[sdUICharacter.Instance.iCurrentLevelID]; for (int index = 0; index < stagemovie.movieList.Count; ++index) { stMovie movieData = stagemovie.movieList[index]; if (movieData.npcModel == gameObject.name) { if (movieData.npcShow == 1) { gameObject.SetActive(false); break; } } } } }
void SetCameraInfo(int dialogueIndex) { List <stMovie> movieList = stageMovie.movieList; if (dialogueIndex >= movieList.Count) { return; } stMovie movieData = movieList[dialogueIndex]; for (int i = 0; i < sdUICharacter.Instance.DialogueCharacterList.Count; ++i) { stDialogueCharacter data2 = sdUICharacter.Instance.DialogueCharacterList[i]; if (data2.name == movieData.npcModel) { data2.character.SetActive(true); Quaternion rotate = data2.rotate; Vector3 offset = rotate * new Vector3(0, 0, data2.cameraDis); m_mainCamera.transform.position = data2.pos + offset + new Vector3(0, 1, 0); m_mainCamera.transform.rotation = rotate * Quaternion.AngleAxis(180.0f, new Vector3(0, 1, 0)); return; } } }