public IEnumerator FakeUpdate(float period) { WaitForSeconds waitPeriod = new WaitForSeconds(period); shootController _shootcontroller = new shootController(); Motor _motor = new Motor(); while (true) { if (_gun._projectileCount > 0) { if (_shootcontroller.isShooting()) { _gun.Shoot(); } } else { Debug.LogError("There is no projectile"); } _motor.Move(); _motor.Turn(); yield return(waitPeriod); } }
IEnumerator shotPowerup(Collider player) { shootController shotStats = player.GetComponent <shootController>(); shotStats.numShots += 2; GetComponent <MeshRenderer>().enabled = false; GetComponent <Collider>().enabled = false; yield return(new WaitForSeconds(duration)); shotStats.numShots -= 2; Destroy(gameObject); }
void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { Debug.Log("Hit the applier"); Debug.Log(other); healthStats = other.GetComponent <PlayerStats>(); Debug.Log(healthStats); shootStats = other.GetComponent <shootController>(); moveStats = other.GetComponent <PlayerController>(); // particleSystem = healthStats.particleSystem; GetComponent <Collider>().enabled = false; StartCoroutine("Modify"); } }
IEnumerator speedPowerup(Collider player) { shootController shotStats = player.GetComponent <shootController>(); PlayerController playerStats = player.GetComponent <PlayerController>(); shotStats.timeBetweenShots /= 2; playerStats.walkSpeed *= 2; GetComponent <MeshRenderer>().enabled = false; GetComponent <Collider>().enabled = false; yield return(new WaitForSeconds(duration)); playerStats.walkSpeed /= 2; shotStats.timeBetweenShots *= 2; Destroy(gameObject); }
private void Start() { m_selfRigibody = GetComponent <Rigidbody2D>(); m_shootingAblities = GetComponentInChildren <shootController>(); }
// Start is called before the first frame update void Start() { shootController = GetComponent <shootController> (); anim = GetComponent <Animator> (); }
private void Start() { m_playerRigibody = GetComponent <Rigidbody2D>(); m_playerShootingAbilities = GetComponentInChildren <shootController>(); m_boosterEffect.SetActive(false); }