Example #1
0
    public void CancelLandEffect()
    {
        EmissionModule temp = land.emission;

        temp.rateOverTime = new MinMaxCurve(0);
        isOn = false;
    }
Example #2
0
    // Update is called once per frame
    void Update()
    {
        if (activated)
        {
            EmissionModule mod = gameObject.GetComponent <ParticleSystem>().emission;
            mod.enabled = true;
            if (target != null)
            {
                //bezier
                Vector3 p0 = gameObject.transform.position;
                Vector3 p3 = new Vector3(target.transform.position.x, target.transform.position.y, target.transform.position.z);
                Vector3 p1 = Vector3.Lerp(p0, p3, 0.5f);
                Vector3 p2 = p1;

                particles = new Particle[ps.particleCount];

                ps.GetParticles(particles);
                for (int i = 0; i < particles.Length; i++)
                {
                    float t = 1 - particles[i].remainingLifetime / particles[i].startLifetime;
                    particles[i].position = Mathf.Pow(1 - t, 3) * p0 + 3 * Mathf.Pow(1 - t, 2) * t * p1 + 3 * (1 - t) * t * t * p2 + Mathf.Pow(t, 3) * p3;
                }

                ps.SetParticles(particles);
            }
        }
        else
        {
            EmissionModule mod = gameObject.GetComponent <ParticleSystem>().emission;
            mod.enabled = false;
            target      = null;
        }
    }
Example #3
0
    public void InitializeChildWind(TileProperties tile, Wind previous, HexDirection direction)
    {
        transform.position = tile.transform.position;
        this.previous      = previous;
        this.tile          = tile;
        this.direction     = direction;
        next    = new List <Wind>();
        custom1 = new List <Vector4>();
        AddToTurnManager();
        tile.wind = this;


        ps = GetComponentInChildren <ParticleSystem>();
        EmissionModule emission = ps.emission;

        if (previous == null)
        {
            emission.rateOverTime = WindManager.Instance.beginRate;
        }
        else
        {
            emission.rateOverTime = WindManager.Instance.normalRate;
        }
        ps.Play();
    }
Example #4
0
        /// <summary>
        /// Create VGO_PS_EmissionModule from EmissionModule.
        /// </summary>
        /// <param name="module"></param>
        /// <returns></returns>
        protected virtual VGO_PS_EmissionModule CreateVgoModule(EmissionModule module)
        {
            var vgoModule = new VGO_PS_EmissionModule()
            {
                enabled                    = module.enabled,
                rateOverTime               = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.rateOverTime),
                rateOverTimeMultiplier     = module.rateOverTimeMultiplier,
                rateOverDistance           = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.rateOverDistance),
                rateOverDistanceMultiplier = module.rateOverDistanceMultiplier,
                //BurstCount = module.burstCount,
            };

            if (module.burstCount > 0)
            {
                Burst[] bursts = new Burst[module.burstCount];

                module.GetBursts(bursts);

                if ((bursts != null) && bursts.Any())
                {
                    vgoModule.bursts = new VGO_PS_Burst[bursts.Length];

                    for (int idx = 0; idx < bursts.Length; idx++)
                    {
                        vgoModule.bursts[idx] = VgoParticleSystemBurstConverter.CreateFrom(bursts[idx]);
                    }
                }
            }

            return(vgoModule);
        }
