Example #1
0
 /// <summary>
 /// Distance between 2 vectors
 /// </summary>
 /// <param name="a">First Vector</param>
 /// <param name="b">Second Vector</param>
 /// <returns>Distance between <paramref name="a"/> and <paramref name="b"/></returns>
 public static float Distance(THVector3 a, THVector3 b)
 {
     return((float)Math.Sqrt(Math.Pow((a.x - b.x), 2) + Math.Pow((a.y - b.y), 2) + Math.Pow((a.z - b.z), 2)));
 }
Example #2
0
        public static void SpawnItem(this Item item, THVector3 position, Quaternion rotation = new Quaternion())
        {
            GameObject go = MonoBehaviour.Instantiate(UnityEngine.Resources.Load("Prefabs/ItemGameObject") as GameObject, position, rotation) as GameObject;

            go.GetComponent <ItemGameObject>().item = item;
        }
Example #3
0
 /// <summary>
 /// Constructor from another <see cref="THVector3"/>
 /// </summary>
 /// <param name="vec3">Vector to make this from</param>
 public THVector3(THVector3 vec3)
 {
     this = vec3;
 }