Neodroid  0.2.0
Machine Learning Environment Prototyping Tool
IntVector3.cs
Go to the documentation of this file.
1 using System;
2 using UnityEngine;
3 
4 namespace droid.Runtime.Utilities.Structs {
5  [Serializable]
6  public struct IntVector3 {
7  [SerializeField] public int _X;
8  [SerializeField] public int _Y;
9  [SerializeField] public int _Z;
10 
11  public IntVector3(Vector3 vec3) {
12  this._X = Mathf.RoundToInt(vec3.x);
13  this._Y = Mathf.RoundToInt(vec3.y);
14  this._Z = Mathf.RoundToInt(vec3.z);
15  }
16 
17  public static IntVector3 operator+(IntVector3 a, IntVector3 b) {
18  a._X += b._X;
19  a._Y += b._Y;
20  a._Z += b._Z;
21  return a;
22  }
23 
24  public IntVector3(int x, int y, int z) {
25  this._X = x;
26  this._Y = y;
27  this._Z = z;
28  }
29 
30  public int X { get { return this._X; } set { this._X = value; } }
31 
32  public int Y { get { return this._Y; } set { this._Y = value; } }
33 
34  public int Z { get { return this._Z; } set { this._Z = value; } }
35  }
36 }
static IntVector3 operator+(IntVector3 a, IntVector3 b)
Definition: IntVector3.cs:17