static void ParticleEmitter_particles(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.ParticleEmitter _this = (UnityEngine.ParticleEmitter)vc.csObj;
         var result = _this.particles;
         var arrRet = result;
         for (int i = 0; arrRet != null && i < arrRet.Length; i++)
         {
             JSMgr.datax.setObject((int)JSApi.SetType.SaveAndTempTrace, arrRet[i]);
             JSApi.moveSaveID2Arr(i);
         }
         JSApi.setArrayS((int)JSApi.SetType.Rval, (arrRet != null ? arrRet.Length : 0), true);
     }
     else
     {
         UnityEngine.Particle[] arg0 = JSDataExchangeMgr.GetJSArg <UnityEngine.Particle[]>(() =>
         {
             int jsObjID = JSApi.getObject((int)JSApi.GetType.Arg);
             int length  = JSApi.getArrayLength(jsObjID);
             var ret     = new UnityEngine.Particle[length];
             for (var i = 0; i < length; i++)
             {
                 JSApi.getElement(jsObjID, i);
                 ret[i] = (UnityEngine.Particle)JSMgr.datax.getObject((int)JSApi.GetType.SaveAndRemove);
             }
             return(ret);
         });
         UnityEngine.ParticleEmitter _this = (UnityEngine.ParticleEmitter)vc.csObj;
         _this.particles = arg0;
     }
 }
 static public int set_color(IntPtr l)
 {
     UnityEngine.Particle o = (UnityEngine.Particle)checkSelf(l);
     UnityEngine.Color    v;
     checkType(l, 2, out v);
     o.color = v;
     setBack(l, o);
     return(0);
 }
 public void KillParticlesInChildren2()
 {
     UnityEngine.Particle[] particleArray = new UnityEngine.Particle[0];
     foreach (ParticleEmitter emitter in this.m_Target.GetComponentsInChildren <ParticleEmitter>())
     {
         emitter.emit      = false;
         emitter.particles = particleArray;
     }
 }
 static public int set_velocity(IntPtr l)
 {
     UnityEngine.Particle o = (UnityEngine.Particle)checkSelf(l);
     UnityEngine.Vector3  v;
     checkType(l, 2, out v);
     o.velocity = v;
     setBack(l, o);
     return(0);
 }
    static public int set_startEnergy(IntPtr l)
    {
        UnityEngine.Particle o = (UnityEngine.Particle)checkSelf(l);
        float v;

        checkType(l, 2, out v);
        o.startEnergy = v;
        setBack(l, o);
        return(0);
    }
    static public int set_angularVelocity(IntPtr l)
    {
        UnityEngine.Particle o = (UnityEngine.Particle)checkSelf(l);
        float v;

        checkType(l, 2, out v);
        o.angularVelocity = v;
        setBack(l, o);
        return(0);
    }
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.Particle o;
			o=new UnityEngine.Particle();
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
 public static int constructor(IntPtr l)
 {
     try {
         UnityEngine.Particle o;
         o=new UnityEngine.Particle();
         pushValue(l,o);
         return 1;
     }
     catch(Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return 0;
     }
 }
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.Particle o;
         o = new UnityEngine.Particle();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Exemple #10
0
 public void Emit(Vector3 position, Vector3 velocity, float size, float lifetime, Color32 color)
 {
     Particle particle = new Particle {
         position = position,
         velocity = velocity,
         lifetime = lifetime,
         startLifetime = lifetime,
         size = size,
         rotation = 0f,
         angularVelocity = 0f,
         color = color,
         randomSeed = 5
     };
     this.Internal_Emit(ref particle);
 }
Exemple #11
0
 public void KillParticlesListInChildren2()
 {
     UnityEngine.Particle[] particleArray = new UnityEngine.Particle[0];
     foreach (GameObject obj2 in this.m_TargetList)
     {
         if (obj2 != null)
         {
             foreach (ParticleEmitter emitter in obj2.GetComponentsInChildren <ParticleEmitter>())
             {
                 emitter.emit      = false;
                 emitter.particles = particleArray;
             }
         }
     }
 }
