Ejemplo n.º 1
0
        public override void Update()
        {
            var position = GetComponent <PositionComponent>();

            if (_triggered)
            {
                return;
            }

            foreach (PlayerComponent player in SceneMgr.CurrentScene.GetComponentList <PlayerComponent>())
            {
                var playerPosition = player.Owner.GetComponent <PositionComponent>();
                var playerActor    = player.Owner.GetComponent <StackableActorComponent>();

                if (
                    playerActor.LogicStateMachine.CurrentState != ActorStates.Dead &&
                    GameMath.PointInRectangleBySize(playerPosition.Position, position.Position, Size)
                    )
                {
                    new LevelRestartEffect(GameplayController.GUILayer, true);
                    StackableActorSystem.Kill(playerActor, true);
                    _triggered = true;
                }
            }
        }
Ejemplo n.º 2
0
        public override void Update()
        {
            var position = GetComponent <PositionComponent>();

            foreach (StackableActorComponent actor in SceneMgr.CurrentScene.GetComponentList <StackableActorComponent>())
            {
                var actorPosition = actor.Owner.GetComponent <PositionComponent>();

                if (GameMath.PointInRectangleBySize(actorPosition.Position, position.Position, Size))
                {
                    StackableActorSystem.Kill(actor, true);
                }
            }
        }