コード例 #1
0
    IEnumerator BoxInstantiate(int _startNum, TextChanger _tc)
    {
        ChoiseController cc;

        yield return(new WaitForSeconds(voiceDelayTime + 0.5f));

        if (_startNum == 1)
        {
            choiseBoxes[0] = Instantiate(choiseBoxPrefab);
            choiseBoxes[0].transform.parent        = canvas.transform;
            choiseBoxes[0].transform.localPosition = choiseBoxInitPosCenter;

            _tc = choiseBoxes[0].GetComponent <TextChanger>();
            _tc.ChangeIcon(ctd.GetSprite(0));
            _tc.ChangeText("");

            cc = choiseBoxes[0].GetComponent <ChoiseController>();
            cc.Init(0, this);
        }
        for (int i = _startNum; i < ctd.GetReplyCount(); ++i)
        {
            choiseBoxes[i] = Instantiate(choiseBoxPrefab);
            choiseBoxes[i].transform.parent        = canvas.transform;
            choiseBoxes[i].transform.localPosition = choiseBoxInitPosSide[i - _startNum];

            _tc = choiseBoxes[i].GetComponent <TextChanger>();
            _tc.ChangeIcon(ctd.GetSprite(i));
            _tc.ChangeText("");

            cc = choiseBoxes[i].GetComponent <ChoiseController>();
            cc.Init(i, this);
        }
    }
コード例 #2
0
    private IEnumerator StartInitialDelay()
    {
        TextChanger textChanger = textObject.GetComponent <TextChanger>();

        textChanger.ChangeText("Ready?");
        delaying = true;
        yield return(new WaitForSeconds(initialDelay));

        textChanger.ChangeText("GO!");
        yield return(new WaitForSeconds(.5f));

        textChanger.ChangeText("");
        delaying = false;
    }
コード例 #3
0
    private IEnumerator End()
    {
        TextChanger textChanger = textObject.GetComponent <TextChanger>();

        textChanger.ChangeText("Time!");
        yield return(new WaitForSeconds(4f));

        SceneChanger s = GetComponent <SceneChanger>();

        s.ChangeScene();
    }
コード例 #4
0
    private void Update()
    {
        if (!delaying)
        {
            if (!coolingDown && !end)
            {
                StartCoroutine(SpawnCooldown());
            }

            if (activeLength <= 0)
            {
                end = true;
                timer.ChangeText("0.00");
                StartCoroutine(End());
            }

            else
            {
                activeLength -= Time.deltaTime;
                string strLen = activeLength.ToString("#0.00");
                timer.ChangeText(strLen);
            }
        }
    }
コード例 #5
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("help");
        xmlreader.ReadXML(file, path, node, id);
        Debug.Log(xmlreader.ReadXML(file, path, node, id));

        string[] playerPosibilities = xmlreader.ReadSubnodes(file, path, id);

        for (int i = 0; i < xmlreader.ReadSubnodes(file, path + "/Greetings", id).Length; i++)
        {
            var choiceButton = (GameObject)Instantiate(button, new Vector3(0, 100 + (50 * i), 0), Quaternion.identity);
            choiceButton.transform.SetParent(GameObject.FindGameObjectWithTag("Canvas").transform, false);
            TextChanger textChanger = choiceButton.GetComponent <TextChanger>();
            textChanger.ChangeText(xmlreader.ReadSubnodes(file, path + "/Greetings", id)[i]);
            Debug.Log(xmlreader.ReadSubnodes(file, path + "/Greetings", id)[i]);
        }
    }
コード例 #6
0
 private void Start()
 {
     timer = timerObject.GetComponent <TextChanger>();
     timer.ChangeText(activeLength.ToString() + ".00");
     StartCoroutine(StartInitialDelay());
 }