Exemplo n.º 1
0
    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;
    }
Exemplo n.º 2
0
        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
                }
            });
        }
Exemplo n.º 3
0
    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;
    }
Exemplo n.º 4
0
    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());
    }
Exemplo n.º 5
0
    // 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));
    }
Exemplo n.º 6
0
    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);
    }
Exemplo n.º 7
0
 public TouchAttack(ISettings settings, ShootAt shootAt)
 {
     attackSettings = (IAttackSettings)settings;
     this.shootAt   = shootAt;
 }
Exemplo n.º 8
0
 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;
 }
Exemplo n.º 9
0
    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;
    }