Exemple #12
0
 static void Particle_color(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.Particle _this = (UnityEngine.Particle)vc.csObj;
         var result = _this.color;
         JSMgr.datax.setObject((int)JSApi.SetType.Rval, result);
     }
     else
     {
         UnityEngine.Color    arg0  = (UnityEngine.Color)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
         UnityEngine.Particle _this = (UnityEngine.Particle)vc.csObj;
         _this.color = arg0;
         JSMgr.changeJSObj(vc.jsObjID, _this);
     }
 }
Exemple #13
0
 static void Particle_velocity(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.Particle _this = (UnityEngine.Particle)vc.csObj;
         var result = _this.velocity;
         JSApi.setVector3S((int)JSApi.SetType.Rval, result);
     }
     else
     {
         UnityEngine.Vector3  arg0  = (UnityEngine.Vector3)JSApi.getVector3S((int)JSApi.GetType.Arg);
         UnityEngine.Particle _this = (UnityEngine.Particle)vc.csObj;
         _this.velocity = arg0;
         JSMgr.changeJSObj(vc.jsObjID, _this);
     }
 }
Exemple #14
0
 static void Particle_startEnergy(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.Particle _this = (UnityEngine.Particle)vc.csObj;
         var result = _this.startEnergy;
         JSApi.setSingle((int)JSApi.SetType.Rval, (System.Single)(result));
     }
     else
     {
         System.Single        arg0  = (System.Single)JSApi.getSingle((int)JSApi.GetType.Arg);
         UnityEngine.Particle _this = (UnityEngine.Particle)vc.csObj;
         _this.startEnergy = arg0;
         JSMgr.changeJSObj(vc.jsObjID, _this);
     }
 }
Exemple #15
0
 public extern int GetParticles(Particle[] particles);
Exemple #16
0
 public void Emit(Particle particle)
 {
     this.Internal_Emit(ref particle);
 }
Exemple #17
0
 public extern void SetParticles(Particle[] particles, int size);
Exemple #18
0
 private extern void Internal_Emit(ref Particle particle);
	public virtual Renderer ConstructParticle(LWF lwf,
		int objectId, Particle particle)
	{
		return null;
	}
        public SGenericParticleSystem(ParticleEmitter emitter, ParticleRenderer renderer, Particle[] particles)
        {
            if (emitter == null || renderer == null)
                return;

            instanceID = emitter.GetInstanceID();
            goInstanceID = emitter.gameObject.GetInstanceID();
            isLegacy = true;
            isWorldSpace = emitter.useWorldSpace;
            emit = emitter.emit;
            enabled = emitter.enabled;
            position = emitter.transform.position;
            name = emitter.gameObject.name;
            SetParticleRenderer(renderer);

            this.particles = new SGenericParticleArray(particles);
        }
        public SGenericParticleArray(Particle[] particles)
        {
            if (particles == null || particles.Length == 0) {
                InitArrays(0);
                return;
            }

            int iMax = particles.Length;
            InitArrays(iMax);

            int i = iMax;
            while (--i > -1) {
                int iThree = i * 3;
                int iFour = i * 4;

                Particle p = particles[i];
                AddColor(p.color, iFour);
                AddPosition(p.position, iThree);
                AddVelocity(p.velocity, iThree);

                //rotations[i] = p.rotation;
                sizes[i] = p.size;
            }
        }
 static public int get_position(IntPtr l)
 {
     UnityEngine.Particle o = (UnityEngine.Particle)checkSelf(l);
     pushValue(l, o.position);
     return(1);
 }
 static public int get_size(IntPtr l)
 {
     UnityEngine.Particle o = (UnityEngine.Particle)checkSelf(l);
     pushValue(l, o.size);
     return(1);
 }
 static public int get_velocity(IntPtr l)
 {
     UnityEngine.Particle o = (UnityEngine.Particle)checkSelf(l);
     pushValue(l, o.velocity);
     return(1);
 }