Ejemplo n.º 1
0
  public override void ImportProperty(int dwIndex)
  {
      _storyBoard.Clear();
      ILuaState lua = _fileLua;
      lua.PushValue(dwIndex);
      int len = lua.L_Len(-1);
      for (int i = 1; i <= len; i++)
      {
          _fileLua.PushNumber(i);
          _fileLua.GetTable(-2);
          StoryBoardCtrl board = new StoryBoardCtrl();
          InitStoryBoard(board);
          board.ImportProperty(lua, -1);
          _fileLua.Pop(1);
          AddBoard(board);
      }
      _fileLua.Pop(1);
 }
Ejemplo n.º 2
0
 //
 public void  InitStoryBoard(StoryBoardCtrl boardCtrl)
 {
     boardCtrl.Clear();
     for (int i=0, imax = actorCount; i < imax; ++i)
     {
         storyActorInfo actor = _storyActor[i];
         StoryShotCtrl lenCtrl = new StoryShotCtrl();
         lenCtrl.actor = actor;
         boardCtrl.Add(lenCtrl);
     }
 }
Ejemplo n.º 3
0
 public bool DeleteBoard(StoryBoardCtrl boardCtrl)
 {
     if (!_storyBoard.Contains(boardCtrl))
     {
         Debug.LogWarning("LuaAnimEvent don't contain StoryBoardCtrl:");
         return false;
     }
     _storyBoard.Remove(boardCtrl);
     return true;
 }
Ejemplo n.º 4
0
 //增加时间周期
 public void AddBoard(StoryBoardCtrl boardCtrl, int index = 0)
 {
     if (index == 0)
     {
         _storyBoard.Add(boardCtrl);
     }
     else
     {
         if (index <= 0 || index > Count)
         {
             Debug.LogWarning("Add StoryBaseCtrl index is out of range:count=" + Count + " index=" + index);
             return;
         }
         _storyBoard.Insert(index-1, boardCtrl);
     }
     
 }
Ejemplo n.º 5
0
 //人物镜头展示
 private void ShowShotsInfo(StoryBoardCtrl board, int boardIndex = 0)
 {
     NGUIEditorTools.BeginContents(true);
     for (int i = 0; i < board.Count; ++i)
     {
         StoryShotCtrl lenCtrl = board[i];
         //string actorName = lenCtrl.actorName+"(time:"+lenCtrl.time+"s)";
         string actorName = "Actor" + lenCtrl.actorIndex + "(time:" + lenCtrl.time + "s)";
         string key = "storyBoard"+boardIndex + actorName;
         GUILayout.BeginHorizontal();
         string starText = "";
         if (lenCtrl == objAnimEvent.objEditorShotCtrl)
         {
             starText = "*";
         }
         if (GUILayout.Button(starText, new GUILayoutOption[] { GUILayout.Width(minBoxWidth), GUILayout.Height(minBoxHeight) }))
         {
             objAnimEvent.objEditorShotCtrl = lenCtrl;
         }
         bool bFolder = NGUIEditorTools.DrawHeader(actorName, key, true, false);
         if (GUILayout.Button("<b><size=12>\u25BA</size></b> ", new GUILayoutOption[] { GUILayout.Width(minBoxWidth), GUILayout.Height(minBoxHeight) }))
         {
             lenCtrl.Stop();
             lenCtrl.Execute();
         }
         if (GUILayout.Button("c", new GUILayoutOption[] { GUILayout.Width(minBoxWidth), GUILayout.Height(minBoxHeight) }))
         {
             objAnimEvent.objEditorCopyCtrl = lenCtrl;
         }
         if (GUILayout.Button("v", new GUILayoutOption[] { GUILayout.Width(minBoxWidth), GUILayout.Height(minBoxHeight) }))
         {
             lenCtrl.paste(objAnimEvent.objEditorCopyCtrl);
         }
         if (GUILayout.Button("X",new GUILayoutOption[]{GUILayout.Width(minBoxWidth),GUILayout.Height(minBoxHeight)}))
         {
             bool bFlag = board.Delete(lenCtrl);
             if (bFlag == true && objAnimEvent.objEditorShotCtrl == lenCtrl)
             {
                 objAnimEvent.objEditorShotCtrl = null;
             }
         }
         GUILayout.EndHorizontal();
         if (bFolder)
         {
             ShowEventInfo(lenCtrl);
         }
     }
     NGUIEditorTools.EndContents();
 }
Ejemplo n.º 6
0
 //时间周期展示
 private void ShowBoardInfo()
 {
     GUILayout.BeginHorizontal();
     dwBoardIndex = EditorGUILayout.IntField("Add Board", dwBoardIndex);
     if (GUILayout.Button("Add"))
     {
         StoryBoardCtrl boardCtrl = new StoryBoardCtrl();
         objAnimEvent.InitStoryBoard(boardCtrl);
         objAnimEvent.AddBoard(boardCtrl, dwBoardIndex);
         dwBoardIndex = 0;
     }
     if (GUILayout.Button("Execute"))
     {
         objAnimEvent.Stop();
         objAnimEvent.Execute();
     }
     GUILayout.EndHorizontal();
     for (int i = 0; i < objAnimEvent.Count; ++i)
     {
         StoryBoardCtrl board = objAnimEvent[i];
         string name = "storyBoard:" + (i + 1)+"(time:"+board.time+"s)";
         GUILayout.BeginHorizontal();
         board.bFolderOut = EditorGUILayout.Foldout(board.bFolderOut, name);
         if (GUILayout.Button("<b><size=12>\u25BA</size></b> ", new GUILayoutOption[] { GUILayout.Width(minBoxWidth), GUILayout.Height(minBoxHeight) }))
         {
             board.Execute();
         }
         if (GUILayout.Button("X", new GUILayoutOption[] { GUILayout.Width(minBoxWidth), GUILayout.Height(minBoxHeight) }))
         {
             objAnimEvent.DeleteBoard(board);
         }
         GUILayout.Space(minRightSpace);
         GUILayout.EndHorizontal();
         if (board.bFolderOut)
         {
             ShowShotsInfo(board, i);
         }
     }
 }