コード例 #1
0
    void Awake()
    {
        if (m_instance == null)
        {
            m_instance = this;
        }
        else
        {
            if (m_instance != this)
            {
                Destroy(gameObject);
            }
        }

        SpawnCharacter();
    }
コード例 #2
0
 void OnDestroy()
 {
     m_instance = null;
 }