// Use this for initialization void Start() { p.position = new Vector3((p.getChildBounds().size.x * 3) + MoveBoxScaler.screenSize.x, p.position.y); Debug.Log(new Vector3((p.getChildBounds().size.x * 3) + MoveBoxScaler.screenSize.x, p.position.y)); endpos = new Vector3(p.getChildBounds().size.x + MoveBoxScaler.screenSize.x, p.position.y); b = FindObjectOfType<BackgroundControler>(); enabled = false; }
void Start() { ri = playerAni.GetComponent<Rigidbody2D>(); rayMask = 1 << LayerMask.NameToLayer("Ground"); if (!back) back = FindObjectOfType<BackgroundControler>(); if (!playerControler) playerControler = FindObjectOfType<PlayerControler>(); enabled = false; }