Example #5
0
        /// <summary>
        /// Set ParticleSystem emission field value.
        /// </summary>
        /// <param name="particleSystem"></param>
        /// <param name="vgoModule"></param>
        protected virtual void SetModuleValue(ParticleSystem particleSystem, VGO_PS_EmissionModule vgoModule)
        {
            if (vgoModule == null)
            {
                return;
            }

            EmissionModule module = particleSystem.emission;

            module.enabled                    = vgoModule.enabled;
            module.rateOverTime               = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.rateOverTime);
            module.rateOverTimeMultiplier     = vgoModule.rateOverTimeMultiplier;
            module.rateOverDistance           = VgoParticleSystemMinMaxCurveConverter.CreateMinMaxCurve(vgoModule.rateOverDistance);
            module.rateOverDistanceMultiplier = vgoModule.rateOverDistanceMultiplier;
            //module.burstCount = vgoModule.BurstCount;

            if ((vgoModule.bursts != null) && vgoModule.bursts.Any())
            {
                module.burstCount = vgoModule.bursts.Length;

                for (int idx = 0; idx < vgoModule.bursts.Length; idx++)
                {
                    module.SetBurst(idx, VgoParticleSystemBurstConverter.CreateBurst(vgoModule.bursts[idx]));
                }
            }
        }
Example #6
0
    public void FadeOut()
    {
        fadeOut = true;

        emissionModule  = particleSystem.emission;
        initialEmission = emissionModule.rateOverTime.constant;
        fadeOutStart    = Time.time;
    }
Example #7
0
    void EnableAll()
    {
        EmissionModule mod = gameObject.GetComponent <ParticleSystem>().emission;

        chain1p.GetComponent <Chain>().activated = true;
        chain2p.GetComponent <Chain>().activated = true;
        mod.enabled = true;
    }
Example #8
0
    public void SetLandEffect()
    {
        if (isOn)
        {
            return;
        }
        EmissionModule temp = land.emission;

        temp.rateOverTime = new MinMaxCurve(landStartTime);
        isOn = true;
    }
Example #9
0
    private void ProcessFire()
    {
        bool buttonIsDown = CrossPlatformInputManager.GetButton("Fire1");
        int  boolValue    = buttonIsDown ? 1 : 0;

        foreach (GameObject gun in guns)
        {
            ParticleSystem bullet   = gun.GetComponent <ParticleSystem>();
            EmissionModule emission = bullet.emission;
            emission.rateOverTime = boolValue * 10;
        }
    }
Example #10
0
    private void ParticleUpdate()
    {
        // Apply Emissionrates
        foreach (ParticleType type in (ParticleType[])Enum.GetValues(typeof(ParticleType)))
        {
            EmissionModule JumpThrust = m_ParticleSystems[type].emission;
            JumpThrust.rateOverTime = m_ParticleEmission[type];
        }

        // Bring emission rates to 0
        m_ParticleEmission[ParticleType.JumpThrusterEmission]  = Mathf.Lerp(m_ParticleEmission[ParticleType.JumpThrusterEmission], 0, 8 * Time.deltaTime);
        m_ParticleEmission[ParticleType.JumpThrusterExplosion] = Mathf.Lerp(m_ParticleEmission[ParticleType.JumpThrusterExplosion], 0, 100 * Time.deltaTime);
    }
Example #11
0
 public void SetAutoplay(bool on)
 {
     if (on == false)
     {
         foreach (ParticleSystem ps in ParticleSystems)
         {
             MainModule module = ps.main;
             module.loop = false;
             EmissionModule emModule = ps.emission;
             emModule.enabled = false;
         }
     }
 }
Example #12
0
    public void SetClimbEffect()
    {
        if (isOn)
        {
            return;
        }
        EmissionModule temp = hand.emission;

        temp.rateOverTime = new MinMaxCurve(handStartTime);
        temp = leg.emission;
        temp.rateOverTime = new MinMaxCurve(legStartTime);
        isOn = true;
    }
Example #13
0
 void Awake()
 {
     if (!spriteRenderer)
     {
         spriteRenderer = GetComponent <SpriteRenderer>();
     }
     if (!danceParticleSystem)
     {
         danceParticleSystem = GetComponentInChildren <ParticleSystem>();
         emissionModule      = danceParticleSystem.emission;
     }
     textmesh = GetComponentInChildren <TextMeshProUGUI>();
 }
