public override void Process(PlayFMODCustomEmitter packet)
    {
        GameObject            soundSource           = NitroxEntity.RequireObjectFrom(packet.Id);
        FMODEmitterController fmodEmitterController = soundSource.RequireComponent <FMODEmitterController>();

        using (packetSender.Suppress <PlayFMODCustomEmitter>())
            using (packetSender.Suppress <PlayFMODCustomLoopingEmitter>())
            {
                if (packet.Play)
                {
                    fmodEmitterController.PlayCustomEmitter(packet.AssetPath);
                }
                else
                {
                    fmodEmitterController.StopCustomEmitter(packet.AssetPath);
                }
            }
    }
Ejemplo n.º 2
0
        public override void Process(PlayFMODCustomEmitter packet)
        {
            Optional <GameObject> soundSource = NitroxEntity.GetObjectFrom(packet.Id);

            Validate.IsPresent(soundSource);

            FMODEmitterController fmodEmitterController = soundSource.Value.GetComponent <FMODEmitterController>();

            Validate.IsTrue(fmodEmitterController);

            using (packetSender.Suppress <PlayFMODCustomEmitter>())
            {
                if (packet.Play)
                {
                    fmodEmitterController.PlayCustomEmitter(packet.AssetPath);
                }
                else
                {
                    fmodEmitterController.StopCustomEmitter(packet.AssetPath);
                }
            }
        }