示例#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;
    }
示例#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
                }
            });
        }
示例#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;
    }
示例#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());
    }
示例#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));
    }
示例#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);
    }
示例#7
0
 public TouchAttack(ISettings settings, ShootAt shootAt)
 {
     attackSettings = (IAttackSettings)settings;
     this.shootAt   = shootAt;
 }
示例#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;
 }
示例#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;
    }