Esempio n. 1
0
    private void DrawCone()
    {
        angle = Mathf.Abs(90 - ExtendVector2.ReturnAngleToDir(direction));
        if (angle < 90 && direction.x > 0)
        {
            angle = 360 - angle;
        }
        transform.rotation = Quaternion.Euler(Vector3.forward * angle);

        componentLight.RangeAngle  = angleCone;
        componentLight.LightRadius = distance;
    }
 public static Quaternion Direction(Vector2 dir)
 {
     return(Quaternion.AngleAxis(ExtendVector2.ReturnAngleToDir(dir), Vector3.forward));
 }
Esempio n. 3
0
 public static Vector2 OrthogonalVector(Vector2 a)
 {
     return(ExtendVector2.ReturnDirToAngle(ExtendVector2.ReturnAngleToDir(a) + 90));
 }