Example #14
0
    public IEnumerator WaitBeforeDestroy()
    {
        ps.Stop();
        float timeToWait = ps.main.startLifetime.constant;

        foreach (Wind wind in next)
        {
            EmissionModule emission = wind.ps.emission;
            emission.rateOverTime = WindManager.Instance.beginRate;
        }
        yield return(new WaitForSeconds(timeToWait));

        WindManager.Instance.WindsPool.Push(this);
    }
Example #15
0
    public void End()
    {
        float maxLifetime = 0f;

        //disable any particle systems and also find the maximum lifetime of any particle in this event
        foreach (ParticleSystem particleSystem in GetComponentsInChildren <ParticleSystem>())
        {
            maxLifetime = Mathf.Max(particleSystem.main.startLifetime.constant, maxLifetime);
            EmissionModule emission = particleSystem.emission;
            emission.enabled = false;
        }

        Destroy(gameObject, maxLifetime);
    }
Example #16
0
        protected override YAMLMappingNode ExportYAMLRoot(IExportContainer container)
        {
            YAMLMappingNode node = base.ExportYAMLRoot(container);

            node.AddSerializedVersion(ToSerializedVersion(container.ExportVersion));
            node.Add(LengthInSecName, LengthInSec);
            node.Add(SimulationSpeedName, SimulationSpeed);
            node.Add(StopActionName, (int)StopAction);
            node.Add(LoopingName, Looping);
            node.Add(PrewarmName, Prewarm);
            node.Add(PlayOnAwakeName, PlayOnAwake);
            node.Add(UseUnscaledTimeName, UseUnscaledTime);
            node.Add(AutoRandomSeedName, GetAutoRandomSeed(container.Version));
            node.Add(UseRigidbodyForVelocityName, GetUseRigidbodyForVelocity(container.Version));
            node.Add(StartDelayName, GetStartDelay(container.Version).ExportYAML(container));
            node.Add(MoveWithTransformName, (int)MoveWithTransform);
            node.Add(MoveWithCustomTransformName, MoveWithCustomTransform.ExportYAML(container));
            node.Add(ScalingModeName, (int)GetScalingMode(container.Version));
            node.Add(RandomSeedName, RandomSeed);
            node.Add(InitialModuleName, InitialModule.ExportYAML(container));
            node.Add(ShapeModuleName, ShapeModule.ExportYAML(container));
            node.Add(EmissionModuleName, EmissionModule.ExportYAML(container));
            node.Add(SizeModuleName, SizeModule.ExportYAML(container));
            node.Add(RotationModuleName, RotationModule.ExportYAML(container));
            node.Add(ColorModuleName, ColorModule.ExportYAML(container));
            node.Add(UVModuleName, UVModule.ExportYAML(container));
            node.Add(VelocityModuleName, VelocityModule.ExportYAML(container));
            node.Add(InheritVelocityModuleName, GetInheritVelocityModule(container.Version).ExportYAML(container));
            node.Add(ForceModuleName, ForceModule.ExportYAML(container));
            node.Add(ExternalForcesModuleName, GetExternalForcesModule(container.Version).ExportYAML(container));
            node.Add(ClampVelocityModuleName, ClampVelocityModule.ExportYAML(container));
            node.Add(NoiseModuleName, GetNoiseModule(container.Version).ExportYAML(container));
            node.Add(SizeBySpeedModuleName, SizeBySpeedModule.ExportYAML(container));
            node.Add(RotationBySpeedModuleName, RotationBySpeedModule.ExportYAML(container));
            node.Add(ColorBySpeedModuleName, ColorBySpeedModule.ExportYAML(container));
            node.Add(CollisionModuleName, CollisionModule.ExportYAML(container));
            node.Add(TriggerModuleName, GetTriggerModule(container.Version).ExportYAML(container));
            node.Add(SubModuleName, SubModule.ExportYAML(container));
            node.Add(LightsModuleName, GetLightsModule(container.Version).ExportYAML(container));
            node.Add(TrailModuleName, GetTrailModule(container.Version).ExportYAML(container));
            node.Add(CustomDataModuleName, GetCustomDataModule(container.Version).ExportYAML(container));
            return(node);
        }
