Beispiel #1
0
 public void StopFX()
 {
     if (fxControl != null)
     {
         print("PrefabTest: FX stopped");
         fxControl.Stop();
         return;
     }
 }
Beispiel #2
0
 public void Init(Skill skill)
 {
     this.skill = skill;
     if (prefabBeginParticle != null)
     {
         skill.eBegin.AddListener(CreateBeginParticle);
         skill.eEnd.AddListener(() =>
         {
             beginParticle.Stop();
             beginParticle = null;
         });
     }
 }
        private void Update()
        {
            if (_mono == null || !_mono.IsConstructed || !_mono.IsInitialized)
            {
                return;
            }


            if (PowerAvaliable)
            {
                //Handle Spray Firing
                _sprayTime -= DayNightCycle.main.deltaTime;
                if (_sprayTime < 0)
                {
                    if (_mono.HydroHarvGrowBed.GetBedType() == FCSEnvironment.Air)
                    {
                        FireSpray();
                        _sprayTime = SprayTimeDefault;
                    }
                }

                if (_fireVapor)
                {
                    _timeLeft -= DayNightCycle.main.deltaTime;
                    if (_timeLeft < 0)
                    {
                        _vaporFX.Stop(0);
                        _fireVapor = false;
                        _timeLeft  = 1f;
                    }
                }

                //Handle Bubbles
                if (_mono.HydroHarvGrowBed.GetBedType() == FCSEnvironment.Water)
                {
                    ShowBubbles();
                }
                else
                {
                    HideBubbles();
                }
            }
            else
            {
                //HandleBubbles
                HideBubbles();
            }
        }
Beispiel #4
0
        private void StopEffects()
        {
            if (drillFXinstance != null)
            {
                VFXLateTimeParticles component = drillFXinstance.GetComponent <VFXLateTimeParticles>();
                component.Stop();
                Destroy(drillFXinstance.gameObject, 1.6f);
                drillFXinstance = null;
            }

            if (fxControl.emitters[0].fxPS != null && fxControl.emitters[0].fxPS.emission.enabled)
            {
                fxControl.Stop(0);
            }
            loop.Stop();
            loopHit.Stop();
        }
Beispiel #5
0
        public bool OnShoot()
        {
            if (TargetObject != null)
            {
                Utils.PlayFMODAsset(shootSound, transform, 20f);

                energyInterface.GetValues(out float charge, out float capacity);

                float d = Mathf.Min(1f, charge / 4f);

                energyInterface.ConsumeEnergy(4f);

                fxControl.Play(0);
                fxControl.Play();

                if (TargetObject.TryGetComponent(out CreatureFrozenMixin creatureFrozenMixin))
                {
                    creatureFrozenMixin.FreezeInsideIce();
                    creatureFrozenMixin.FreezeForTime(20);
                }
                else if (TargetObject.TryGetComponent(out FreezeCannonFrozenMixin freezeCannonFrozenMixin))
                {
                    freezeCannonFrozenMixin.FreezeInsideIce();
                    freezeCannonFrozenMixin.FreezeForTime(20);
                }
                else
                {
                    FreezeCannonFrozenMixin component = TargetObject.AddComponent <FreezeCannonFrozenMixin>();

                    component.FreezeInsideIce();
                    component.FreezeForTime(20);
                }

                ReleaseTargetObject();

                fxControl.Stop();

                return(true);
            }
            else
            {
                TargetObject = TraceForTarget();

                return(false);
            }
        }