コード例 #1
0
ファイル: MunchFX.cs プロジェクト: Orange-Panda/MrMunch
    /// <summary>
    /// Plays the particle system with the given mesh and material data
    /// </summary>
    /// <remarks>
    /// Particle system works like an audio One-shot
    /// </remarks>
    /// <param name="type">Object type</param>
    public void PlayMunchParticles(MunchType type)
    {
        _renderer.mesh     = type.ParticleMesh;
        _renderer.material = type.ParticleMaterial;

        _system.Play();
    }
コード例 #2
0
 /// <summary>
 /// Play a one-shot of the object type's munch sound clip
 /// </summary>
 /// <param name="type">Object type</param>
 public void PlayMunchSound(MunchType type)
 {
     if (type != null)
     {
         _mouthSource.PlayOneShot(type.Clip);
     }
 }