Example #17
0
        protected override YAMLMappingNode ExportYAMLRoot(IExportContainer container)
        {
            YAMLMappingNode node = base.ExportYAMLRoot(container);

            node.AddSerializedVersion(GetSerializedVersion(container.Version));
            node.Add("lengthInSec", LengthInSec);
            node.Add("simulationSpeed", SimulationSpeed);
            node.Add("stopAction", StopAction);
            node.Add("looping", Looping);
            node.Add("prewarm", Prewarm);
            node.Add("playOnAwake", PlayOnAwake);
            node.Add("useUnscaledTime", UseUnscaledTime);
            node.Add("autoRandomSeed", GetAutoRandomSeed(container.Version));
            node.Add("useRigidbodyForVelocity", GetUseRigidbodyForVelocity(container.Version));
            node.Add("startDelay", GetStartDelay(container.Version).ExportYAML(container));
            node.Add("moveWithTransform", (int)MoveWithTransform);
            node.Add("moveWithCustomTransform", MoveWithCustomTransform.ExportYAML(container));
            node.Add("scalingMode", (int)GetScalingMode(container.Version));
            node.Add("randomSeed", RandomSeed);
            node.Add("InitialModule", InitialModule.ExportYAML(container));
            node.Add("ShapeModule", ShapeModule.ExportYAML(container));
            node.Add("EmissionModule", EmissionModule.ExportYAML(container));
            node.Add("SizeModule", SizeModule.ExportYAML(container));
            node.Add("RotationModule", RotationModule.ExportYAML(container));
            node.Add("ColorModule", ColorModule.ExportYAML(container));
            node.Add("UVModule", UVModule.ExportYAML(container));
            node.Add("VelocityModule", VelocityModule.ExportYAML(container));
            node.Add("InheritVelocityModule", GetInheritVelocityModule(container.Version).ExportYAML(container));
            node.Add("ForceModule", ForceModule.ExportYAML(container));
            node.Add("ExternalForcesModule", GetExternalForcesModule(container.Version).ExportYAML(container));
            node.Add("ClampVelocityModule", ClampVelocityModule.ExportYAML(container));
            node.Add("NoiseModule", GetNoiseModule(container.Version).ExportYAML(container));
            node.Add("SizeBySpeedModule", SizeBySpeedModule.ExportYAML(container));
            node.Add("RotationBySpeedModule", RotationBySpeedModule.ExportYAML(container));
            node.Add("ColorBySpeedModule", ColorBySpeedModule.ExportYAML(container));
            node.Add("CollisionModule", CollisionModule.ExportYAML(container));
            node.Add("TriggerModule", GetTriggerModule(container.Version).ExportYAML(container));
            node.Add("SubModule", SubModule.ExportYAML(container));
            node.Add("LightsModule", GetLightsModule(container.Version).ExportYAML(container));
            node.Add("TrailModule", GetTrailModule(container.Version).ExportYAML(container));
            node.Add("CustomDataModule", GetCustomDataModule(container.Version).ExportYAML(container));
            return(node);
        }
