Example #1
0
 /// <summary>
 /// Instantiate the class.
 /// </summary>
 /// <param name="vortex"></param>
 /// <param name="fxAsset"></param>
 /// <param name="fxName"></param>
 /// <param name="position"></param>
 /// <param name="angle"></param>
 /// <param name="radiusX"></param>
 /// <param name="radiusY"></param>
 /// <param name="layerIdx"></param>
 public Particle(Vortex vortex, Vector3 position, Vector3 angle, string fxAsset, string fxName, float radiusX, float radiusY, int layerIdx)
     : base(Setup(position))
 {
     Parent     = vortex;
     _centerPos = position;
     _rotation  = MathEx.Euler(angle);
     _ptfx      = new LoopedParticle(fxAsset, fxName);
     _xRadius   = radiusX;
     _yRadius   = radiusY;
     LayerIndex = layerIdx;
     PostSetup();
 }
        /// <summary>
        /// Create a vortex at the given position.
        /// </summary>
        /// <param name="position"></param>
        /// <returns></returns>
        public Vortex CreateVortex(Vector3 position)
        {
            for (int i = _activeVortexList.Length - 1; i > 0; i--)
            {
                _activeVortexList[i] = _activeVortexList[i - 1];
            }

            position.Z = World.GetGroundHeight(position) - 10.0f;

            var tVortex = new Vortex(position);

            tVortex.Build();

            _activeVortexList[0] = tVortex;

            ActiveVortexCount = Math.Min(ActiveVortexCount + 1, _activeVortexList.Length);

            if (ScriptThread.GetVar <bool>("notifications"))
            {
                UI.Notify("Tornado spawned nearby.");
            }

            return(tVortex);
        }