Example #1
0
        //------------------------------------------------------------------------/
        // Messages
        //------------------------------------------------------------------------/
        private void Awake()
        {
            //if (Application.isPlaying)

            switch (this.condition)
            {
            case Condition.Timer:
                StratusUpdateSystem.Add(this.onTimer, this.Submit, this);
                break;

            case Condition.Nessage:
                switch (this.onMessage)
                {
                case MessageType.LifecycleEvent:
                    // proxy here?
                    break;

                case MessageType.EventTriggerType:
                    //eventTrigger = this.gameObject.AddComponent<UnityEngine.EventSystems.EventTrigger>();
                    //eventTrigger.triggers.Add(new UnityEngine.EventSystems.EventTrigger.Entry())
                    break;
                }
                break;

            case Condition.Event:
                this.eventProxy = StratusEventProxy.Construct(this.gameObject, this.eventScope, this.eventType, this.OnEvent, true, this.debug);
                break;

            default:
                break;
            }
        }
Example #2
0
        protected override bool OnDecoratorCanChildExecute(Arguments args)
        {
            if (this.cooldown == null)
            {
                this.cooldown = new Stratus.Countdown(this.duration);
                StratusUpdateSystem.Add(this.cooldown);
            }

            if (this.cooldown.isFinished)
            {
                this.cooldown.Reset();
                return(true);
            }

            //Trace.Script($"Timer @ {cooldown.progress}");
            return(false);
        }