Beispiel #1
0
        public EgoConstraint()
        {
            _mask[ComponentIDs.Get(typeof(C1))]           = true;
            _mask[ComponentIDs.Get(typeof(C2))]           = true;
            _mask[ComponentIDs.Get(typeof(C3))]           = true;
            _mask[ComponentIDs.Get(typeof(C4))]           = true;
            _mask[ComponentIDs.Get(typeof(C5))]           = true;
            _mask[ComponentIDs.Get(typeof(EgoComponent))] = true;

            EgoEvents <AddedComponent <C1> > .AddHandler(e => CreateBundles(e.egoComponent));

            EgoEvents <DestroyedComponent <C1> > .AddHandler(e => RemoveBundles(e.egoComponent));

            EgoEvents <AddedComponent <C2> > .AddHandler(e => CreateBundles(e.egoComponent));

            EgoEvents <DestroyedComponent <C2> > .AddHandler(e => RemoveBundles(e.egoComponent));

            EgoEvents <AddedComponent <C3> > .AddHandler(e => CreateBundles(e.egoComponent));

            EgoEvents <DestroyedComponent <C3> > .AddHandler(e => RemoveBundles(e.egoComponent));

            EgoEvents <AddedComponent <C4> > .AddHandler(e => CreateBundles(e.egoComponent));

            EgoEvents <DestroyedComponent <C4> > .AddHandler(e => RemoveBundles(e.egoComponent));

            EgoEvents <AddedComponent <C5> > .AddHandler(e => CreateBundles(e.egoComponent));

            EgoEvents <DestroyedComponent <C5> > .AddHandler(e => RemoveBundles(e.egoComponent));
        }
Beispiel #2
0
    public EgoParentConstraint()
    {
        childConstraint = new CS1();
        childConstraint.parentConstraint = this;

        _mask[ComponentIDs.Get(typeof(C1))]           = true;
        _mask[ComponentIDs.Get(typeof(C2))]           = true;
        _mask[ComponentIDs.Get(typeof(C3))]           = true;
        _mask[ComponentIDs.Get(typeof(C4))]           = true;
        _mask[ComponentIDs.Get(typeof(C5))]           = true;
        _mask[ComponentIDs.Get(typeof(EgoComponent))] = true;

        EgoEvents <AddedComponent <C1> > .AddHandler(e => CreateBundles(e.egoComponent));

        EgoEvents <DestroyedComponent <C1> > .AddHandler(e => RemoveBundles(e.egoComponent));

        EgoEvents <AddedComponent <C2> > .AddHandler(e => CreateBundles(e.egoComponent));

        EgoEvents <DestroyedComponent <C2> > .AddHandler(e => RemoveBundles(e.egoComponent));

        EgoEvents <AddedComponent <C3> > .AddHandler(e => CreateBundles(e.egoComponent));

        EgoEvents <DestroyedComponent <C3> > .AddHandler(e => RemoveBundles(e.egoComponent));

        EgoEvents <AddedComponent <C4> > .AddHandler(e => CreateBundles(e.egoComponent));

        EgoEvents <DestroyedComponent <C4> > .AddHandler(e => RemoveBundles(e.egoComponent));

        EgoEvents <AddedComponent <C5> > .AddHandler(e => CreateBundles(e.egoComponent));

        EgoEvents <DestroyedComponent <C5> > .AddHandler(e => RemoveBundles(e.egoComponent));

        EgoEvents <SetParent> .AddHandler(e => SetParent(e.parent, e.child, e.worldPositionStays));
    }
Beispiel #3
0
    public override void Start()
    {
        EgoEvents <InputDataReceivedEvent> .AddHandler(Handle);

        //EgoEvents<PlayerHitEvent>.AddHandler (Handle);
        EgoEvents <CollisionEnter2DEvent> .AddHandler(Handle);
    }
Beispiel #4
0
    public EgoSystem()
    {
        _mask[ComponentIDs.Get(typeof(C1))]           = true;
        _mask[ComponentIDs.Get(typeof(C2))]           = true;
        _mask[ComponentIDs.Get(typeof(C3))]           = true;
        _mask[ComponentIDs.Get(typeof(C4))]           = true;
        _mask[ComponentIDs.Get(typeof(EgoComponent))] = true;

        // Attach built-in Event Handlers
        EgoEvents <AddedGameObject> .AddHandler(Handle);

        EgoEvents <DestroyedGameObject> .AddHandler(Handle);

        EgoEvents <AddedComponent <C1> > .AddHandler(Handle);

        EgoEvents <AddedComponent <C2> > .AddHandler(Handle);

        EgoEvents <AddedComponent <C3> > .AddHandler(Handle);

        EgoEvents <AddedComponent <C4> > .AddHandler(Handle);

        EgoEvents <DestroyedComponent <C1> > .AddHandler(Handle);

        EgoEvents <DestroyedComponent <C2> > .AddHandler(Handle);

        EgoEvents <DestroyedComponent <C3> > .AddHandler(Handle);

        EgoEvents <DestroyedComponent <C4> > .AddHandler(Handle);
    }
 public override void Start()
 {
     //
     // Register to listen to EndOfGame broadcast
     //
     EgoEvents <EndOfGameEvent> .AddHandler(Handle);
 }
