Esempio n. 1
0
    private void Update()
    {
        currentFrame = owner.model.frameIndex;

        for (int i = 0; i < colliders[currentCombo].colliders.Count; i++)
        {
            if (colliders[currentCombo].colliders[i] != null)
            {
                DamageCollider dc = colliders[currentCombo].colliders[i].GetComponent <DamageCollider>();
                if (i != currentFrame)
                {
                    colliders[currentCombo].colliders[i].SetActive(false);
                }
            }
        }

        if (colliders[currentCombo].colliders[currentFrame] != null)
        {
            if (colliders[currentCombo].colliders[currentFrame].GetComponentInChildren <ShootProjectile>() != null)
            {
                ShootProjectile sp = colliders[currentCombo].colliders[currentFrame].GetComponentInChildren <ShootProjectile>();
                sp.direction  = swingDirection;
                sp.projectile = projectile;
                sp.owner      = owner;
            }
            colliders[currentCombo].colliders[currentFrame].SetActive(true);
        }
    }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     myAnimator           = GetComponent <Animator>();
     playerCharController = playerGameObject.GetComponent <Player>();
     shootProjectile      = weaponGameObject.GetComponent <ShootProjectile>();
     rotateTowardsMouse   = weaponGameObject.GetComponent <RotateTowardsMouse>();
 }
Esempio n. 3
0
    private void ShieldCollision(GameObject objectCollidedWith)
    {
        ShootProjectile shieldShoot = objectCollidedWith.GetComponentInChildren <ShootProjectile>();

        shieldShoot.SetProjectile(prefabOfThis);
        Destroy(gameObject);
        shieldShoot.Shoot();
    }
Esempio n. 4
0
    // Start is called before the first frame update
    void Start()
    {
        cornSelectedIcon.SetActive(true);
        strawberrySelectedIcon.SetActive(false);
        melonSelectedIcon.SetActive(false);
        coconutSelectedIcon.SetActive(false);

        projectileGun = GameObject.FindObjectOfType <ShootProjectile>();
    }
Esempio n. 5
0
    IEnumerator Fire()
    {
        shootOnCD  = true;
        isShooting = true;
        transform.Find("Karakter_3").GetComponent <Animator>().SetBool("isShooting", true);
        transform.Find("Karakter_2").GetComponent <Animator>().SetBool("isShooting", true);
        transform.Find("Karakter_1").GetComponent <Animator>().SetBool("isShooting", true);
        transform.Find("Karakter_0").GetComponent <Animator>().SetBool("isShooting", true);
        ShootProjectile.shoot();
        PlayerVariables.changeHealth(-1);
        yield return(new WaitForSeconds(0.14f));

        source.PlayOneShot(skudd, vol);
        isShooting = false;
        transform.Find("Karakter_3").GetComponent <Animator>().SetBool("isShooting", false);
        transform.Find("Karakter_2").GetComponent <Animator>().SetBool("isShooting", false);
        transform.Find("Karakter_1").GetComponent <Animator>().SetBool("isShooting", false);
        transform.Find("Karakter_0").GetComponent <Animator>().SetBool("isShooting", false);
        shootOnCD = false;
    }
Esempio n. 6
0
 protected override void Awake()
 {
     base.Awake();
     shooter = GetComponentInParent<ShootProjectile>();
 }
Esempio n. 7
0
 void Start()
 {
     // Setting up the references.
     shootProjectile = GetComponentInChildren <ShootProjectile>();
 }
Esempio n. 8
0
 public override void Initialize(GameObject obj)
 {
     launcher = obj.GetComponent <ShootProjectile>();
     launcher.ProjectileForce = projectileForce;
     launcher.Projectile      = projectile;
 }
Esempio n. 9
0
 private void Start()
 {
     playerPrimaryStat = PlayerStats.instance.character.primaryStat;
     shoot             = GetComponent <ShootProjectile>();
     UpdateWeaponDamage();
 }
Esempio n. 10
0
 void Start()
 {
     sp = GetComponent <ShootProjectile>();
     rb = GetComponent <Rigidbody2D>();
 }
Esempio n. 11
0
 // Use this for initialization
 void Start()
 {
     // fetching the "ShootProjectile" script, which is attached to your player ( * tagged "Player" * ) gameObject
     ShootScript = GameObject.FindGameObjectWithTag("Player").GetComponent <ShootProjectile>();
 }
Esempio n. 12
0
 protected override void Awake()
 {
     base.Awake();
     shooter = GetComponentInParent <ShootProjectile>();
 }
Esempio n. 13
0
 void Awake()
 {
     controller      = GetComponent <CharacterController>();
     shootProjectile = GetComponent <ShootProjectile>();
 }
Esempio n. 14
0
    // Update is called once per frame

    private void Start()
    {
        shootProjectile = GetComponent <ShootProjectile>();
    }
Esempio n. 15
0
 private void Awake()
 {
     _collider   = GetComponentInChildren <Collider>();
     _projectile = GetComponent <ShootProjectile>();
 }
    // Update is called once per frame

    private void Start()
    {
        shootProjectile = GetComponent <ShootProjectile>();
        controller      = GetComponentInParent <PlayerController>();
    }