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); } }
// Use this for initialization void Start() { myAnimator = GetComponent <Animator>(); playerCharController = playerGameObject.GetComponent <Player>(); shootProjectile = weaponGameObject.GetComponent <ShootProjectile>(); rotateTowardsMouse = weaponGameObject.GetComponent <RotateTowardsMouse>(); }
private void ShieldCollision(GameObject objectCollidedWith) { ShootProjectile shieldShoot = objectCollidedWith.GetComponentInChildren <ShootProjectile>(); shieldShoot.SetProjectile(prefabOfThis); Destroy(gameObject); shieldShoot.Shoot(); }
// 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>(); }
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; }
protected override void Awake() { base.Awake(); shooter = GetComponentInParent<ShootProjectile>(); }
void Start() { // Setting up the references. shootProjectile = GetComponentInChildren <ShootProjectile>(); }
public override void Initialize(GameObject obj) { launcher = obj.GetComponent <ShootProjectile>(); launcher.ProjectileForce = projectileForce; launcher.Projectile = projectile; }
private void Start() { playerPrimaryStat = PlayerStats.instance.character.primaryStat; shoot = GetComponent <ShootProjectile>(); UpdateWeaponDamage(); }
void Start() { sp = GetComponent <ShootProjectile>(); rb = GetComponent <Rigidbody2D>(); }
// 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>(); }
protected override void Awake() { base.Awake(); shooter = GetComponentInParent <ShootProjectile>(); }
void Awake() { controller = GetComponent <CharacterController>(); shootProjectile = GetComponent <ShootProjectile>(); }
// Update is called once per frame private void Start() { shootProjectile = GetComponent <ShootProjectile>(); }
private void Awake() { _collider = GetComponentInChildren <Collider>(); _projectile = GetComponent <ShootProjectile>(); }
// Update is called once per frame private void Start() { shootProjectile = GetComponent <ShootProjectile>(); controller = GetComponentInParent <PlayerController>(); }