void Update() { float hPress = Input.GetAxis("Horizontal"); //if (hPress != 0) _entity.SendMessageToBrain((int)PlayerCommand.Walk, hPress); //Toan's code start //if (hPress * transform.localScale.x > 0) //{ // Vector3 temp = transform.localScale; // temp.x *= -1; // transform.localScale = temp; //} //Toan's code end if (Input.GetButtonDown("Jump")) { _entity.SendMessageToBrain((int)PlayerCommand.Jump); } if (Input.GetButtonDown("Fire1")) { _entity.SendMessageToBrain((int)PlayerCommand.Interact); } }
void TaskDone() { User.SendMessageToBrain((int)PlayerCommand.WorkDone); Debug.Log(CurrentInstruction.Result + " Done"); LoopSound.Stop(); if (CurrentInstruction.Type == TaskType.Active) { User.CollectItem(CurrentInstruction.Result); RecipeMenu.Remove(CurrentInstruction); CurrentHoldItems.Clear(); //OnHoldInstructionUpdate(); rdUIManager.UpdateOnHandItem(User.ItemOnHand, User); rdUIManager.UpdateStationPopups(this.gameObject); rdRecipeManager.UpdateInstruction(User.ItemOnHand); Status = StationStatus.Ready; } else { rdUIManager.UpdateStationPopups(this.gameObject, CurrentInstruction.Result); Status = StationStatus.Collect; } User = null; }