// Start is called before the first frame update void Start() { player = FindObjectOfType <RobotControl>(); if (player != null) { playerRB = player.GetComponent <Rigidbody>(); } // shootPoint = transform.Find("Shoot Point"); if (shootPoint == null) { shootPoint = transform.Find("Barrel/Shoot Point"); } // originalRotation = transform.localRotation; // audioSource = GetComponent <AudioSource>(); // bodyRb = GetComponentInParent <Rigidbody>(); // Registramos las correspondientes balas en el pool bulletPool = FindObjectOfType <BulletPool>(); Bullet bulletData = proyectilePrefab.GetComponent <Bullet>(); bulletPool.RegisterBullets(proyectilePrefab, rateOfFire, bulletData.lifeTime); }
// Start is called before the first frame update void Start() { player = FindObjectOfType <RobotControl>(); if (player != null) { playerRB = player.GetComponent <Rigidbody>(); } }
IEnumerator startMissiles() { RobotControl.GetComponent <Animator>().SetInteger("Arms", 4); yield return(new WaitForSeconds(2)); for (int i = 0; i < amountMissiles; i++) { Director.sharedDirector().playEffect(missel); Instantiate(missiles, positionMissiles[0].position, positionMissiles[0].rotation); yield return(new WaitForSeconds(2)); Director.sharedDirector().playEffect(missel); Instantiate(missiles, positionMissiles[1].position, positionMissiles[1].rotation); yield return(new WaitForSeconds(3)); } yield return(StartCoroutine(RobotControl.idleRobot())); }