Exemplo n.º 1
0
 public void OnContextAttach(IContextWrapper <T> context,
                             IList <IBinding> bindings,
                             IBinder <IContextWrapper <T> > binder)
 {
     bindings.Add(Binder.Side(() => Value).To(Binder.Side(() => context.Value)));
     Attaching?.Invoke(context.Value, binder);
 }
Exemplo n.º 2
0
 public void Attach()
 {
     Attaching?.Invoke();
     Instance = this;
     PanelWidget.PushNode(RootWidget);
     RootWidget.SetFocus();
     UpdateTitle();
     Attached?.Invoke();
 }
Exemplo n.º 3
0
        public static IEnumerator _Ghosts(Vector3 ppos)
        {
            /* Using bear ghost creates Warning, when ZMoe ghost does not ...
             * but moe stops moving ?
             */
            //EntityPool EntityPool = new EntityPool("zombieMoeGhost", 20);
            // EntityPool EntityPool = new EntityPool("animalBearGhost", 20);
            // EntityPool EntityPool = new EntityPool("animalChickenGhost", 20);
            EntityPool EntityPool = new EntityPool("animalChickenGhostV2", 20);

            HashSet <Entity> done = new HashSet <Entity>();

            lastExec = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
            while (true)
            {
                lastExec = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
                Bounds area = new Bounds(ppos, new Vector3(40, 40, 40));
                EntityPool.Update(area);
                foreach (Entity entity in EntityPool.Entities)
                {
                    lastExec = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
                    if (entity == null)
                    {
                        continue;
                    }
                    if (entity as EntityAlive == null)
                    {
                        continue;
                    }
                    if (_StopGhost)
                    {
                        Attaching.Remove(entity as EntityAlive, currentName);
                        // if (done.Contains(entity)) done.Remove(entity);
                        done.Clear();
                    }
                    else
                    {
                        if (done.Contains(entity))
                        {
                            continue;
                        }
                        Attaching.Apply(entity as EntityAlive, currentName);
                        done.Add(entity);
                    }
                    lastExec = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
                    yield return(new WaitForEndOfFrame());
                }
                lastExec = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
                yield return(new WaitForEndOfFrame());
            }
        }
Exemplo n.º 4
0
 protected virtual void OnAttaching(EventArgs e)
 {
     Attaching?.Invoke(this, e);
 }