Пример #1
0
    // Use this for initialization
    void Start()
    {
        isgetclue    = false;
        factclue     = "";
        Memberbutton = Member.GetComponent <Button> ();

        mname = "衡琳";
        PlayerPrefs.SetString("membername", mname);
        d     = GameObject.Find("Dialog");
        other = (Dialogtext)d.GetComponent(typeof(Dialogtext));
        other.getText(mname);
        show();

        List <string> btnsName = new List <string>();

        btnsName.Add("Dialogbox");

        foreach (string btnName in btnsName)
        {
            GameObject btnObj = GameObject.Find(btnName);
            Button     btn    = btnObj.GetComponent <Button>();
            btn.onClick.AddListener(delegate() {
                this.OnClick(btnObj);
            });
        }
    }
    //获取当前用户选取的人物对话剧本
    public void getText(string memberName)      //musicName不带后缀
    //读取文件
    {
        Dialogtext.GetInstance().memberName = memberName;
        string memberPath = Path.Combine("Member", memberName);

        Dialogtext.GetInstance().chattext = new Chattext(memberPath);

        string cluePath = Path.Combine("Clue", memberName);

        Dialogtext.GetInstance().clueIntroduction = new ClueIntroduction(cluePath);
    }
 public static Dialogtext GetInstance()
 {
     if (!instance)
     {
         instance = (Dialogtext)GameObject.FindObjectOfType(typeof(Dialogtext));
         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()
    {
        clueText = Dialogtext.GetInstance();

        Content.text = "";

        ShowClue.transform.Translate(tPosition);

        Button finishone = (Button)ShowButton.GetComponent <Button>();

        finishone.onClick.AddListener(ShowButtonDown);

        flag = false;
    }
Пример #5
0
 void Start()
 {
     d    = Dialogtext.GetInstance();
     data = ClueData.getInstance();
 }