Ejemplo n.º 1
0
        private void LoadAssetbundle()
        {
            int CurStageID = 0;

            if (ObjectSelf.GetInstance().GetIsPrompt())
            {
                CurStageID = ObjectSelf.GetInstance().GetPromptCurCampaignID();
            }
            else
            {
                CurStageID = ObjectSelf.GetInstance().GetCurCampaignID();
            }
            CurStage = (StageTemplate)DataTemplate.GetInstance().m_StageTable.getTableData(CurStageID);
            FightControler.isOpeningAnimation = CurStage.m_iskcdh != -1;

            if (CurStage.m_stageevent[0] != "-1")
            {
                Monstersdata = new MonsterGroupDataObjMgr(AssetLoader.Inst.GetEditorAssetRes(CurStage.m_stageevent[0]) as MonsterGroupDataObj);
            }
            if (CurStage.m_stageevent[1] != "-1")
            {
                HeroPathdata = AssetLoader.Inst.GetEditorAssetRes(CurStage.m_stageevent[1]) as HeroPathDataObj;
                //测试用的;
                HeroPathdata.MoveDistance -= 4f;
            }
            if (CurStage.m_stageevent[2] != "-1")
            {
                Camdata = AssetLoader.Inst.GetEditorAssetRes(CurStage.m_stageevent[2]) as CameraDataObj;
            }
            if (CurStage.m_stageevent[3] != "-1")
            {
                StoryAnimdata = AssetLoader.Inst.GetEditorAssetRes(CurStage.m_stageevent[3]) as StoryAnimDataObj;
            }
            LoadFightEditor();
        }
 /// <summary>
 /// 初始化关卡动画数据
 /// 是否
 /// </summary>
 /// <param name="Storydata">关卡动画数据组</param>
 public void Init(StoryAnimDataObj Storydata, bool isLocal, MonsterGroupDataObjMgr monsterdata = null, EM_SCENE_TYPE sceneType = EM_SCENE_TYPE.NORMAL, int beginFightCount = 1)
 {
     IsLocal          = isLocal;
     Monstersdata     = monsterdata;
     mSceneType       = sceneType;
     mBeginFightCount = beginFightCount;
     if (Monstersdata != null)
     {
         CurrentMonsterGroupCount = monsterdata.Count;
     }
     if (Storydata == null)
     {
         return;
     }
     if (isLocal)
     {
         StoryCamAnimsObj = GameObject.Find(Storydata.StoryCamAnimsName);
         StoryCamAnim     = StoryCamAnimsObj.GetComponent <Animation>();
     }
     else
     {
         Object objType = AssetLoader.Inst.GetEditorAssetRes(Storydata.StoryCamAnimsName);
         StoryCamAnimsObj = Instantiate(objType) as GameObject;
         StoryCamAnimsObj.transform.parent = this.transform;
         StoryCamAnim = StoryCamAnimsObj.GetComponent <Animation>();
     }
     Dic_StoryAnim = new Dictionary <int, StoryAnimGroup>();
     for (int i = 0; i < Storydata.StoryAnimGroupList.Count; ++i)
     {
         Dic_StoryAnim.Add(Storydata.StoryAnimGroupList[i].ID, Storydata.StoryAnimGroupList[i]);
     }
 }