public void StartLightningBall() { if (!isLightningBall) { isLightningBall = true; sr.enabled = false; lightningEffect.gameObject.SetActive(true); StartCoroutine(StopLightningBallAfterTime(duration)); OnLightningBallEnable?.Invoke(this); } }
public void StartLightningBall() { if (!this.isLightningBall) { this.isLightningBall = true; this.spriteRenderer.enabled = false; lightningBallEffect.gameObject.SetActive(true); StartCoroutine(StopLightningBallAfterTime(this.lightningBallDuration)); OnLightningBallEnable?.Invoke(this); } }
public void StartLightningBall() { // Check whether the ball is a lightning ball or not if (!this.isLightningBall) { // Set the lightning ball as active this.isLightningBall = true; // Disable the sprite renderer this.sr.enabled = false; // Enable the reference for the lightning ball effect lightningBallEffect.gameObject.SetActive(true); // Start a counter for the lightning ball effect duration StartCoroutine(StopLightningBallAfterTime(this.lightningBallDuration)); OnLightningBallEnable?.Invoke(this); } }