void Awake()
    {
        Sd = Dialogstart.GetInstance();
        Button btn = GameObject.Find("okButton").GetComponent <Button> ();

        btn.onClick.AddListener(OnClick);
    }
    //获取当前用户选取的人物对话剧本
    public void getText(string memberName)      //musicName不带后缀
    //读取文件
    {
        Dialogstart.GetInstance().memberName = memberName;
        string memberPath = Path.Combine("Member", memberName);

        Dialogstart.GetInstance().schattext = new SChattext(memberPath);
    }
 public static Dialogstart GetInstance()
 {
     if (!instance)
     {
         instance = (Dialogstart)GameObject.FindObjectOfType(typeof(Dialogstart));
         if (!instance)
         {
             Debug.LogError("There needs to be one active Music class script on a GameObject in your scene.");
         }
     }
     return(instance);
 }
    // Use this for initialization
    void Start()
    {
        List <string> btnsName = new List <string>();

        btnsName.Add("Dialogstartbox");

        foreach (string btnName in btnsName)
        {
            GameObject btnObj = GameObject.Find(btnName);
            Button     btn    = btnObj.GetComponent <Button>();
            btn.onClick.AddListener(delegate() {
                this.OnClick(btnObj);
            });
        }

        Sd           = Dialogstart.GetInstance();
        Memberbutton = Dialogstartbox.GetComponent <Button> ();

        Playerstart.SetActive(false);
        Dialogstartbox.SetActive(false);
        isnameing = false;
    }