void Awake() { var spriteInChild = GetComponentInChildren <SpriteRenderer>(); var sprite = GetComponent <SpriteRenderer>(); lineDestroyer = GetComponent <LineDestroyer>(); if (spriteInChild == null) { SetExtremaOfSprite(sprite); } if (sprite == null) { SetExtremaOfSprite(spriteInChild); } drawAndEditScr = drawAndEditBtn.GetComponent <DrawAndEdit>(); }
private void Start() { player = gameObject.GetComponent <Player>(); lineDestroyer = gameObject.GetComponent <LineDestroyer>(); }