浏览代码

working

/hh-develop-fps_game_project
HH 4 年前
当前提交
75c2bb83
共有 2 个文件被更改,包括 22 次插入7 次删除
  1. 15
      Project/Assets/ML-Agents/Examples/FPS_Game/Scenes/FPS_Game.unity
  2. 14
      Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/PlayBackgroundAudio.cs

15
Project/Assets/ML-Agents/Examples/FPS_Game/Scenes/FPS_Game.unity


m_Component:
- component: {fileID: 134432280}
- component: {fileID: 134432281}
- component: {fileID: 134432282}
m_Layer: 0
m_Name: Music
m_TagString: Untagged

m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!114 &134432282
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 134432279}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: acf18f73005f24559bad430f9e4a9ca8, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &135646763
GameObject:
m_ObjectHideFlags: 0

BlueSpawn: {fileID: 1669694872}
PurpleSpawn: {fileID: 247758844}
SpawnPlayer: 0
SpawnBaddies: 0
SpawnBaddies: 1
PlayerPrefab: {fileID: 7796409947774005658, guid: a0e7db83e097b4a3e96a89b390d1ebed,
type: 3}
AIPrefab: {fileID: 3775793887401821308, guid: 6a2f6d60e715b493dad52cc5c9fd1e71,

14
Project/Assets/ML-Agents/Examples/FPS_Game/Scripts/PlayBackgroundAudio.cs


public class PlayBackgroundAudio : MonoBehaviour
{
public AudioClip BackgroundSong;
// public AudioClip BackgroundSong;
DontDestroyOnLoad(gameObject);
if (m_AudioSource == null)
{
m_AudioSource = GetComponent<AudioSource>();

void Start()
{
if (BackgroundSong)
{
m_AudioSource.clip = BackgroundSong;
m_AudioSource.Play();
}
// if (BackgroundSong)
// {
// m_AudioSource.clip = BackgroundSong;
m_AudioSource.Play();
// }
}
// Update is called once per frame

正在加载...
取消
保存