Exemple #1
0
    public void Initialize(RangedAttackFeature user, float speed, float range, float damage, Vector3 direction = new Vector3())
    {
        this.user   = user;
        this.speed  = speed;
        this.range  = range;
        this.damage = damage;

        Vector3    originPosition = user.ShootOrigin.position;
        Quaternion originRotation;

        if (direction == new Vector3())
        {
            originRotation = user.ShootOrigin.rotation;
        }
        else
        {
            originRotation = Quaternion.LookRotation(direction);
        }

        InitializeEffect(originPosition, originRotation);

        if (!user.IsPlayer)
        {
            GameObject player = GameObject.FindGameObjectWithTag("Player");
            playerHealth   = player.GetComponent <PlayerHealth>();
            playerDashing  = player.GetComponent <DashingFeature>();
            playerBlocking = player.GetComponentInChildren <BlockingFeature>();
        }
        else
        {
            outerBehaviour = GetComponentInChildren <OuterProjectileBehaviour>();
        }
    }