IEnumerator ChildDestruct() { yield return(null); if (childLaser) { childLaser.SendMessage("ChildDestruct"); } float alpha = 0.5f; while (alpha > 0) { alpha -= 0.05f; mLineRenderer.material.SetColor("_TintColor", new Color(1f, 1f, 1f, alpha)); yield return(new WaitForSeconds(Time.deltaTime)); } Destroy(this.gameObject); }
public void SetParent(BouncingLaser bouncingLaser) { this.parentLaser = bouncingLaser; parentLaser.SendMessage("SetChildLaser", this); }
IEnumerator ParentDestruct() { parentLaser.SendMessage("Destruct", this); yield return(null); }