示例#1
0
    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>();
    }
示例#2
0
 private void Start()
 {
     player        = gameObject.GetComponent <Player>();
     lineDestroyer = gameObject.GetComponent <LineDestroyer>();
 }