Esempio n. 1
0
    /// <summary>
    /// Set Move by Rotation
    /// </summary>
    /// <param name="f_Rotation"></param>
    /// <param name="f_VelocityMove"></param>
    public void Set_MoveRotation_XZ(float f_Rotation, float f_VelocityMove)
    {
        Class_Vector cl_Vector = new Class_Vector();

        Rigidbody r_Rigidbody = GetComponent <Rigidbody>();

        r_Rigidbody.AddForce(
            cl_Vector.Get_DegToVector_XZ(
                cl_Vector.Get_Exchance_Rotate_Unity(-f_Rotation), 1).normalized *f_VelocityMove);
    }
Esempio n. 2
0
    /// <summary>
    /// Get Rotation XZ
    /// </summary>
    /// <returns>Degree</returns>
    public float Get_Rotation_XZ()
    {
        Class_Vector cl_Vector = new Class_Vector();

        return(cl_Vector.Get_Exchance_Rotate_Unity(cl_Vector.Get_Rot_TransformToVector(transform.rotation).y));
    }