Пример #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);
        }
    }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     myAnimator           = GetComponent <Animator>();
     playerCharController = playerGameObject.GetComponent <Player>();
     shootProjectile      = weaponGameObject.GetComponent <ShootProjectile>();
     rotateTowardsMouse   = weaponGameObject.GetComponent <RotateTowardsMouse>();
 }
Пример #3
0
    private void ShieldCollision(GameObject objectCollidedWith)
    {
        ShootProjectile shieldShoot = objectCollidedWith.GetComponentInChildren <ShootProjectile>();

        shieldShoot.SetProjectile(prefabOfThis);
        Destroy(gameObject);
        shieldShoot.Shoot();
    }
Пример #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>();
    }
Пример #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;
    }
Пример #6
0
 protected override void Awake()
 {
     base.Awake();
     shooter = GetComponentInParent<ShootProjectile>();
 }
Пример #7
0
 void Start()
 {
     // Setting up the references.
     shootProjectile = GetComponentInChildren <ShootProjectile>();
 }
Пример #8
0
 public override void Initialize(GameObject obj)
 {
     launcher = obj.GetComponent <ShootProjectile>();
     launcher.ProjectileForce = projectileForce;
     launcher.Projectile      = projectile;
 }
Пример #9
0
 private void Start()
 {
     playerPrimaryStat = PlayerStats.instance.character.primaryStat;
     shoot             = GetComponent <ShootProjectile>();
     UpdateWeaponDamage();
 }
Пример #10
0
 void Start()
 {
     sp = GetComponent <ShootProjectile>();
     rb = GetComponent <Rigidbody2D>();
 }
Пример #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>();
 }
Пример #12
0
 protected override void Awake()
 {
     base.Awake();
     shooter = GetComponentInParent <ShootProjectile>();
 }
Пример #13
0
 void Awake()
 {
     controller      = GetComponent <CharacterController>();
     shootProjectile = GetComponent <ShootProjectile>();
 }
Пример #14
0
    // Update is called once per frame

    private void Start()
    {
        shootProjectile = GetComponent <ShootProjectile>();
    }
Пример #15
0
 private void Awake()
 {
     _collider   = GetComponentInChildren <Collider>();
     _projectile = GetComponent <ShootProjectile>();
 }
Пример #16
0
    // Update is called once per frame

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