Example #18
0
        protected override YAMLMappingNode ExportYAMLRoot(IAssetsExporter exporter)
        {
#warning TODO: values acording to read version (current 2017.3.0f3)
            YAMLMappingNode node = base.ExportYAMLRoot(exporter);
            node.AddSerializedVersion(GetSerializedVersion(exporter.Version));
            node.Add("lengthInSec", LengthInSec);
            node.Add("simulationSpeed", SimulationSpeed);
            node.Add("stopAction", StopAction);
            node.Add("looping", Looping);
            node.Add("prewarm", Prewarm);
            node.Add("playOnAwake", PlayOnAwake);
            node.Add("useUnscaledTime", UseUnscaledTime);
            node.Add("autoRandomSeed", AutoRandomSeed);
            node.Add("useRigidbodyForVelocity", UseRigidbodyForVelocity);
            node.Add("startDelay", StartDelay.ExportYAML(exporter));
            node.Add("moveWithTransform", MoveWithTransform);
            node.Add("moveWithCustomTransform", MoveWithCustomTransform.ExportYAML(exporter));
            node.Add("scalingMode", ScalingMode);
            node.Add("randomSeed", RandomSeed);
            node.Add("InitialModule", InitialModule.ExportYAML(exporter));
            node.Add("ShapeModule", ShapeModule.ExportYAML(exporter));
            node.Add("EmissionModule", EmissionModule.ExportYAML(exporter));
            node.Add("SizeModule", SizeModule.ExportYAML(exporter));
            node.Add("RotationModule", RotationModule.ExportYAML(exporter));
            node.Add("ColorModule", ColorModule.ExportYAML(exporter));
            node.Add("UVModule", UVModule.ExportYAML(exporter));
            node.Add("VelocityModule", VelocityModule.ExportYAML(exporter));
            node.Add("InheritVelocityModule", InheritVelocityModule.ExportYAML(exporter));
            node.Add("ForceModule", ForceModule.ExportYAML(exporter));
            node.Add("ExternalForcesModule", ExternalForcesModule.ExportYAML(exporter));
            node.Add("ClampVelocityModule", ClampVelocityModule.ExportYAML(exporter));
            node.Add("NoiseModule", NoiseModule.ExportYAML(exporter));
            node.Add("SizeBySpeedModule", SizeBySpeedModule.ExportYAML(exporter));
            node.Add("RotationBySpeedModule", RotationBySpeedModule.ExportYAML(exporter));
            node.Add("ColorBySpeedModule", ColorBySpeedModule.ExportYAML(exporter));
            node.Add("CollisionModule", CollisionModule.ExportYAML(exporter));
            node.Add("TriggerModule", TriggerModule.ExportYAML(exporter));
            node.Add("SubModule", SubModule.ExportYAML(exporter));
            node.Add("LightsModule", LightsModule.ExportYAML(exporter));
            node.Add("TrailModule", TrailModule.ExportYAML(exporter));
            node.Add("CustomDataModule", CustomDataModule.ExportYAML(exporter));
            return(node);
        }
