Ejemplo n.º 1
0
        public void StopSound(NodeRemoveEvent evt, TankActiveNode tank, [JoinByTank] RailgunSoundEffectReadyNode weapon)
        {
            AudioSource audioSurce = weapon.railgunShotEffect.AudioSurce;

            if (audioSurce.isPlaying)
            {
                audioSurce.Stop();
            }
        }
Ejemplo n.º 2
0
        private void StartRailgunChargingByBaseEvent(BaseRailgunChargingShotEvent evt, RailgunChargingNode muzzle, TankActiveNode tank)
        {
            RailgunChargingWeaponComponent railgunChargingWeapon = muzzle.railgunChargingWeapon;
            GetInstanceFromPoolEvent       eventInstance         = new GetInstanceFromPoolEvent {
                Prefab          = muzzle.railgunChargingEffect.Prefab,
                AutoRecycleTime = railgunChargingWeapon.ChargingTime
            };

            base.ScheduleEvent(eventInstance, muzzle);
            Transform  instance   = eventInstance.Instance;
            GameObject gameObject = instance.gameObject;

            CustomRenderQueue.SetQueue(gameObject, 0xc4e);
            ParticleSystem component = gameObject.GetComponent <ParticleSystem>();

            component.main.startLifetime = railgunChargingWeapon.ChargingTime;
            component.emission.enabled   = true;
            UnityUtil.InheritAndEmplace(instance, muzzle.muzzlePoint.Current);
            gameObject.SetActive(true);
            base.CreateEntity("railgun_charging").AddComponent(new TankGroupComponent(tank.Entity));
        }
Ejemplo n.º 3
0
 public void StartRailgunCharging(SelfRailgunChargingShotEvent evt, RailgunChargingNode muzzle, [JoinBy(typeof(TankGroupComponent))] TankActiveNode tank)
 {
     this.StartRailgunChargingByBaseEvent(evt, muzzle, tank);
 }
Ejemplo n.º 4
0
 public void PlayShotEffect(BaseRailgunChargingShotEvent evt, RailgunSoundEffectReadyNode weapon, [JoinByTank] TankActiveNode tank)
 {
     weapon.railgunShotEffect.AudioSurce.Play();
 }