// Update is called once per frame void Update() { if (m_textController.IsCompleteDisplayText) { if (m_currentLine < m_scenarios.Length) { if (!m_isCallPreload) { m_commandController.PreLoadCommand(m_scenarios[m_currentLine]); m_isCallPreload = true; } if (Input.GetMouseButtonDown(0)) { RequestNextLine(); } } } else { if (Input.GetMouseButtonDown(0)) { m_textController.ForceCompleteDisplayText(); } } }
void Update() { if (m_textController.IsCompleteDisplayText) { if (m_currentLine < m_scenarios.Length) { if (!m_isCallPreload) { m_commandController.PreloadCommand(m_scenarios[m_currentLine]); m_isCallPreload = true; } if (Input.GetMouseButtonDown(0)) { RequestNextLine(); textNo++; } } } else { if (Input.GetMouseButtonDown(0)) { m_textController.ForceCompleteDisplayText(); } Sprite image = Resources.Load <Sprite> ("Resources/Image/josyu01_C02"); } //キャラ移動 if ((textNo == 5) && (Application.loadedLevelName == "Tutorial02")) { chara1.GetComponent <Liner>().enabled = true; } if ((textNo == 5) && (Application.loadedLevelName == "Tutorial02")) { chara2.GetComponent <Liner>().enabled = true; } if ((textNo == 13) && (Application.loadedLevelName == "Tutorial02")) { bg.GetComponent <ClickObject>().enabled = true; } if ((textNo == 7) && (Application.loadedLevelName == "Tutorial")) //ところで { chara1.GetComponent <Liner>().enabled = false; } if ((textNo == 10) && (Application.loadedLevelName == "Tutorial")) { //ほぁー chara1.GetComponent <Animator>().enabled = true; } if ((textNo == 15) && (Application.loadedLevelName == "Tutorial")) { //ザコ… chara2.GetComponent <Animator>().enabled = true; } if ((textNo == 16) && (Application.loadedLevelName == "Tutorial")) { //そう言えば chara1.GetComponent <CharaChange2>().enabled = true; } if ((textNo == 19) && (Application.loadedLevelName == "Tutorial")) { //勇者によって chara2.GetComponent <CharaChange1>().enabled = true; } if ((textNo == 20) && (Application.loadedLevelName == "Tutorial")) //そんな… { chara1.GetComponent <CharaChange1>().enabled = true; } if ((textNo == 21) && (Application.loadedLevelName == "Tutorial")) { //おいそんな chara2.GetComponent <CharaReturn>().enabled = true; } if ((textNo == 17) && (Application.loadedLevelName == "Tutorial")) { //数体 chara1.GetComponent <CharaChange2>().enabled = false; } if ((textNo == 23) && (Application.loadedLevelName == "Tutorial")) { //えっ chara1.GetComponent <CharaChange2>().enabled = true; } if ((textNo == 24) && (Application.loadedLevelName == "Tutorial")) { //病院で chara1.GetComponent <CharaChange2>().enabled = false; } if ((textNo == 25) && (Application.loadedLevelName == "Tutorial")) { //あー…なんだ chara1.GetComponent <CharaReturn>().enabled = true; } if ((textNo == 31) && (Application.loadedLevelName == "Tutorial")) { //とりあえず chara1.GetComponent <SpriteRenderer>().enabled = false; chara2.GetComponent <SpriteRenderer>().enabled = false; bg.GetComponent <ClickObject>().enabled = true; } if ((textNo == 4) && (Application.loadedLevelName == "CreationMode")) //はい { bg.GetComponent <ClickObject>().enabled = true; } if ((textNo == 11) && (Application.loadedLevelName == "CompositionSuccess")) //は、はい { bg.GetComponent <ClickObject>().enabled = true; } if ((textNo == 2) && (Application.loadedLevelName == "Tutorial03")) //待って { chara1.GetComponent <Liner>().enabled = true; } if ((textNo == 5) && (Application.loadedLevelName == "Tutorial03")) //… { chara3.GetComponent <Liner>().enabled = true; } if ((textNo == 6) && (Application.loadedLevelName == "Tutorial03")) //うわぁ { chara1.GetComponent <CharaChange1>().enabled = true; } if ((textNo == 10) && (Application.loadedLevelName == "Tutorial03")) //悪いな { chara1.GetComponent <CharaChange1>().enabled = false; } if ((textNo == 12) && (Application.loadedLevelName == "Tutorial03")) //よく分からないけど { chara1.GetComponent <CharaChange2>().enabled = true; } if ((textNo == 13) && (Application.loadedLevelName == "Tutorial03")) //よく分からないけど(の次) { bg.GetComponent <ClickObject>().enabled = true; } if ((textNo == 4) && (Application.loadedLevelName == "CreationMode")) //はい!(の次) { obj1.GetComponent <ObjectOff>().enabled = true; } if ((textNo == 8) && (Application.loadedLevelName == "SetChara")) //ハカセ!! { obj2.GetComponent <Access>().enabled = true; } if ((textNo == 11) && (Application.loadedLevelName == "SetChara")) //これで数の(の次) { obj1.GetComponent <ObjectOff>().enabled = true; } if ((textNo == 6) && (Application.loadedLevelName == "Battle")) //また、(の次) { obj1.GetComponent <ObjectOff>().enabled = true; } }
void Update() { switch (tapStatus) { case TAP_STATUS.UP: if (Input.GetMouseButtonDown(0)) { // マウスの座標はスクリーン座標で Unityのオブジェクトはワールド座標なので変換する Vector2 position = Input.mousePosition; Vector2 screenToWorldPointPosition = Camera.main.ScreenToWorldPoint(position); // 対象のキャンバスがCanvas Scalerのため拡大率が変わっているため、取得した座標を拡大する screenToWorldPointPosition *= 1f / GameObject.Find("Canvas").transform.localScale.x; Rect rect = new Rect(x, y, w, h); bool contain = rect.Contains(screenToWorldPointPosition); // Debug.Log(screenToWorldPointPosition); if (contain) { tapStatusNext = TAP_STATUS.Began; } } break; case TAP_STATUS.Began: if (Input.GetMouseButtonUp(0)) { tapStatusNext = TAP_STATUS.Ended; } break; case TAP_STATUS.Ended: tapStatusNext = TAP_STATUS.UP; break; } while (tapStatusNext != TAP_STATUS.NONE) { tapStatus = tapStatusNext; tapStatusNext = TAP_STATUS.NONE; switch (tapStatus) { case TAP_STATUS.Began: break; case TAP_STATUS.Ended: tap = true; break; } } if (m_textController.IsCompleteDisplayText) { soul.SetActive(true); if (m_currentLine < m_scenarios.Length) { if (!m_isCallPreload) { m_commandController.PreScenario(m_scenarios[m_currentLine]); m_isCallPreload = true; } if (tap) { tap = false; RequestNextLine(); } } } else { if (tap) { tap = false; m_textController.ForceCompleteDisplayText(); } } }