public ChargeAttack(StateMachineClassic sm, IChargeAttack attack, Transform owner, Transform objective, Transform castAttackPoint, LaserEnemy laserInstantiator) : base(sm) { this.attack = attack; this.owner = owner; this.objective = objective; this.castAttackPoint = castAttackPoint; this.laserInstantiator = laserInstantiator; }
public LaserEnemyModel(LaserEnemyView view, Transform owner, List <ANode> availableNodes, float speed, List <Transform> patrolWaypoints, bool patrolLoop, Transform objective, float distArroundPlayer, Laser attack, Transform castPoint, LaserEnemy entity) { _view = view; _stateMachine = new StateMachineClassic(); _stateMachine.AddState(new MyPatrolState(_stateMachine, owner, speed, patrolWaypoints, patrolLoop)); _stateMachine.AddState(new MoveNearObjective(_stateMachine, availableNodes, owner, objective, distArroundPlayer, speed)); _stateMachine.AddState(new ChargeAttack(_stateMachine, attack, owner, objective, castPoint, entity)); }
public EnemyRangedMetheoriteSpawner_PathfindingState(StateMachineClassic sm, EnemyRangedMetheoriteSpawner owner, List <ANode> nodes) : base(sm) { this.owner = owner; path = new List <Transform>(); this.nodes = nodes; target = owner.objective.transform; index = 0; }
public MyPatrolState(StateMachineClassic sm, Transform owner, float speed, List <Transform> waypoints, bool loop) : base(sm) { this.waypoints = new List <Transform>(waypoints); index = 0; this.speed = speed; this.owner = owner; this.loop = loop; goingBack = false; }
protected override void Awake() { base.Awake(); sm = new StateMachineClassic(); sm.AddState(new LaserEnemy_R_CastLaserState(sm, this)); sm.AddState(new LaserEnemy_R_IdleState(sm, this)); sm.SetState <LaserEnemy_R_IdleState>(); anim = GetComponent <Animator>(); target = FindObjectOfType <Player>(); }
private void Start() { _sm = new StateMachineClassic(); _sm.AddState(new EnemyRangedMetheoriteSpawner_AttackState(_sm, this)); _sm.AddState(new EnemyRangedMetheoriteSpawner_SpawnState(_sm, this)); _sm.AddState(new EnemyRangedMetheoriteSpawner_CooldownState(_sm, this)); _sm.AddState(new EnemyRangedMetheoriteSpawner_PathfindingState(_sm, this, FindObjectOfType <NodesList>().GetNodes())); _sm.SetState <EnemyRangedMetheoriteSpawner_SpawnState>(); attackTimer = 0; }
public MoveNearObjective(StateMachineClassic sm, List <ANode> availableNodes, Transform owner, Transform objective, float distanceToMoveArround, float speed) : base(sm) { nodes = new List <ANode>(availableNodes); //pathfinder = new AStar(); this.owner = owner; this.distanceToMoveArround = distanceToMoveArround; this.objective = objective; index = 0; waypointsUtilities = new WaypointsUtilities(); this.speed = speed; }
protected override void Awake() { base.Awake(); initialPosition = transform.position; initialRotation = transform.rotation; rigi = GetComponent <Rigidbody>(); target = FindObjectOfType <Player>(); EventsManager.SuscribeToEvent("PlayerResurrect", SetInitialPosAndRotation); sm = new StateMachineClassic(); sm.AddState(new GhostEnemy_R_ChaseState(sm, this)); }
public LaserEnemy_R_IdleState(StateMachineClassic sm, LaserEnemy_R owner) : base(sm) { this.owner = owner; }
public State(StateMachineClassic sm) { _sm = sm; }
public EnemyRangedMetheoriteSpawner_CooldownState(StateMachineClassic sm, EnemyRangedMetheoriteSpawner owner) : base(sm) { this.owner = owner; }
public GhostEnemy_R_ChaseState(StateMachineClassic sm, GhostEnemy_R owner) : base(sm) { this.owner = owner; }