public void MoveStop() { state = stateCharacterList.inactivity; angleRotate = 90f; //Округления позиций transform.rotation = Quaternion.Euler(RoundVectorTo(new Vector3( transform.rotation.x, transform.rotation.y, transform.rotation.z), 90f)); transform.position = RoundVectorTo(transform.position, 1f, new Vector3(0.5f, 0.5f, 0.5f)); }
//Движение Верх public void MoveForward() { if (angleRotate >= 85f && state != stateCharacterList.forward) { vectorRotation = new Vector3(0, 0, 1); vectorMovement = new Vector3(-1, 0, 0); state = stateCharacterList.forward; angleRotate = 0; //Округления позиций transform.rotation = Quaternion.Euler(RoundVectorTo(new Vector3( transform.rotation.x, transform.rotation.y, transform.rotation.z), 90f)); transform.position = RoundVectorTo(transform.position, 1f, new Vector3(0.5f, 0.5f, 0.5f)); } }
void Start() { state = stateCharacterList.inactivity; angleRotate = 90f; }