private void Start() { rb = GetComponent <Rigidbody2D>(); //jumpForceVector = new Vector2(0, jumpForce); animator = GetComponent <Animator>(); World = FindObjectOfType <worldHandler>(); //TODO: Find by tag? canvas = GameObject.FindGameObjectWithTag("canvas").GetComponent <CanvasManager>(); gm = FindObjectOfType <GameManager>(); }
// Start is called before the first frame update void Start() { //this.GetComponent<Renderer>().material.color.a = 0.5f; m_Grid = GetComponent <Grid>(); World = FindObjectOfType <worldHandler>(); //TODO: Find by tag? cm = FindObjectOfType <CanvasManager>(); gm = FindObjectOfType <GameManager>(); //TODO: Find by tag? rot_center = transform.GetChild(0).GetComponent <Transform>(); lastFall = Time.time; lastKeyDown = Time.time; timeKeyPressed = Time.time; tileWorldLocations = new List <Vector3>(); foreach (var pos in tileWorldLocations) { print(pos); } if (!isValidGridPos()) { gm.endGame("You built too high :("); } }