Beispiel #1
0
        protected override void OnBound(ExposedField property, IExposedToLevelEditor exposed)
        {
            if (property.Type == typeof(Vector2))
            {
                type = VectorTypes.Vector2;
            }
            else if (property.Type == typeof(Vector2Int))
            {
                type = VectorTypes.Vector2Int;
            }
            else if (property.Type == typeof(Vector3))
            {
                type = VectorTypes.Vector3;
            }
            else if (property.Type == typeof(Vector3Int))
            {
                type = VectorTypes.Vector3Int;
            }
            else if (property.Type == typeof(Vector4))
            {
                type = VectorTypes.Vector4;
            }
            else
            {
                type = VectorTypes.Invalid;
            }

            xField.contentType = IsInt ? TMP_InputField.ContentType.IntegerNumber : TMP_InputField.ContentType.DecimalNumber;
            yField.contentType = IsInt ? TMP_InputField.ContentType.IntegerNumber : TMP_InputField.ContentType.DecimalNumber;
        }
Beispiel #2
0
 /// <summary>
 /// Create 3D vector with given coordinates
 /// </summary>
 /// <param name="x">X axiz coordinate</param>
 /// <param name="y">Y axiz coordinate</param>
 /// <param name="z">Z axiz coordinate</param>
 /// <param name="type">Vector type (absolute or relative)</param>
 public Vector3D(float x, float y, float z, VectorTypes type)
 {
     // Keep 2 float digits
     X     = (float)Math.Round(x, 2);
     Y     = (float)Math.Round(y, 2);
     Z     = (float)Math.Round(z, 2);
     VType = type;
 }
Beispiel #3
0
 /// <summary>
 /// Create 3D vector with given coordinates
 /// </summary>
 /// <param name="x">X axiz coordinate</param>
 /// <param name="y">Y axiz coordinate</param>
 /// <param name="z">Z axiz coordinate</param>
 /// <param name="type">Vector type (absolute or relative)</param>
 public Vector3D(float x, float y, float z, VectorTypes type)
 {
     // Keep 2 float digits
     X = (float)Math.Round(x, 2);
     Y = (float)Math.Round(y, 2);
     Z = (float)Math.Round(z, 2);
     VType = type;
 }