コード例 #1
0
        public static UpdateTask UpdateWhile(this UnityEngine.Object sender, Action action, Func <bool> endCondition, Action then = null, UpdateType updateType = UpdateType.normal)
        {
            var task = new UpdateTask(action, endCondition, then, sender ? sender.GetInstanceID() : 0);

            AnilUpdate.Register(task, updateType);
            return(task);
        }
コード例 #2
0
        /// <summary>
        /// this allows you update action, <b>you can recive input</b>
        /// </summary>
        /// <param name="action"><param>will be updated action</param>
        /// <param name="endCnd"><param>do while this condition true</param>
        /// <param name="then">then do</param>
        public static UpdateTask UpdateWhile(Action action, Func <bool> endCnd, Action then = null, UnityEngine.Object calledInstance = null, UpdateType updateType = UpdateType.normal)
        {
#if UNITY_EDITOR
            int id   = calledInstance ? calledInstance.GetInstanceID() : 0;
            var task = new UpdateTask(action, endCnd, then, id);
#else
            var task = new UpdateTask(action, endCondition, then);
#endif
            AnilUpdate.Register(task, updateType);
            return(task);
        }