private void Start() { rb2d = GetComponent <Rigidbody2D>(); laser2 = GetComponent <RectTransform>(); findPlayArea = GetComponent <FindPlayArea>(); spShop = GetComponent <SpriteShop>(); location = base.transform.position; FindPlayArea.setLaser2Bounds(); }
private void Update() { moveSpeed = SpriteShop.enemySpeed / -100f; if (location.y <= endPoint) { FindPlayArea.setLaser2Bounds(); } location.y += moveSpeed; base.transform.position = location; }