Vector3Extension.cs 339 B

123456789101112131415
  1. using System;
  2. using UnityEngine;
  3. public static class Vector3Extension
  4. {
  5. public static Vector3 Rotate(this Vector3 v, float degrees)
  6. {
  7. return Quaternion.Euler(0f, 0f, degrees) * v;
  8. }
  9. public static Vector3 Times(this Vector3 v, Vector3 other)
  10. {
  11. return new Vector3(v.x * other.x, v.y * other.y, v.z * other.z);
  12. }
  13. }