Example #19
0
        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            LengthInSec = reader.ReadSingle();
            if (IsStartDelayFirst(reader.Version))
            {
                if (HasStartDelaySingle(reader.Version))
                {
                    StartDelaySingle = reader.ReadSingle();
                }
                else
                {
                    StartDelay.Read(reader);
                }
            }

            SimulationSpeed = reader.ReadSingle();
            if (HasStopAction(reader.Version))
            {
                StopAction = (ParticleSystemStopAction)reader.ReadInt32();
            }

            if (IsRandomSeedFirst(reader.Version))
            {
                RandomSeed = unchecked ((int)reader.ReadUInt32());
            }

            if (HasCullingMode(reader.Version))
            {
                CullingMode    = (ParticleSystemCullingMode)reader.ReadInt32();
                RingBufferMode = (ParticleSystemRingBufferMode)reader.ReadInt32();
                RingBufferLoopRange.Read(reader);
            }

            Looping     = reader.ReadBoolean();
            Prewarm     = reader.ReadBoolean();
            PlayOnAwake = reader.ReadBoolean();
            if (HasUseUnscaledTime(reader.Version))
            {
                UseUnscaledTime = reader.ReadBoolean();
            }
            if (IsMoveWithTransformBool(reader.Version))
            {
                MoveWithTransform = reader.ReadBoolean() ? ParticleSystemSimulationSpace.Local : ParticleSystemSimulationSpace.World;
            }
            if (HasAutoRandomSeed(reader.Version))
            {
                AutoRandomSeed = reader.ReadBoolean();
            }
            if (HasUseRigidbodyForVelocity(reader.Version))
            {
                UseRigidbodyForVelocity = reader.ReadBoolean();
            }
            if (IsAlign(reader.Version))
            {
                reader.AlignStream();
            }

            if (!IsStartDelayFirst(reader.Version))
            {
                StartDelay.Read(reader);
                reader.AlignStream();
            }
            if (!IsMoveWithTransformBool(reader.Version))
            {
                MoveWithTransform = (ParticleSystemSimulationSpace)reader.ReadInt32();
                reader.AlignStream();
            }

            if (HasMoveWithCustomTransform(reader.Version))
            {
                MoveWithCustomTransform.Read(reader);
            }
            if (HasScalingMode(reader.Version))
            {
                ScalingMode = (ParticleSystemScalingMode)reader.ReadInt32();
            }
            if (!IsRandomSeedFirst(reader.Version))
            {
                RandomSeed = reader.ReadInt32();
            }

            InitialModule.Read(reader);
            ShapeModule.Read(reader);
            EmissionModule.Read(reader);
            SizeModule.Read(reader);
            RotationModule.Read(reader);
            ColorModule.Read(reader);
            UVModule.Read(reader);
            VelocityModule.Read(reader);
            if (HasInheritVelocityModule(reader.Version))
            {
                InheritVelocityModule.Read(reader);
            }
            ForceModule.Read(reader);
            if (HasExternalForcesModule(reader.Version))
            {
                ExternalForcesModule.Read(reader);
            }
            ClampVelocityModule.Read(reader);
            if (HasNoiseModule(reader.Version))
            {
                NoiseModule.Read(reader);
            }
            SizeBySpeedModule.Read(reader);
            RotationBySpeedModule.Read(reader);
            ColorBySpeedModule.Read(reader);
            CollisionModule.Read(reader);
            if (HasTriggerModule(reader.Version))
            {
                TriggerModule.Read(reader);
            }
            SubModule.Read(reader);
            if (HasLightsModule(reader.Version))
            {
                LightsModule.Read(reader);
                TrailModule.Read(reader);
            }
            if (HasCustomDataModule(reader.Version))
            {
                CustomDataModule.Read(reader);
            }
        }
Example #20
0
    public void DisableAll()
    {
        EmissionModule mod = gameObject.GetComponent <ParticleSystem>().emission;

        mod.enabled = false;
    }
