public RageDash(ISettings settings, CharacterController characterController, ShootAt shootAt) { attackSettings = (IAttackSettings)settings; moveSettings = (IMoveSettings)settings; this.characterController = characterController; this.shootAt = shootAt; currentState = State.Seting; inProgress = false; }
public override void _Ready() { base._Ready(); animatedSprite = GetNode <AnimatedSprite>("AnimatedSprite"); AddChild(shootAI = new ShootAt(Shoot, ChangeDirection, 60) { TargetHitgroups = new List <string> { HitGroups.Player, HitGroups.Wall } }); }
private void Awake() { _animator = GetComponent <Animator>(); ShootAt = gameObject.AddComponent <ShootAt>(); _megaStateMachine = _animator.GetBehaviour <MegaStateMachine>(); _megaStateMachine.MegaAi = this; ShootAt.Target = GameObject.Find("PlayerPrefab").transform; ShootAt.Shooter = transform; ShootAt.Bullet = Bullet; ShootAt.BulletSpeed = 5f; ShootAt.Interval = 150f; }
public void SetAndShoot(Vector3 position, Vector3 direction, int damage, float speed, ShootAt shootAt, float rotateModify = 0) { this.damage = damage; this.speed = speed; this.direction = direction.normalized; this.shootAt = shootAt; transform.position = position; transform.LookAt(direction); //rotate modify transform.Rotate(Vector3.up, rotateModify); gameObject.SetActive(true); StartCoroutine(DestroyTimer()); }
// Called when the node enters the scene tree for the first time. public override void _Ready() { base._Ready(); animatedSprite = GetNode <AnimatedSprite>("AnimatedSprite"); shootAI = new ShootAt(Shoot, ChangeDirection, 120) { TargetHitgroups = new List <string> { HitGroups.Player, HitGroups.Wall } }; AddChild(shootAI); AddChild(new HoverChase(this, 150, 300, 250)); }
public GameObject GetClosestTarget(ShootAt shootAt) { GameObject target = null; switch (shootAt) { case ShootAt.enemies: target = GetClosestEnemyGO(); break; case ShootAt.player: if (playerOnScene.activeSelf) { target = playerOnScene; } break; } return(target); }
public TouchAttack(ISettings settings, ShootAt shootAt) { attackSettings = (IAttackSettings)settings; this.shootAt = shootAt; }
public SpreadAttack(ISettings settings, Transform firePoint, Pool projectilePool, ShootAt shootAt) { attackSettings = (IAttackSettings)settings; this.firePoint = firePoint; this.projectilePool = projectilePool; this.shootAt = shootAt; thisCharacter = firePoint.root; }
public SingleShotAttack(ISettings settings, Transform firePoint, Pool projectilePool, ShootAt shootAt) { attackSettings = (IAttackSettings)settings; this.firePoint = firePoint; this.projectilePool = projectilePool; this.shootAt = shootAt; thisCharacter = firePoint.root; currentState = State.isShooting; }