示例#1
0
        /** Triggers an event for all active graph modifiers */
        public static void TriggerEvent(GraphModifier.EventType type)
        {
            if (!Application.isPlaying)
            {
                FindAllModifiers();
            }

            GraphModifier c = root;

            switch (type)
            {
            case EventType.PreScan:
                while (c != null)
                {
                    c.OnPreScan(); c = c.next;
                }
                break;

            case EventType.PostScan:
                while (c != null)
                {
                    c.OnPostScan(); c = c.next;
                }
                break;

            case EventType.LatePostScan:
                while (c != null)
                {
                    c.OnLatePostScan(); c = c.next;
                }
                break;

            case EventType.PreUpdate:
                while (c != null)
                {
                    c.OnGraphsPreUpdate(); c = c.next;
                }
                break;

            case EventType.PostUpdate:
                while (c != null)
                {
                    c.OnGraphsPostUpdate(); c = c.next;
                }
                break;

            case EventType.PostCacheLoad:
                while (c != null)
                {
                    c.OnPostCacheLoad(); c = c.next;
                }
                break;
            }
        }
示例#2
0
        /** Triggers an event for all active graph modifiers */
        public static void TriggerEvent(GraphModifier.EventType type)
        {
            List <GraphModifier> mods = GetActiveModifiers();

            switch (type)
            {
            case EventType.PreScan:
                for (int i = 0; i < mods.Count; i++)
                {
                    mods[i].OnPreScan();
                }
                break;

            case EventType.PostScan:
                for (int i = 0; i < mods.Count; i++)
                {
                    mods[i].OnPostScan();
                }
                break;

            case EventType.LatePostScan:
                lastLateScanEvent = Time.frameCount;
                for (int i = 0; i < mods.Count; i++)
                {
                    mods[i].OnLatePostScan();
                }
                break;

            case EventType.PreUpdate:
                for (int i = 0; i < mods.Count; i++)
                {
                    mods[i].OnGraphsPreUpdate();
                }
                break;

            case EventType.PostUpdate:
                for (int i = 0; i < mods.Count; i++)
                {
                    mods[i].OnGraphsPostUpdate();
                }
                break;

            case EventType.PostCacheLoad:
                lastPostCacheEvent = Time.frameCount;
                for (int i = 0; i < mods.Count; i++)
                {
                    mods[i].OnPostCacheLoad();
                }
                break;
            }
        }
示例#3
0
        public static void TriggerEvent(GraphModifier.EventType type)
        {
            if (!Application.isPlaying)
            {
                GraphModifier.FindAllModifiers();
            }
            GraphModifier graphModifier = GraphModifier.root;

            switch (type)
            {
            case GraphModifier.EventType.PostScan:
                while (graphModifier != null)
                {
                    graphModifier.OnPostScan();
                    graphModifier = graphModifier.next;
                }
                return;

            case GraphModifier.EventType.PreScan:
                while (graphModifier != null)
                {
                    graphModifier.OnPreScan();
                    graphModifier = graphModifier.next;
                }
                return;

            case (GraphModifier.EventType) 3:
            case (GraphModifier.EventType) 5:
            case (GraphModifier.EventType) 6:
            case (GraphModifier.EventType) 7:
IL_3F:
                if (type == GraphModifier.EventType.PostUpdate)
                {
                    while (graphModifier != null)
                    {
                        graphModifier.OnGraphsPostUpdate();
                        graphModifier = graphModifier.next;
                    }
                    return;
                }
                if (type != GraphModifier.EventType.PostCacheLoad)
                {
                    return;
                }
                while (graphModifier != null)
                {
                    graphModifier.OnPostCacheLoad();
                    graphModifier = graphModifier.next;
                }
                return;

            case GraphModifier.EventType.LatePostScan:
                while (graphModifier != null)
                {
                    graphModifier.OnLatePostScan();
                    graphModifier = graphModifier.next;
                }
                return;

            case GraphModifier.EventType.PreUpdate:
                while (graphModifier != null)
                {
                    graphModifier.OnGraphsPreUpdate();
                    graphModifier = graphModifier.next;
                }
                return;
            }
            goto IL_3F;
        }
示例#4
0
        /// <summary>Triggers an event for all active graph modifiers</summary>
        public static void TriggerEvent(GraphModifier.EventType type)
        {
            if (!Application.isPlaying)
            {
                FindAllModifiers();
            }

            try {
                GraphModifier c = root;
                switch (type)
                {
                case EventType.PreScan:
                    while (c != null)
                    {
                        c.OnPreScan(); c = c.next;
                    }
                    break;

                case EventType.PostScan:
                    while (c != null)
                    {
                        c.OnPostScan(); c = c.next;
                    }
                    break;

                case EventType.LatePostScan:
                    while (c != null)
                    {
                        c.OnLatePostScan(); c = c.next;
                    }
                    break;

                case EventType.PreUpdate:
                    while (c != null)
                    {
                        c.OnGraphsPreUpdate(); c = c.next;
                    }
                    break;

                case EventType.PostUpdate:
                    while (c != null)
                    {
                        c.OnGraphsPostUpdate(); c = c.next;
                    }
                    break;

                case EventType.PostUpdateBeforeAreaRecalculation:
                    while (c != null)
                    {
                        c.OnGraphsPostUpdateBeforeAreaRecalculation(); c = c.next;
                    }
                    break;

                case EventType.PostCacheLoad:
                    while (c != null)
                    {
                        c.OnPostCacheLoad(); c = c.next;
                    }
                    break;

                case EventType.PostGraphLoad:
                    while (c != null)
                    {
                        c.OnPostGraphLoad(); c = c.next;
                    }
                    break;
                }
            } catch (System.Exception e) {
                Debug.LogException(e);
            }
        }
示例#5
0
        public static void TriggerEvent(GraphModifier.EventType type)
        {
            if (!Application.isPlaying)
            {
                GraphModifier.FindAllModifiers();
            }
            GraphModifier graphModifier = GraphModifier.root;

            switch (type)
            {
            case GraphModifier.EventType.PostScan:
                while (graphModifier != null)
                {
                    graphModifier.OnPostScan();
                    graphModifier = graphModifier.next;
                }
                break;

            case GraphModifier.EventType.PreScan:
                while (graphModifier != null)
                {
                    graphModifier.OnPreScan();
                    graphModifier = graphModifier.next;
                }
                break;

            default:
                if (type != GraphModifier.EventType.PostUpdate)
                {
                    if (type == GraphModifier.EventType.PostCacheLoad)
                    {
                        while (graphModifier != null)
                        {
                            graphModifier.OnPostCacheLoad();
                            graphModifier = graphModifier.next;
                        }
                    }
                }
                else
                {
                    while (graphModifier != null)
                    {
                        graphModifier.OnGraphsPostUpdate();
                        graphModifier = graphModifier.next;
                    }
                }
                break;

            case GraphModifier.EventType.LatePostScan:
                while (graphModifier != null)
                {
                    graphModifier.OnLatePostScan();
                    graphModifier = graphModifier.next;
                }
                break;

            case GraphModifier.EventType.PreUpdate:
                while (graphModifier != null)
                {
                    graphModifier.OnGraphsPreUpdate();
                    graphModifier = graphModifier.next;
                }
                break;
            }
        }