public override void Start() { base.Start(); _snout = GetComponentInChildren <ProjectileProjector>(); _movement = GetComponent <SidescrollingMovement>(); List <State> states = new List <State> { new State { Condition = () => true, Behavior = DoNothing }, new State { Condition = PlayerNearby, Behavior = ChooseAction }, new State { Condition = IsHit, Behavior = DoNothing } }; _fsm = new StateMachine(states); }
// Use this for initialization public override void Start() { base.Start(); _projector = GetComponentInChildren <ProjectileProjector>(); _webThread = GetComponent <LineRenderer>(); _controller = GetComponent <CharacterController>(); _behaviorFSM = new StateMachine(new List <State> { new State { Condition = DefaultCondition, Behavior = DoNothing }, new State { Condition = SensesPlayer, Behavior = MoveTowardPlayer }, new State { Condition = IsOverPlayer, Behavior = Attack }, new State { Condition = AttackingTarget, Behavior = VerticalGrappling } }); }
// Use this for initialization protected void Start() { _sense = GetComponentInChildren<PlayerSense>(); _sprite = GetComponentInChildren<SpriteSystem>(); _projector = GetComponentInChildren<ProjectileProjector>(); _webThread = GetComponent<LineRenderer>(); _controller = GetComponent<CharacterController>(); _behaviorFSM = new StateMachine(new List<State> { new State { Condition = DefaultCondition, Behavior = DoNothing}, new State { Condition = SensesPlayer, Behavior = MoveTowardPlayer }, new State { Condition = IsOverPlayer, Behavior = Attack }, new State { Condition = AttackingTarget, Behavior = VerticalGrappling } }); }
void Start() { _snout = GetComponentInChildren<ProjectileProjector>(); _movement = GetComponent<SidescrollingMovement>(); _sprite = GetComponentInChildren<SpriteSystem>(); List<State> states = new List<State> { new State{ Condition = () => true, Behavior = DoNothing }, new State{ Condition = PlayerNearby, Behavior = ChooseAction }, new State{ Condition = IsHit, Behavior = DoNothing } }; _fsm = new StateMachine(states); }