private string GetCameraID(IActionObj obj)
 {
     //忽略匹配相机
     if (Config.quickMoveElement && obj is MatchObj && !(obj as MatchObj).ignorePass)
     {
         return(null);
     }
     else if (Config.quickMoveElement && obj is InstallObj && !(obj as InstallObj).ignorePass)
     {
         return(null);
     }
     //除要求使用特殊相机或是动画步骤,都用主摄像机
     else if (Config.useOperateCamera || obj is AnimObj)
     {
         if (string.IsNullOrEmpty(obj.CameraID))
         {
             return(trigger.CameraID);
         }
         else
         {
             return(obj.CameraID);
         }
     }
     //默认是主相机
     else
     {
         return(CameraController.defultID);
     }
 }
 private void TryStartAction(IActionObj obj)
 {
     if (log)
     {
         Debug.Log("Start A Step:" + obj);
     }
     if (!obj.Started)
     {
         if (cameraCtrl != null)
         {
             cameraCtrl.SetViewCamera(() =>
             {
                 StartAction(obj);
             }, GetCameraID(obj));
         }
         else
         {
             StartAction(obj);
         }
     }
     else
     {
         Debug.LogError(obj + " allready started");
     }
 }
 /// <summary>
 /// 移除触发器
 /// </summary>
 /// <param name="action"></param>
 private void OnStopAction(IActionObj action)
 {
     startedActions.Remove(action);
     if (onCtrlStop != null && startedActions.Find(x => x.CtrlType == action.CtrlType) == null)
     {
         onCtrlStop.Invoke(action.CtrlType);
     }
 }
 /// <summary>
 /// 添加新的触发器
 /// </summary>
 /// <param name="action"></param>
 private void OnStartAction(IActionObj action)
 {
     startedActions.Add(action);
     if (onCtrlStart != null)
     {
         onCtrlStart.Invoke(action.CtrlType);
     }
 }
 private void StartAction(IActionObj obj)
 {
     if (!obj.Started)
     {
         obj.onEndExecute = () => OnCommandObjComplete(obj);
         obj.OnStartExecute(isForceAuto);
         OnStartAction(obj);
     }
 }
Esempio n. 6
0
 public int CompareTo(IActionObj other)
 {
     if (QueueID > other.QueueID)
     {
         return(1);
     }
     else if (QueueID < other.QueueID)
     {
         return(-1);
     }
     else
     {
         return(0);
     }
 }
        private void OnCommandObjComplete(IActionObj obj)
        {
            OnStopAction(obj);
            var notComplete = Array.FindAll <IActionObj>(actionObjs, x => x.QueueID == obj.QueueID && !x.Complete);

            if (notComplete.Length == 0)
            {
                if (!ExecuteAStep())
                {
                    if (!trigger.Completed)
                    {
                        trigger.Complete();
                    }
                }
            }
            else if (actionQueue.Count > 0)//正在循环执行
            {
                QueueExectueActions();
            }
        }