Clear() private method

private Clear ( ) : void
return void
		public override void OnEnter()
		{
			ps = Fsm.GetOwnerDefaultTarget(gameObject).GetComponent<ParticleSystem>();


			if (delay.Value <= 0)
			{
				if (clear.Value) {
					stopWithClear.Value = false;
					ps.Clear();
				}

				else { 
					ps.Stop();
					ps.Clear();

				}

				if(finishEvent != null) Fsm.Event(finishEvent);{
				Finish();
				return;
			}
			}
			
			startTime = Time.realtimeSinceStartup;
			timer = 0f;
		}
Ejemplo n.º 2
0
        static int _m_Clear(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.ParticleSystem __cl_gen_to_be_invoked = (UnityEngine.ParticleSystem)translator.FastGetCSObj(L, 1);


            int __gen_param_count = LuaAPI.lua_gettop(L);

            try {
                if (__gen_param_count == 1)
                {
                    __cl_gen_to_be_invoked.Clear(  );



                    return(0);
                }
                if (__gen_param_count == 2 && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 2))
                {
                    bool withChildren = LuaAPI.lua_toboolean(L, 2);

                    __cl_gen_to_be_invoked.Clear(withChildren);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.ParticleSystem.Clear!"));
        }
 static int QPYX_Clear_YXQP(IntPtr L_YXQP)
 {
     try
     {
         int QPYX_count_YXQP = LuaDLL.lua_gettop(L_YXQP);
         if (QPYX_count_YXQP == 1)
         {
             UnityEngine.ParticleSystem QPYX_obj_YXQP = (UnityEngine.ParticleSystem)ToLua.CheckObject(L_YXQP, 1, typeof(UnityEngine.ParticleSystem));
             QPYX_obj_YXQP.Clear();
             return(0);
         }
         else if (QPYX_count_YXQP == 2)
         {
             UnityEngine.ParticleSystem QPYX_obj_YXQP = (UnityEngine.ParticleSystem)ToLua.CheckObject(L_YXQP, 1, typeof(UnityEngine.ParticleSystem));
             bool QPYX_arg0_YXQP = LuaDLL.luaL_checkboolean(L_YXQP, 2);
             QPYX_obj_YXQP.Clear(QPYX_arg0_YXQP);
             return(0);
         }
         else
         {
             return(LuaDLL.luaL_throw(L_YXQP, "invalid arguments to method: UnityEngine.ParticleSystem.Clear"));
         }
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
Ejemplo n.º 4
0
    static int Clear(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1 && TypeChecker.CheckTypes <UnityEngine.ParticleSystem>(L, 1))
            {
                UnityEngine.ParticleSystem obj = (UnityEngine.ParticleSystem)ToLua.ToObject(L, 1);
                obj.Clear();
                return(0);
            }
            else if (count == 2 && TypeChecker.CheckTypes <UnityEngine.ParticleSystem, bool>(L, 1))
            {
                UnityEngine.ParticleSystem obj = (UnityEngine.ParticleSystem)ToLua.ToObject(L, 1);
                bool arg0 = LuaDLL.lua_toboolean(L, 2);
                obj.Clear(arg0);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.ParticleSystem.Clear"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
 static public int Clear(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 1)
         {
             UnityEngine.ParticleSystem self = (UnityEngine.ParticleSystem)checkSelf(l);
             self.Clear();
             return(0);
         }
         else if (argc == 2)
         {
             UnityEngine.ParticleSystem self = (UnityEngine.ParticleSystem)checkSelf(l);
             System.Boolean             a1;
             checkType(l, 2, out a1);
             self.Clear(a1);
             return(0);
         }
         LuaDLL.luaL_error(l, "No matched override function to call");
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Ejemplo n.º 6
0
 static public int Clear(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 1)
         {
             UnityEngine.ParticleSystem self = (UnityEngine.ParticleSystem)checkSelf(l);
             self.Clear();
             pushValue(l, true);
             return(1);
         }
         else if (argc == 2)
         {
             UnityEngine.ParticleSystem self = (UnityEngine.ParticleSystem)checkSelf(l);
             System.Boolean             a1;
             checkType(l, 2, out a1);
             self.Clear(a1);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     part = GetComponent<ParticleSystem>();
     audio = GetComponent<AudioSource>();
     part.Stop();
     part.Clear();
 }
    static int Clear(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                UnityEngine.ParticleSystem obj = (UnityEngine.ParticleSystem)ToLua.CheckObject(L, 1, typeof(UnityEngine.ParticleSystem));
                obj.Clear();
                return(0);
            }
            else if (count == 2)
            {
                UnityEngine.ParticleSystem obj = (UnityEngine.ParticleSystem)ToLua.CheckObject(L, 1, typeof(UnityEngine.ParticleSystem));
                bool arg0 = LuaDLL.luaL_checkboolean(L, 2);
                obj.Clear(arg0);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.ParticleSystem.Clear"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
 // Use this for initialization
 void Start()
 {
     part = transform.FindChild( "ShockwaveParticleSystem" ).gameObject.GetComponent<ParticleSystem>();
     part.Clear();
     part.enableEmission = false;
     transform.localScale = new Vector3( 0, 0, 0 );
     shouldPlay = false;
 }
Ejemplo n.º 10
0
    //    private PlayerController playerScript;
    // Use this for initialization
    void Start()
    {
        GameObject.Find ("Loading Screen").GetComponent<Canvas> ().enabled = false;
        attributesScript = this.GetComponent<PlayerAttributes> ();
        levelUp = GameObject.Find ("LevelUp").GetComponent<ParticleSystem> ();
        levelUp.enableEmission = false;
        levelUp.Clear ();

        //playerScript = this.GetComponent<PlayerController> ();
    }
Ejemplo n.º 11
0
    public void charge(GameObject particles)
    {
        partSys = particles.GetComponent<ParticleSystem> ();

        if (currentBattery < maxBattery) {
            partSys.Pause ();
            isCharging = true;
        } else
            partSys.Clear ();
    }
Ejemplo n.º 12
0
 static public int Clear(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystem self = (UnityEngine.ParticleSystem)checkSelf(l);
         self.Clear();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 13
0
 // Use this for initialization
 void Start()
 {
     chargingEffectIn = GetComponent<ParticleSystem>();
     rb = GetComponent<Rigidbody>();
     position = new Vector3(transform.position.x, 0.0f, transform.position.z);
     isHere = false;
     chargingEffectIn.Stop();
     chargingEffectIn.Clear();
     rotationY.Set(0f, 0f, 0f);
     rotationY = rotationY.normalized*tumble;
     Quaternion deltaRotation = Quaternion.Euler(rotationY);
     //print("charger:" + position.x + " " + position.z);
 }
Ejemplo n.º 14
0
        public static void ClusterClear(this UnityEngine.ParticleSystem ps)
        {
            var observer = validateCheck(ps);

            if (observer == null)
            {
                return;
            }
            ps.Clear();
            FduParticleSystemOP op = new FduParticleSystemOP();

            op.operation = FduParticleSystemOP.Operation.clear;
            observer.addOperation(op);
        }
Ejemplo n.º 15
0
 static public int Clear__Boolean(IntPtr l)
 {
     try {
         UnityEngine.ParticleSystem self = (UnityEngine.ParticleSystem)checkSelf(l);
         System.Boolean             a1;
         checkType(l, 2, out a1);
         self.Clear(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 16
0
    public IEnumerator AutoReleaseParticle(string prefabName, ParticleSystem particle, PrefabPoolAgent agent)
    {
        yield return new WaitForSeconds(particle.startDelay + 0.25f);

        GameObject go = particle.gameObject;
        while (particle.IsAlive(true) && go.activeInHierarchy)
        {
            yield return null;
        }

        if (go.activeInHierarchy)
        {
            Despawn(prefabName, agent);
            particle.Clear(true);
        }
    }
    void Awake()
    {
        lights = gameObject.GetComponentsInChildren<Light>();
        flames = gameObject.GetComponentInChildren<ParticleSystem>();
        if ((row == 0 || row == 2) || (column == 0 || column == 2))
        {
            lights[0].enabled = false;
            lights[1].enabled = false;
            lights[2].enabled = false;
            flames.Pause();
            flames.Clear();
            isActive = false;
        }

        puzzleManager = GameObject.FindObjectOfType<LightsOn>();
    }
Ejemplo n.º 18
0
        public static void ClusterClear(this UnityEngine.ParticleSystem ps, bool withChildren)
        {
            var observer = validateCheck(ps);

            if (observer == null)
            {
                return;
            }
            ps.Clear(withChildren);
            FduParticleSystemOP op = new FduParticleSystemOP();

            op.operation = FduParticleSystemOP.Operation.clear;
            op.paras     = new object[1];
            op.paras[0]  = withChildren;
            observer.addOperation(op);
        }
	static public int Clear(IntPtr l) {
		try {
			#if DEBUG
			var method = System.Reflection.MethodBase.GetCurrentMethod();
			string methodName = GetMethodName(method);
			#if UNITY_5_5_OR_NEWER
			UnityEngine.Profiling.Profiler.BeginSample(methodName);
			#else
			Profiler.BeginSample(methodName);
			#endif
			#endif
			int argc = LuaDLL.lua_gettop(l);
			if(argc==1){
				UnityEngine.ParticleSystem self=(UnityEngine.ParticleSystem)checkSelf(l);
				self.Clear();
				pushValue(l,true);
				return 1;
			}
			else if(argc==2){
				UnityEngine.ParticleSystem self=(UnityEngine.ParticleSystem)checkSelf(l);
				System.Boolean a1;
				checkType(l,2,out a1);
				self.Clear(a1);
				pushValue(l,true);
				return 1;
			}
			pushValue(l,false);
			LuaDLL.lua_pushstring(l,"No matched override function Clear to call");
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
		#if DEBUG
		finally {
			#if UNITY_5_5_OR_NEWER
			UnityEngine.Profiling.Profiler.EndSample();
			#else
			Profiler.EndSample();
			#endif
		}
		#endif
	}
    static int Clear(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 1 && ToLua.CheckTypes(L, 1, typeof(UnityEngine.ParticleSystem)))
        {
            UnityEngine.ParticleSystem obj = (UnityEngine.ParticleSystem)ToLua.ToObject(L, 1);

            try
            {
                obj.Clear();
            }
            catch (Exception e)
            {
                return(LuaDLL.toluaL_exception(L, e));
            }

            return(0);
        }
        else if (count == 2 && ToLua.CheckTypes(L, 1, typeof(UnityEngine.ParticleSystem), typeof(bool)))
        {
            UnityEngine.ParticleSystem obj = (UnityEngine.ParticleSystem)ToLua.ToObject(L, 1);
            bool arg0 = LuaDLL.lua_toboolean(L, 2);

            try
            {
                obj.Clear(arg0);
            }
            catch (Exception e)
            {
                return(LuaDLL.toluaL_exception(L, e));
            }

            return(0);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: UnityEngine.ParticleSystem.Clear");
        }

        return(0);
    }
Ejemplo n.º 21
0
        protected IEnumerator ListenToDespawn(ParticleSystem emitter)
        {
            // Wait for the delay time to complete
            // Waiting the extra frame seems to be more stable and means at least one 
            //  frame will always pass
            yield return new WaitForSeconds(emitter.startDelay + 0.25f);
						
            while (emitter.IsAlive(true))
            {
                if (!emitter.gameObject.activeInHierarchy)
                {
                    emitter.Clear(true);
                    yield break;  // Do nothing, already despawned. Quit.
                }

                yield return null;
            }

            // Turn off emit before despawning
            InstanceManager.Despawn(this.poolName, emitter.transform);
        }
Ejemplo n.º 22
0
    public void Start()
    {
        god = GameObject.Find("God").GetComponent<SoundGod>();
        tickTime = 1.0 / goldTicksPerSecond;
        tickTimer = 0.0;

        carController = transform.parent.transform.parent.GetComponent<StephenCarController>();

        line = gameObject.GetComponent<LineRenderer>();
        system = gameObject.transform.GetChild(0).transform.GetChild(0).GetComponentInChildren<ParticleSystem>();
        system.enableEmission = false;
        system.Clear();
        //EraseLine();
    }
Ejemplo n.º 23
0
    // Use this for initialization
    protected virtual void Start()
    {
        // set the primaryNode to the Weapons_Primary
        var primaryNode = transform.FindChild("Weapons_Primary");

        // Checks the child count of primaryNode
        for (int i = primaryNode.transform.childCount - 1; i >= 0; i--)
        {
            // set weapon to instanstiate a GameObject as a Weapon
            var weapon = GameObject.Instantiate(PrimaryWeapon, primaryNode.GetChild(i).transform.position, primaryNode.transform.rotation) as Weapon;

            // set weapons parents to the primaryNode
            weapon.transform.parent = primaryNode;

            // add the weapon to the list of primaryWeapons
            primaryWeapons.Add(weapon);
        }
        // set speed to calculate the speed
        speed = CalculateSpeed();

        // if shield is not null
        if (Shield != null)
            // get the collider2D component
            shieldCollider = Shield.GetComponent<Collider2D>();

        // set smoking and fire effects to false
        isSmoking = false;
        isOnFire = false;

        //load particle effect SMOKE
        smoke = (GameObject)Instantiate(Resources.Load("SmokeParticleSystem"));
        smoke.transform.parent = this.gameObject.transform;

        smokeSystem = smoke.GetComponent<ParticleSystem> ();

        smokeSystem.Clear ();
        smokeSystem.Stop();

        //load particle effect FIRE
        fire = (GameObject)Instantiate(Resources.Load("FireParticleSystem"));
        fire.transform.parent = this.gameObject.transform;

        fireSystem = fire.GetComponent<ParticleSystem> ();

        fireSystem.Clear ();
        fireSystem.Stop();
    }
Ejemplo n.º 24
0
	void Start () 
	{
		m_Particle = Instantiate(m_Particle, this.transform.position, this.transform.rotation) as ParticleSystem;
		m_Particle.Stop();
		m_Particle.Clear();	
	}
	/// <summary>
	/// Enables or disables the specified particle system
	/// </summary>
	/// <param name="partSys">Particle system to enable.</param>
	/// <param name="toggle">If set to <c>true</c> system will be enabled.</param>
	void particleToggle(ParticleSystem partSys, bool toggle){
		if (toggle){
			partSys.enableEmission = toggle;
			partSys.Simulate(3);
			partSys.Play();
		}
		else {
			partSys.Stop();
			partSys.Clear();
		}

	}
Ejemplo n.º 26
0
        private IEnumerator ListenForEmitDespawn(ParticleSystem emitter)
        {
            yield return new WaitForSeconds(emitter.startDelay + 0.25f);

            float safetimer = 0;
            GameObject emitterGO = emitter.gameObject;
            while (emitter.IsAlive(true) && emitterGO.activeInHierarchy)
            {
                safetimer += Time.deltaTime;
                if (safetimer > MaxParticleDespawnTime)
                {
                    Debug.LogWarning
                    (
                          string.Format
                          (
                              "SpawnPool {0}: " +
                                  "Timed out while listening for all particles to die. " +
                                  "Waited for {1}sec.", PoolName, MaxParticleDespawnTime
                          )
                      );
                }
                yield return null;
            }

            if (emitterGO.activeInHierarchy)
            {
                Despawn(emitter.transform);
                emitter.Clear(true);
            }
        }
Ejemplo n.º 27
0
    // Private Functions
    // Awake(): is called at the start of the program
    void Awake()
    {
        // Singleton
        if (s_Instance == null)
            s_Instance = this;
        else
            Destroy(this.gameObject);

        float resultColor;
        // while: Initialise a color and checks if the color is acceptable
        // Since HSV input of colors is harder to implement,
        // it converts RGB into one OVERALL value and check if is within fMinimumArtilleryRGB and fMaximumArtilleryRGB range
        do
        {
            colorArtillery = new Color(UnityEngine.Random.value, UnityEngine.Random.value, UnityEngine.Random.value, 1f);
            resultColor = colorArtillery.r + colorArtillery.g + colorArtillery.b;

        } while (resultColor < 3f * fMinimumArtilleryRGB || resultColor > 3f * fMaximumArtilleryRGB);

        // Read level specific settings from Settings.cs
        colorArtillery = Settings.s_EnvironmentColor;
        fNutrientsChance = Settings.s_fPlayerNutrientChance;
        fWallSidesSpeed = Settings.s_fSideWallSpeed;
        fWallBackgroundSpeed = Settings.s_fBackgroundSpeed;

        // Background particle system set-up
        bgParticleSystem = transform.GetChild(2).GetComponent<ParticleSystem>();
        // Use the same color as the wall-sides and background
        bgParticleSystem.startColor = colorArtillery;
        // Set the starting speed from Settings.cs
        bgParticleSystem.startSpeed = Settings.s_fParticleStartSpeedMultiplier;
        // Since prewarm of particle systems doesn't adapt to the new color, the particle system will be simulated beforehand
        bgParticleSystem.Clear();
        bgParticleSystem.Simulate(bgParticleSystem.startLifetime);
        bgParticleSystem.Play();

        mAnimate = new Animate(transform.GetChild(0)); // Pool_WallSidesRenderer
    }
Ejemplo n.º 28
0
    public void OnGUI()
    {
        GUI.Box(new Rect(0, 0, 220, 420), "");

        GUI.Label(new Rect(11, 0, 80, 20), fpsstr);

        if (GUI.Button(new Rect(10, 20, 200, 20), "Clear Particles") && Time.time >= UItime)
        {
            ps.Clear();
            particleSystem.Reset();
            UItime = Time.time + UItimeNext;
        }

        Constants.mRadialViscosityGain =
            GUI.HorizontalSlider(new Rect(10, 60, 200, 20), Constants.mRadialViscosityGain, 0, 10f);
        GUI.Label(new Rect(10, 40, 200, 20), "Radial Vicousity Gain: " + Constants.mRadialViscosityGain);


        particleSystem.MaxParticles =
            (int)GUI.HorizontalSlider(new Rect(10, 100, 200, 20), particleSystem.MaxParticles, 0, Constants.MAX_PARTICLES);

        int pcount = particleSystem.Particles.Count;
        int pmax   = particleSystem.MaxParticles;

        GUI.Label(new Rect(10, 80, 200, 20), pcount + " of " + pmax + " Particles");

        if (pcount > pmax)
        {
            for (int i = pcount - 1; i >= pmax; i--)
            {
                particleSystem.Particles.RemoveAt(i);
            }
            ps.Clear();
        }

        float pmass = Constants.ParticleMass;

        pmass = GUI.HorizontalSlider(new Rect(10, 140, 200, 20), pmass, 0.001f, 50);
        if (Constants.ParticleMass != pmass)
        {
            Constants.ParticleMass = pmass;
            lGravity = Constants.Gravity * Constants.ParticleMass;
            ((ParticleEmitter)particleSystem.Emitters[0]).ParticleMass = Constants.ParticleMass;
            foreach (mParticle particle in particleSystem.Particles)
            {
                particle.Mass = Constants.ParticleMass;
            }
        }
        GUI.Label(new Rect(10, 120, 200, 20), "Particle Mass: " + pmass);

        collisionSolver.Bounciness =
            GUI.HorizontalSlider(new Rect(10, 180, 200, 20), collisionSolver.Bounciness, 0, 10);
        GUI.Label(new Rect(10, 160, 200, 20), "Bounciness: " + collisionSolver.Bounciness);

        float damp =
            GUI.HorizontalSlider(new Rect(10, 220, 200, 20), Constants.ParticleDamping, 0, 0.1f);

        GUI.Label(new Rect(10, 200, 200, 20), "Damping: " + Constants.ParticleDamping);
        if (Constants.ParticleDamping != damp)
        {
            foreach (mParticle particle in particleSystem.Particles)
            {
                particle.Solver.Damping = damp;
            }
            Constants.ParticleDamping = damp;
        }

        float gravity = Constants.Gravity.y * -1;

        gravity =
            GUI.HorizontalSlider(new Rect(10, 260, 200, 20), gravity, 0, 20);
        GUI.Label(new Rect(10, 240, 200, 20), "Gravity: " + gravity);
        Constants.Gravity = new Vector2(0, gravity * -1);
        lGravity          = Constants.Gravity * Constants.ParticleMass;



        Constants.GasConstant =
            GUI.HorizontalSlider(new Rect(10, 300, 200, 20), Constants.GasConstant, 0, 10);
        GUI.Label(new Rect(10, 280, 200, 20), "GasConstant: " + Constants.GasConstant);

        Constants.Friction =
            GUI.HorizontalSlider(new Rect(10, 340, 200, 20), Constants.Friction, 0, 0.5f);
        GUI.Label(new Rect(10, 320, 200, 20), "Dissipitation: " + Constants.Friction);

        GUI.Label(new Rect(10, 360, 200, 20), "Fill Type");
        fillTypeIndex = GUI.SelectionGrid(new Rect(10, 380, 200, 20), fillTypeIndex, fillTypeNames, 3);
    }