コード例 #1
0
 private static void PlaySound(rymFX fx, rymFXSoundInfo info)
 {
     //IL_0018: Unknown result type (might be due to invalid IL or missing references)
     //IL_0074: Unknown result type (might be due to invalid IL or missing references)
     //IL_0079: Expected O, but got Unknown
     if (fx.get_enabled() && (!info.loop || !(info.audio_source != null)) && !string.IsNullOrEmpty(info.clip_name))
     {
         ResourceLink component = fx.GetComponent <ResourceLink>();
         if (component != null)
         {
             string    fileNameWithoutExtension = Path.GetFileNameWithoutExtension(info.clip_name);
             AudioClip val = component.Get <AudioClip>(fileNameWithoutExtension);
             if (val != null)
             {
                 AudioObject audioObject = SoundManager.PlaySE(val, info.loop, fx.get__transform());
                 if (audioObject != null && info.loop)
                 {
                     EffectInfoComponent component2 = fx.GetComponent <EffectInfoComponent>();
                     if (component2 != null)
                     {
                         component2.SetLoopAudioObject(audioObject);
                     }
                 }
             }
             else
             {
                 Log.Error(LOG.RESOURCE, "{0} is not found. ({1})", fileNameWithoutExtension, fx.get_name());
             }
         }
     }
 }
コード例 #2
0
    private Texture GetTexture(string name)
    {
        ResourceLink component = fx.GetComponent <ResourceLink>();

        if (component != null)
        {
            string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(name);
            if (!string.IsNullOrEmpty(fileNameWithoutExtension))
            {
                return(component.Get <Texture>(fileNameWithoutExtension));
            }
        }
        return(null);
    }