Пример #1
0
    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;
                    }
                }
            }
        }
    }
Пример #2
0
    public void Continue()
    {
        if (m_bEnd)
        {
            if (m_bGuide)
            {
                m_mask.gameObject.SetActive(false);
            }
            SetTime(0.0f);
            m_nStage = 6;
            return;
        }
        //鏄?惁闇€瑕侀殣钘忓綋鍓峮pc
        List <stMovie> movieList2 = stageMovie.movieList;

        if (m_nDialogueIndex < movieList2.Count)
        {
            stMovie data = movieList2[m_nDialogueIndex];
            if (data.npcNoShow == 1)
            {
                GameObject obj = GameObject.Find(data.npcModel);
                if (obj != null)
                {
                    obj.SetActive(false);
                }
                //璁$畻涓嬩竴涓?浉鏈轰綅缃產aa
                SetCameraInfo(m_nDialogueIndex + 1);
            }
        }
        m_nDialogueIndex++;
        ShowTextBegin();
    }
Пример #3
0
    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;
            }
        }
    }
Пример #4
0
    void SetHeadImage()
    {
        stMovie movieData = stageMovie.movieList[m_nDialogueIndex];
        string  index     = movieData.portrait;

        index = index.Substring(0, 1);
        string   newName = "NpcPortrait_" + index;
        UISprite sprite  = m_headImage.GetComponent <UISprite>();
        UIAtlas  atlas   = sprite.atlas;

        if (newName != atlas.name)
        {
            ResLoadParams param = new ResLoadParams();
            param.userdata0 = movieData.portrait;
            sdResourceMgr.Instance.LoadResourceImmediately("UI/NpcPortrait/$NpcPortrait" + index + "/NpcPortraitPic_" + index + ".prefab", loadAtlas, param, typeof(UIAtlas));
        }
        else
        {
            if (sprite.spriteName != movieData.portrait)
            {
                sprite.spriteName = movieData.portrait;
            }
        }
    }
Пример #5
0
    void ShowTextBegin()
    {
        List <stMovie> movielist = stageMovie.movieList;

        if (m_nDialogueIndex < movielist.Count)
        {
            stMovie movieData = movielist[m_nDialogueIndex];
            m_labelName.text = movieData.npcName;
            m_bEnd           = (movieData.EndFlag == 1);
            nTextCount       = movieData.content.Length;
            textContent      = movieData.content;
            m_btnContinue.SetActive(false);
            nTextIndex = 0;
            m_fTime    = 0.0f;
            m_fNormal  = -1.0f;
            m_nStage   = 4;
        }
        else
        {
            m_bEnd     = true;
            nTextCount = 0;
            nTextIndex = 0;
        }
    }
Пример #6
0
    void BeforeLeave()
    {
        sdGlobalDatabase.Instance.globalData["moviedialogue"] = false;
        BuffChange(false);
        sdGameCamera   gameCamera = sdGameLevel.instance.mainCamera;
        List <stMovie> movieList  = stageMovie.movieList;

        if (m_nDialogueIndex < movieList.Count)
        {
            stMovie movieData = movieList[m_nDialogueIndex];
            if (movieData.npcNoShow == 1)
            {
                GameObject obj = GameObject.Find(movieData.npcModel);
                if (obj != null)
                {
                    obj.SetActive(false);
                }
            }
        }
        sdUICharacter.Instance.DialogueCharacterList.Clear();
        sdGameLevel.instance.mainCamera.MainCharFollow = true;

        m_mainCamera.transform.position = m_cameraSavePosition;
        m_mainCamera.transform.rotation = m_cameraSaveRotate;

        HideUI(m_headImage);
        HideUI(m_texImage);

        if (m_bGuide)
        {
            sdGameLevel.instance.SetFingerObjectActive(true);
        }
        sdUICharacter.Instance.ShowFightUi();
        SetTime(leaveTime);
        m_nStage = 7;
    }