Beispiel #6
0
    public override void Start()
    {
        EgoEvents <DamageEvent> .AddHandler(Handle);

        EgoEvents <CountDownEvent> .AddHandler(Handle);

        EgoEvents <GameStartEvent> .AddHandler(Handle);
    }
 public override void Start()
 {
     //
     // if any cars cross the finish line then handle
     // Checking of end of line event
     //
     EgoEvents <CheckEndOfLineEvent> .AddHandler(Handle);
 }
Beispiel #8
0
 public override void Start()
 {
     constraint.ForEachGameObject((egoComponent, countDownComponent) => {
         Debug.Log("Countdown Start");
         countDownComponent.myCountDownStatus = CountDownComponent.CountDownStatus.inactive;
         egoComponent.gameObject.SetActive(false);
     });
     EgoEvents <CountDownEvent> .AddHandler(Handle);
 }
    public override void Start()
    {
        constraint.ForEachGameObject((egoComponent, transform, lineRenderer, lineRendererComponent) => {
        });

        EgoEvents <LineRendererDrawEvent> .AddHandler(Handle);

        EgoEvents <CountDownEvent> .AddHandler(Handle);
    }
Beispiel #10
0
    public override void Start()
    {
        constraint.ForEachGameObject((egoComponent, transform, powerUpUIComponent) => {
            egoComponent.gameObject.GetComponent <SpriteRenderer>().enabled = false;
        });

        EgoEvents <OnSpeedUpPickUp> .AddHandler(Handle);

        EgoEvents <OnActivatePowerUp> .AddHandler(Handle);
    }
Beispiel #11
0
    // Use this for initialization
    public override void Start()
    {
        //Register Event Handlers
        EgoEvents <PlayerHitEvent> .AddHandler(Handle);

        constraint.ForEachGameObject((egoComponent, transform, player) =>
        {
            player.initialPosition = transform.position;
        });
    }
Beispiel #12
0
    public override void Start()
    {
        EgoEvents <JumpEvent> .AddHandler(Handle);

        EgoEvents <DashEvent> .AddHandler(Handle);

        EgoEvents <StepEvent> .AddHandler(Handle);

        EgoEvents <SetOnGroundEvent> .AddHandler(Handle);
    }
Beispiel #13
0
    // Use this for initialization
    public override void Start()
    {
        constraint.ForEachGameObject((egoComponent, transform, movement) => {
            movement.viewDirection = MovementComponent.ViewDirection.none;
        });

        EgoEvents <JumpEvent> .AddHandler(Handle);

        EgoEvents <InputDataReceivedEvent> .AddHandler(Handle);
    }
Beispiel #14
0
    //float gravity = -9.8f;
    public override void Start()
    {
        constraint.ForEachGameObject((egoComponent, rigidbody, input, movement, actor) =>
        {
            movement.numberOfJumpsRemaining = movement.jumpStrengths.Length;
        });

        //EgoEvents<CollisionEnterEvent>.AddHandler(Handle);
        //EgoEvents<CollisionExitEvent>.AddHandler(Handle);
        EgoEvents <TouchGroundEvent> .AddHandler(Handle);
    }
Beispiel #15
0
    // Use this for initialization
    public override void Start()
    {
        //Register Event Handlers
        EgoEvents <CollisionEnter2DEvent> .AddHandler(Handle);

        EgoEvents <InputDataReceivedEvent> .AddHandler(Handle);

        constraint.ForEachGameObject((egoComponent, transform, rigbody, jump, player, onCollissionEnter, Animator, AnimationComponent, spriteRend, serialPort) => {
            jump.jumpstatus = JumpComponent.Jumpstatus.grounded;
        });
    }
Beispiel #16
0
    public override void Start()
    {
        EgoEvents <GameOverEvent> .AddHandler(Handle);

        EgoEvents <GameStartEvent> .AddHandler(Handle);

        EgoEvents <CountDownEvent> .AddHandler(Handle);

        constraint.ForEachGameObject((egoComponent, gameOver) => {
            egoComponent.gameObject.SetActive(false);
        });
    }
Beispiel #17
0
    public override void Start()
    {
        constraint.ForEachGameObject((egoComponent, transform, rigidbody, movement, player) => {
            movement.myFlyStatus = MovementComponent.FlyStatus.notFlying;
        });

        EgoEvents <GameStartEvent> .AddHandler(Handle);

        EgoEvents <DamageEvent> .AddHandler(Handle);

        EgoEvents <CountDownEvent> .AddHandler(Handle);
    }
    public override void Start()
    {
        //
        // turn off the panel with "Game Over" text
        //
        constraint.ForEachGameObject((ego, ui) =>
        {
            ui.gameOverPanel.gameObject.SetActive(false);
        });

        EgoEvents <EndOfGameEvent> .AddHandler(Handle);
    }
