using UnityEngine;
using System.Collections;
//单例示例
public class AManager : MonoBehaviour
{
private static AManager instance = null;
public static AManager Instance
{
get
{
if (instance == null)
{
GameObject go = new GameObject("AManager");
DontDestroyOnLoad(go);
instance = go.AddComponent<AManager>();
}
return instance;
}
}
public void PrintA()
{
Debug.Log("A");
}
}