Example #21
0
    // Update is called once per frame
    void Update()
    {
        if (activated)
        {
            EmissionModule mod = gameObject.GetComponent <ParticleSystem>().emission;
            mod.enabled = true;
            if (target == null)
            {
                chain1p.GetComponent <Chain>().activated = false;
                chain1p.GetComponent <Chain>().target    = null;
                chain2p.GetComponent <Chain>().activated = false;
                chain2p.GetComponent <Chain>().target    = null;
            }
            else
            {
                Spawning arenaFloor = GameObject.Find("Terrain").GetComponent <Spawning>();
                Vector3  p0         = gameObject.transform.position;
                Vector3  p1         = p0 + (gameObject.transform.rotation * Vector3.forward).normalized * 2;
                Vector3  p2         = p1;
                Vector3  p3         = new Vector3(target.transform.position.x + Random.Range(-0.1f, 0.1f), target.transform.position.y + 1 + Random.Range(-0.2f, 0.2f), target.transform.position.z + Random.Range(-0.1f, 0.1f));

                a0        = p0;
                a1        = p1;
                a2        = p2;
                a3        = p3;
                particles = new Particle[ps.particleCount];

                ps.GetParticles(particles);
                for (int i = 0; i < particles.Length; i++)
                {
                    float t = 1 - particles[i].remainingLifetime / particles[i].startLifetime;
                    particles[i].position = Mathf.Pow(1 - t, 3) * p0 + 3 * Mathf.Pow(1 - t, 2) * t * p1 + 3 * (1 - t) * t * t * p2 + Mathf.Pow(t, 3) * p3;
                    //particles[i].position = Vector3.Lerp(p0, p3, 1 - particles[i].remainingLifetime / particles[i].startLifetime);
                }

                ps.SetParticles(particles);

                List <GameObject> enemies    = arenaFloor.enemiesList;
                List <GameObject> acceptable = new List <GameObject>();
                for (int i = 0; i < enemies.Count; i++)
                {
                    if ((enemies[i].transform.position - target.transform.position).magnitude <= 4)
                    {
                        acceptable.Add(enemies[i]);
                    }
                }
                if (acceptable.Count >= 1)
                {
                    GameObject closest  = null;
                    GameObject closest2 = null;
                    for (int i = 0; i < acceptable.Count; i++)
                    {
                        if (ReferenceEquals(acceptable[i], target))
                        {
                            continue;
                        }
                        if (closest == null)
                        {
                            closest = acceptable[i];
                            continue;
                        }
                        if ((acceptable[i].transform.position - target.transform.position).magnitude < (closest.transform.position - target.transform.position).magnitude)
                        {
                            closest2 = closest;
                            closest  = acceptable[i];
                        }
                    }
                    closest1o = closest;
                    closest2o = closest2;
                    if (closest != null)
                    {
                        chain1p.GetComponent <Chain>().activated = true;
                        chain1.transform.position = target.transform.Find("cmass").transform.position;

                        chain1p.GetComponent <Chain>().target = closest.transform.Find("cmass").gameObject;
                        chain1.transform.rotation             = Quaternion.FromToRotation(Vector3.forward, chain1p.GetComponent <Chain>().target.transform.position - target.transform.Find("cmass").position);
                        closest.GetComponent <AIController>().Damage(Time.deltaTime * 0.5f);
                    }
                    else
                    {
                        chain1p.GetComponent <Chain>().activated = false;
                        chain1p.GetComponent <Chain>().target    = null;
                    }
                    if (closest2 != null)
                    {
                        chain2p.GetComponent <Chain>().activated = true;
                        chain2.transform.position = target.transform.Find("cmass").transform.position;

                        chain2p.GetComponent <Chain>().target = closest2.transform.Find("cmass").gameObject;
                        chain2.transform.rotation             = Quaternion.FromToRotation(Vector3.forward, chain2p.GetComponent <Chain>().target.transform.position - target.transform.Find("cmass").position);
                        closest2.GetComponent <AIController>().Damage(Time.deltaTime * 0.5f);
                    }
                    else
                    {
                        chain2p.GetComponent <Chain>().activated = false;
                        chain2p.GetComponent <Chain>().target    = null;
                    }
                }
                else if (enemies.Count == 0)
                {
                    chain1p.GetComponent <Chain>().activated = false;
                    chain2p.GetComponent <Chain>().activated = false;
                }
            }
        }
        else
        {
            EmissionModule mod = gameObject.GetComponent <ParticleSystem>().emission;
            mod.enabled = true;
            chain1p.GetComponent <Chain>().activated = false;
            chain1p.GetComponent <Chain>().target    = null;
            chain2p.GetComponent <Chain>().activated = false;
            chain2p.GetComponent <Chain>().target    = null;
        }
    }
