Exemplo n.º 1
0
        public virtual void Run(Func <status> φ)
        {
            var adapter = GetComponent <UGigAdapter>();

            if (!adapter)
            {
                adapter = gameObject.AddComponent <UGigAdapter>();
            }
            adapter.call = φ;
            root         = adapter;
        }
Exemplo n.º 2
0
        // PROVISIONAL
        // NOTE: 'inferNext' is needed because `Push` may be
        // called before `Start` which may auto-assign a root task
        public void Push(Func <status> φ, bool inferNext = true)
        {
            var next = root;

            if (inferNext && root == null)
            {
                next = GetComponent <UGig>();
            }
            var gig = gameObject.AddComponent <UGigAdapter>();

            gig.call = φ; gig.next = next; root = gig;
        }
Exemplo n.º 3
0
        // --------------------------------------------------------------

        void Start()
        => root = root != null ? root : GetComponent <UGig>();