Beispiel #1
0
    /// <summary>
    /// ランダムな 10 文字の文字列を生成し、保存する
    /// </summary>
    public void SetRandomName()
    {
        // ランダムな 10 文字の文字列を生成する
        string random = System.Guid.NewGuid().ToString("N").Substring(0, 10).ToUpper();

        singleton.Name = random;
        Debug.Log(singleton.ToString());
    }
Beispiel #2
0
    void Start()
    {
        singleton = GameObject.FindObjectOfType <SingletonPattern01>();

        if (singleton)
        {
            Debug.Log(singleton.ToString());
        }
        else
        {
            Debug.LogError("オブジェクトが見つかりませんでした");
        }
    }