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; } } }
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); } } }