Помогите со скриптом пожалуйста.
Добавлено: 03 сен 2018, 12:23
Добрый день. Есть меню из нескольких сцен и GameObg с музыкой и скриптом
Как дописать этот скрипт, что бы этот GO с музыкой убивался при переходе на определённые сцены (в игровых левелах другая музыка)?
Синтаксис:
Используется csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MenuMusicController : MonoBehaviour {
public static MenuMusicController Instance;
void Awake()
{
this.InstantiateController();
}
private void InstantiateController()
{
if (Instance == null)
{
Instance = this;
DontDestroyOnLoad(this);
}
else if (this != Instance)
{
Destroy(this.gameObject);
}
}
}
}
using System.Collections.Generic;
using UnityEngine;
public class MenuMusicController : MonoBehaviour {
public static MenuMusicController Instance;
void Awake()
{
this.InstantiateController();
}
private void InstantiateController()
{
if (Instance == null)
{
Instance = this;
DontDestroyOnLoad(this);
}
else if (this != Instance)
{
Destroy(this.gameObject);
}
}
}
}
Как дописать этот скрипт, что бы этот GO с музыкой убивался при переходе на определённые сцены (в игровых левелах другая музыка)?