// Update is called once per frame void Update() { //movement = new Vector2(Input.GetAxis("Horizontal"), 0f); //// Pick up object //if (Input.GetKey(KeyCode.Space)) //{ // pickUpBlock(); //} //if (target != null) //{ // var distanceX = target.position.x - transform.position.x; // Debug.Log("distanceX " + distanceX); // if (Mathf.Abs(distanceX) <= 0.08f) // { // movement = Vector2.zero; // } // else // { // movement = new Vector2(distanceX, 0f).normalized; // } //} currentState = currentState.DoState(this); }
void Start() { rb = GetComponent <Rigidbody>(); blocksInRange = new List <GameObject>(); lastBlockListCount = 0; currentState = IdleState; }