コード例 #1
0
        private List <string[]> ReceivedDanmakuList(string str_CommentText)
        {
            List <string[]> listStringArray = new List <string[]>();

            string[] str_temp = { str_CommentText, "chinese" };

            string[] str_line;
            if ((str_temp[0].Length > 3 && str_temp[0].Substring(0, 3) == "计算 "))
            {
                string[] str_result = { "", "" };
                try
                {
                    MathCalculate sosoMath      = new MathCalculate();
                    char[]        char_splitter = { ' ', };
                    str_line = str_temp[0].Split(char_splitter, 2);
                    string str_math = sosoMath.MathCalculator(str_line[1]).ToString();
                    str_result[0] = "计算的结果是" + str_math + ",还不快谢谢我";
                    str_result[1] = "chinese";
                    Log(str_result[0]);
                    AddDM(str_result[0]);
                }
                catch
                {
                    str_result[0] = "计算错误啦,谷歌娘不认识那么复杂的东西";
                    str_result[1] = "chinese";
                }
                listStringArray.Add(str_result);
            }
            else
            {
                if (str_temp[0].Length > 3 && str_temp[0].Substring(0, 3) == "点歌 ")
                {
                    char[] char_splitter = { ' ', };
                    str_line = str_CommentText.Split(char_splitter, 2);
                }
                else
                {
                    char[] char_splitter = { ',', ',', '。', ';', ';', '?', '!', '?', '!' };
                    str_line = str_CommentText.Split(char_splitter);
                }
                foreach (string str in str_line)
                {
                    listStringArray.Add(StrG_LanguageMatch(RegexMatch(str)));
                }
            }
            return(listStringArray);
        }
コード例 #2
0
 public void selectLength()
 {
     //operationMenu.SetActive(false);
     //cancelButton.SetActive(false);
     //infoMenu.SetActive(true);
     if (GlobalData.selectedLine.Count != 1)
     {
         //GameObject.Find("Canvas/InfoMenu/InfoText").GetComponent<Text>().text = "You must select a line before calculate its length.";
         character.GetComponentInChildren <charEvent>().speakSomething("请先选择直线");
     }
     else
     {
         Vector3[] line = GlobalData.selectedLine[0];
         float     len  = MathCalculate.segmentLength(line);
         //GameObject.Find("Canvas/InfoMenu/InfoText").GetComponent<Text>().text = "Length of selected line is " + len.ToString() + ".";
         character.GetComponentInChildren <charEvent>().speakSomething("直线长度为\n" + len.ToString());
     }
 }
コード例 #3
0
    public void selectPPAngle()
    {
        //operationMenu.SetActive(false);
        //cancelButton.SetActive(false);
        //infoMenu.SetActive(true);
        int planecnt = GlobalData.selectedPlane.Count;

        if (planecnt == 2)
        {
            Vector3[] plane1 = GlobalData.selectedPlane[0];
            Vector3[] plane2 = GlobalData.selectedPlane[1];
            float     angle  = MathCalculate.ppAngle(plane1, plane2);
            //GameObject.Find("Canvas/InfoMenu/InfoText").GetComponent<Text>().text = "Angle of the two selected planes is : " + angle.ToString() + ".";
            character.GetComponentInChildren <charEvent>().speakSomething("选中面面夹角为\n" + angle.ToString());
        }
        else
        {
            //GameObject.Find("Canvas/InfoMenu/InfoText").GetComponent<Text>().text = "You must select two planes before calculate the angle between plane and plane.";
            character.GetComponentInChildren <charEvent>().speakSomething("请先选择两平面");
        }
    }
コード例 #4
0
    public void selectLPAngle()
    {
        //operationMenu.SetActive(false);
        //cancelButton.SetActive(false);
        //infoMenu.SetActive(true);
        int linecnt  = GlobalData.selectedLine.Count;
        int planecnt = GlobalData.selectedPlane.Count;

        if (linecnt == 1 && planecnt == 1)
        {
            Vector3[] line  = GlobalData.selectedLine[0];
            Vector3[] plane = GlobalData.selectedPlane[0];
            float     angle = MathCalculate.lpAngle(line, plane);
            //GameObject.Find("Canvas/InfoMenu/InfoText").GetComponent<Text>().text = "Angle of the selected line and plane is : " + angle.ToString() + ".";
            character.GetComponentInChildren <charEvent>().speakSomething("选中直线与平面夹角为\n" + angle.ToString());
        }
        else
        {
            //GameObject.Find("Canvas/InfoMenu/InfoText").GetComponent<Text>().text = "You must select a line and a plane before calculate the angle between line and plane.";
            character.GetComponentInChildren <charEvent>().speakSomething("请先选中直线与平面");
        }
    }
コード例 #5
0
    public void selectRelation()
    {
        //operationMenu.SetActive(false);
        //cancelButton.SetActive(false);
        //infoMenu.SetActive(true);
        int linecnt  = GlobalData.selectedLine.Count;
        int planecnt = GlobalData.selectedPlane.Count;

        if (linecnt == 2 && planecnt == 0)
        {
            Vector3[]  line1    = GlobalData.selectedLine[0];
            Vector3[]  line2    = GlobalData.selectedLine[1];
            LLRELATION relation = MathCalculate.llRelation(line1, line2);
            //GameObject.Find("Canvas/InfoMenu/InfoText").GetComponent<Text>().text = "Relation of the two selected lines is : " + MathCalculate.toString(relation) + ".";
            character.GetComponentInChildren <charEvent>().speakSomething("线线间几何关系为\n" + MathCalculate.toString(relation));
        }
        else if (linecnt == 1 && planecnt == 1)
        {
            Vector3[]  line     = GlobalData.selectedLine[0];
            Vector3[]  plane    = GlobalData.selectedPlane[0];
            LPRELATION relation = MathCalculate.lpRelation(line, plane);
            //GameObject.Find("Canvas/InfoMenu/InfoText").GetComponent<Text>().text = "Relation of selected line and plane is : " + MathCalculate.toString(relation) + ".";
            character.GetComponentInChildren <charEvent>().speakSomething("线面间几何关系为\n" + MathCalculate.toString(relation));
        }
        else if (linecnt == 0 && planecnt == 2)
        {
            Vector3[]  plane1   = GlobalData.selectedPlane[0];
            Vector3[]  plane2   = GlobalData.selectedPlane[1];
            PPRELATION relation = MathCalculate.ppRelation(plane1, plane2);
            //GameObject.Find("Canvas/InfoMenu/InfoText").GetComponent<Text>().text = "Relation of two selected planes is : " + MathCalculate.toString(relation) + ".";
            character.GetComponentInChildren <charEvent>().speakSomething("面面间几何关系为\n" + MathCalculate.toString(relation));
        }
        else
        {
            //GameObject.Find("Canvas/InfoMenu/InfoText").GetComponent<Text>().text = "Selection is not correct.";
            character.GetComponentInChildren <charEvent>().speakSomething("选择存在错误");
        }
    }