Пример #1
0
    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));
    }
Пример #2
0
    //Движение Верх
    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));
        }
    }
Пример #3
0
 void Start()
 {
     state       = stateCharacterList.inactivity;
     angleRotate = 90f;
 }