Example #22
0
        public override void Read(AssetStream stream)
        {
            base.Read(stream);

            LengthInSec = stream.ReadSingle();
            if (IsStartDelayFirst(stream.Version))
            {
                if (IsReadStartDelaySingle(stream.Version))
                {
                    StartDelaySingle = stream.ReadSingle();
                }
                else
                {
                    StartDelay.Read(stream);
                }
            }

            SimulationSpeed = stream.ReadSingle();
            if (IsReadStopAction(stream.Version))
            {
                StopAction = stream.ReadInt32();
            }

            if (IsRandomSeedFirst(stream.Version))
            {
                RandomSeed = unchecked ((int)stream.ReadUInt32());
            }

            Looping     = stream.ReadBoolean();
            Prewarm     = stream.ReadBoolean();
            PlayOnAwake = stream.ReadBoolean();
            if (IsReadUseUnscaledTime(stream.Version))
            {
                UseUnscaledTime = stream.ReadBoolean();
            }
            if (IsMoveWithTransformBool(stream.Version))
            {
                MoveWithTransform = stream.ReadBoolean() ? 1 : 0;
            }
            if (IsReadAutoRandomSeed(stream.Version))
            {
                AutoRandomSeed = stream.ReadBoolean();
            }
            if (IsReadUseRigidbodyForVelocity(stream.Version))
            {
                UseRigidbodyForVelocity = stream.ReadBoolean();
            }
            if (IsAlign(stream.Version))
            {
                stream.AlignStream(AlignType.Align4);
            }

            if (!IsStartDelayFirst(stream.Version))
            {
                StartDelay.Read(stream);
                stream.AlignStream(AlignType.Align4);
            }
            if (!IsMoveWithTransformBool(stream.Version))
            {
                MoveWithTransform = stream.ReadInt32();
                stream.AlignStream(AlignType.Align4);
            }

            if (IsReadMoveWithCustomTransform(stream.Version))
            {
                MoveWithCustomTransform.Read(stream);
            }
            if (IsReadScalingMode(stream.Version))
            {
                ScalingMode = stream.ReadInt32();
            }
            if (!IsRandomSeedFirst(stream.Version))
            {
                RandomSeed = stream.ReadInt32();
            }

            InitialModule.Read(stream);
            ShapeModule.Read(stream);
            EmissionModule.Read(stream);
            SizeModule.Read(stream);
            RotationModule.Read(stream);
            ColorModule.Read(stream);
            UVModule.Read(stream);
            VelocityModule.Read(stream);
            if (IsReadInheritVelocityModule(stream.Version))
            {
                InheritVelocityModule.Read(stream);
            }
            ForceModule.Read(stream);
            if (IsReadExternalForcesModule(stream.Version))
            {
                ExternalForcesModule.Read(stream);
            }
            ClampVelocityModule.Read(stream);
            if (IsReadNoiseModule(stream.Version))
            {
                NoiseModule.Read(stream);
            }
            SizeBySpeedModule.Read(stream);
            RotationBySpeedModule.Read(stream);
            ColorBySpeedModule.Read(stream);
            CollisionModule.Read(stream);
            if (IsReadTriggerModule(stream.Version))
            {
                TriggerModule.Read(stream);
            }
            SubModule.Read(stream);
            if (IsReadLightsModule(stream.Version))
            {
                LightsModule.Read(stream);
                TrailModule.Read(stream);
            }
            if (IsReadCustomDataModule(stream.Version))
            {
                CustomDataModule.Read(stream);
            }
        }
Example #23
0
            }                                                                                                   // 0x0000000180AF1D60-0x0000000180AF1DB0

            private static void set_rateOverTime_Injected(ref EmissionModule _unity_self, ref MinMaxCurve value)
            {
            }                                                                                                                   // 0x0000000180AF1DB0-0x0000000180AF1E50
Example #24
0
            }             // 0x000000018000A570-0x000000018000A580

            // Methods
            private static void set_enabled_Injected(ref EmissionModule _unity_self, bool value)
            {
            }                                                                                                   // 0x0000000180AF1D60-0x0000000180AF1DB0
 void Start()
 {
     _emisModule  = _fireParticles.emission;
     _mainModule  = _fireParticles.main;
     _shapeModule = _fireParticles.shape;
 }
Example #26
0
    private void SetEmission(EmissionModule emModule)
    {
        Burst burst = emModule.GetBurst(0);

        OriginalEmits.Add(burst);
    }