Beispiel #1
0
    IEnumerator PlayRoutine()
    {
        if (PlayerController.Instance != null)
        {
            PlayerController.Instance.Invincible = true;
            PlayerController.Instance.MoveLock   = true;
        }

        for (int i = 0; i < Events.Length; i++)
        {
            EventRef e = Events[i];
            if (!e.Played && elapsed > e.Seconds)
            {
                if (e.Event != null)
                {
                    e.Event.Invoke();
                }
                Events[i].Played = true;
            }
        }
        if (elapsed >= TotalTime && PlayerController.Instance != null)
        {
            PlayerController.Instance.Invincible = false;
            PlayerController.Instance.MoveLock   = false;
        }
        else
        {
            yield return(null);

            elapsed += Time.deltaTime;
            StartCoroutine(PlayRoutine());
        }
    }
        public override void Build()
        {
            ns("MyNameSpace");

            declClass(TypePublic, "MyClasss");
            declMethod(MemPublic, "System.Void", "MyMethod");

            EventRef testEvent = new EventRef(my(), "TestEvent");

            enter(testEvent);
        }
        public override void Build()
        {
            ns("MyNameSpace");

            declClass(TypePublic, "MyClass");
            declMethod(MemPublic, "System.Void", "MonMethod");

            EventRef evnt = new EventRef(my(), "MouseEvent");

            trigger(evnt, my(), newObj("System.EventArgs"));
        }
        public override void Build()
        {
            ns("MyNameSpace");

            declClass(TypePublic, "MyClass");
            declMethod(MemPublic, "System.Void", "MonMethod");

            EventRef  evnt = new EventRef(my(), "TestEvent");
            MethodRef mthd = new MethodRef(my(), "TestMethod");

            attach(evnt, "System.EventHandler", mthd);

            attach(my(), "TestEvent2", "System.EventHandler", mthd);

            attach(evnt, "System.EventHandler", my(), "TestMethod2");

            attach(my(), "TestEvent3", "System.EventHandler", my(), "TestMethod3");
        }
Beispiel #5
0
 public bool TryGetEvent(out EventRef eventRef)
 {
     eventRef = new EventRef(_ringBuffer, _sequence);
     return(_ringBuffer != null);
 }
Beispiel #6
0
 public async Task FireAsync <TEventArg>(object sender, TEventArg args)
 {
     this.CheckDisposed();
     EventRef _handler = this.handlers.Get(typeof(TEventArg));
     await _handler.Fire(sender, args);
 }
Beispiel #7
0
 static void callback(ref EventRef <TestEvent> testEvent)
 {
     Debug.Log(log);
 }