private void Reset()
    {
        var point = new Vector3Range
        {
            defaultValue = new Vector3(0, 0, 0),
            min          = new Vector3(-4.5f, 5.0f, -4.5f),
            max          = new Vector3(4.5f, 10.0f, 14.5f),
            constrainX   = false,
            constrainY   = false,
            constrainZ   = false
        };
        var angular = new Vector3Range
        {
            defaultValue = new Vector3(0, 0, 0),
            min          = new Vector3(-5, -5, -5),
            max          = new Vector3(5, 5, 5),
            constrainX   = false,
            constrainY   = false,
            constrainZ   = false
        };
        var euler = new Vector3Range
        {
            defaultValue = new Vector3(0, 0, 0),
            min          = new Vector3(0, 0, 0),
            max          = new Vector3(360, 360, 360),
            constrainX   = false,
            constrainY   = false,
            constrainZ   = false
        };

        Reset(point, angular, euler);
    }
    private void Reset()
    {
        var point = new Vector3Range
        {
            defaultValue = new Vector3(0, -2, 0),
            min          = new Vector3(-2, 3, 0),
            max          = new Vector3(2, 7, 0),
            constrainX   = false,
            constrainY   = false,
            constrainZ   = true
        };
        var angular = new Vector3Range
        {
            defaultValue = new Vector3(0, 0, 0),
            min          = new Vector3(0, 0, -5),
            max          = new Vector3(0, 0, 5),
            constrainX   = true,
            constrainY   = true,
            constrainZ   = false
        };
        var euler = new Vector3Range
        {
            defaultValue = new Vector3(0, 0, 0),
            min          = new Vector3(0, 0, 0),
            max          = new Vector3(0, 0, 360),
            constrainX   = true,
            constrainY   = true,
            constrainZ   = false
        };

        Reset(point, angular, euler);
    }
Esempio n. 3
0
 public TrajectoryRandomRange
     (Vector3Range point, Vector3Range angular, Vector3Range euler)
 {
     pointRange      = point;
     angularVelocity = angular;
     eulerAngles     = euler;
 }
Esempio n. 4
0
        internal Move(GameObject inGameObject, Vector3 inTargetPosition, bool inIsRelative)
        {
            Transform t = GetComponent(inGameObject);

            _range      = new Vector3Range(inIsRelative ? t.RelativePos : t.Pos, inTargetPosition);
            _isRelative = inIsRelative;
        }
Esempio n. 5
0
 public TrajectoryRandomizer
     (List <GameObject> prefabList, Vector3Range pointRangeTrajectory,
     Vector3Range angularVelocityOnSpawn,
     Vector3Range eulerAnglesOnSpawn)
 {
     prefabs              = prefabList;
     pointRange           = pointRangeTrajectory;
     eulerAngleRange      = eulerAnglesOnSpawn;
     angularVelocityRange = angularVelocityOnSpawn;
 }
Esempio n. 6
0
    public static Vector3 Random(this Vector3Range range)
    {
        var result = new Vector3()
        {
            x = UnityEngine.Random.Range(range.min.x, range.max.x),
            y = UnityEngine.Random.Range(range.min.y, range.max.y),
            z = UnityEngine.Random.Range(range.min.z, range.max.z)
        };

        return(result);
    }
Esempio n. 7
0
            internal static Vector3Range New()
            {
                var vec = new Vector3Range();

                vec.xMin   = vec.yMin = vec.zMin = Single.MaxValue;
                vec.xMax   = vec.yMax = vec.zMax = Single.MinValue;
                vec.xRange = vec.yRange = vec.zRange = 0f;
                vec.center = Vector3.zero;

                return(vec);
            }
 protected virtual void Reset
     (Vector3Range point, Vector3Range angular, Vector3Range euler)
 {
     RandomRange = new TrajectoryRandomRange(point, angular, euler);
 }