Beispiel #19
0
    public override void Start()
    {
        constraint.ForEachGameObject((egoComponent, transfom, powerUpComponent, spriteRenderer, collider) => {
            powerUpComponent.powerUpTimerTimeElapsed = -1f;
            spriteRenderer.enabled = false;
            collider.enabled       = false;
        });

        EgoEvents <GameStartEvent> .AddHandler(Handle);

        EgoEvents <OnActivatePowerUp> .AddHandler(Handle);

        EgoEvents <DamageEvent> .AddHandler(Handle);
    }
 public override void Start()
 {
     EgoEvents <TriggerEnterEvent> .AddHandler(Handle);
 }
Beispiel #21
0
 public override void Start()
 {
     EgoEvents <GameEndEvent> .AddHandler(Handle);
 }
 public override void Start()
 {
     // Add Event Handlers
     EgoEvents <CommandEvent> .AddHandler(Handle);
 }
Beispiel #23
0
        public override void Start()
        {
            EgoEvents <InteractEvent> .AddHandler(Handle);

            EgoEvents <UseEvent> .AddHandler(Handle);
        }
Beispiel #24
0
 public override void Start()
 {
     EgoEvents <SwitchSceneEvent> .AddHandler(Handle);
 }
        public override void Start()
        {
            EgoEvents <AttachEvent> .AddHandler(Handle);

            EgoEvents <DetachEvent> .AddHandler(Handle);
        }
Beispiel #26
0
    public override void Start()
    {
        EgoEvents <JumpEvent> .AddHandler(Handle);

        EgoEvents <DashEvent> .AddHandler(Handle);
    }
Beispiel #27
0
    public EgoSystem()
    {
        _mask[ComponentIDs.Get(typeof(C1))]           = true;
        _mask[ComponentIDs.Get(typeof(C2))]           = true;
        _mask[ComponentIDs.Get(typeof(C3))]           = true;
        _mask[ComponentIDs.Get(typeof(C4))]           = true;
        _mask[ComponentIDs.Get(typeof(C5))]           = true;
        _mask[ComponentIDs.Get(typeof(C6))]           = true;
        _mask[ComponentIDs.Get(typeof(C7))]           = true;
        _mask[ComponentIDs.Get(typeof(C8))]           = true;
        _mask[ComponentIDs.Get(typeof(C9))]           = true;
        _mask[ComponentIDs.Get(typeof(C10))]          = true;
        _mask[ComponentIDs.Get(typeof(C11))]          = true;
        _mask[ComponentIDs.Get(typeof(C12))]          = true;
        _mask[ComponentIDs.Get(typeof(EgoComponent))] = true;

        // Attach built-in Event Handlers
        EgoEvents <AddedGameObject> .AddHandler(Handle);

        EgoEvents <DestroyedGameObject> .AddHandler(Handle);

        EgoEvents <AddedComponent <C1> > .AddHandler(Handle);

        EgoEvents <AddedComponent <C2> > .AddHandler(Handle);

        EgoEvents <AddedComponent <C3> > .AddHandler(Handle);

        EgoEvents <AddedComponent <C4> > .AddHandler(Handle);

        EgoEvents <AddedComponent <C5> > .AddHandler(Handle);

        EgoEvents <AddedComponent <C6> > .AddHandler(Handle);

        EgoEvents <AddedComponent <C7> > .AddHandler(Handle);

        EgoEvents <AddedComponent <C8> > .AddHandler(Handle);

        EgoEvents <AddedComponent <C9> > .AddHandler(Handle);

        EgoEvents <AddedComponent <C10> > .AddHandler(Handle);

        EgoEvents <AddedComponent <C11> > .AddHandler(Handle);

        EgoEvents <AddedComponent <C12> > .AddHandler(Handle);

        EgoEvents <DestroyedComponent <C1> > .AddHandler(Handle);

        EgoEvents <DestroyedComponent <C2> > .AddHandler(Handle);

        EgoEvents <DestroyedComponent <C3> > .AddHandler(Handle);

        EgoEvents <DestroyedComponent <C4> > .AddHandler(Handle);

        EgoEvents <DestroyedComponent <C5> > .AddHandler(Handle);

        EgoEvents <DestroyedComponent <C6> > .AddHandler(Handle);

        EgoEvents <DestroyedComponent <C7> > .AddHandler(Handle);

        EgoEvents <DestroyedComponent <C8> > .AddHandler(Handle);

        EgoEvents <DestroyedComponent <C9> > .AddHandler(Handle);

        EgoEvents <DestroyedComponent <C10> > .AddHandler(Handle);

        EgoEvents <DestroyedComponent <C11> > .AddHandler(Handle);

        EgoEvents <DestroyedComponent <C12> > .AddHandler(Handle);
    }
Beispiel #28
0
 public override void Start()
 {
     // Add Event Handlers
     EgoEvents <PregnancyEvent> .AddHandler(Handle);
 }
Beispiel #29
0
    public override void Start()
    {
        EgoEvents <PlayerReadyEvent> .AddHandler(Handler);

        EgoEvents <PlayerNotReadyEvent> .AddHandler(Handler);
    }
Beispiel #30
0
    public override void Start()
    {
        EgoEvents <LifeUIEvent> .AddHandler(Handle);

        EgoEvents <GoToMenuEvent> .AddHandler(Handle);
    }