public void RemoveAction(Action _action)
        {
            if (_action == null)
            {
                return;
            }
            ListLinqView <GameObject> gameObjectList = _action.GetGameObjectList();
            int count = gameObjectList.Count;

            for (int i = 0; i < count; i++)
            {
                GameObject gameObject = gameObjectList[i];
                if (!(gameObject == null))
                {
                    if (this.objectReferenceSet.ContainsKey(gameObject))
                    {
                        ListView <Action> listView = this.objectReferenceSet[gameObject];
                        listView.Remove(_action);
                        if (listView.Count == 0)
                        {
                            this.objectReferenceSet.Remove(gameObject);
                        }
                    }
                    else if (gameObjectList.IndexOf(gameObject) >= _action.refGameObjectsCount)
                    {
                        ActionManager.DestroyGameObject(gameObject);
                    }
                }
            }
            MonoSingleton <ActionManager> .instance.actionList.Remove(_action);

            _action.Release();
        }
Example #2
0
 public override void Enter(Action _action, Track _track)
 {
     if (this.subAction != null)
     {
         this.subAction.Stop(false);
     }
     if (this.pushGameObjs)
     {
         this.subAction = ActionManager.Instance.PlaySubAction(_action, this.actionName, (float)this.length, _action.GetGameObjectList().ToArray());
     }
     else
     {
         this.subAction = ActionManager.Instance.PlaySubAction(_action, this.actionName, (float)this.length, new GameObject[0]);
     }
     if (this.subAction == null)
     {
         return;
     }
     if (this.pushRefParams)
     {
         this.subAction.InheritRefParams(_action);
     }
 }