mirror of
https://github.com/Memorix101/UnityXNA/
synced 2024-12-30 15:25:35 +01:00
37 lines
740 B
C#
37 lines
740 B
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
namespace Microsoft.Xna.Framework.Media
|
|||
|
{
|
|||
|
public static class MediaPlayer
|
|||
|
{
|
|||
|
private static AudioSource audioSource;
|
|||
|
|
|||
|
public static AudioSource AudioSource
|
|||
|
{
|
|||
|
set { MediaPlayer.audioSource = value; }
|
|||
|
}
|
|||
|
|
|||
|
public static bool IsRepeating
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
return audioSource.loop;
|
|||
|
}
|
|||
|
set
|
|||
|
{
|
|||
|
audioSource.loop = value;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
internal static void Play(Song song)
|
|||
|
{
|
|||
|
audioSource.clip = song.Clip;
|
|||
|
audioSource.Play();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|