コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        // パーティクルをマウスカーソルに追従させる
        Vector3 mousePosition = Input.mousePosition;

        mousePosition.z = 30.0f;  // OverLay以外のCanvasより手前に移動させる
        mousePosition   = Camera.main.ScreenToWorldPoint(mousePosition);

        touch = TouchStateManagerScript.GetTouch();

        if (m_DragParticle != null)
        {
            m_DragParticle.transform.position = new Vector3(mousePosition.x, mousePosition.y, mousePosition.z);
        }
        //タッチされていたら
        if (touch)
        {
            // タッチ開始時
            if (TouchStateManagerScript.GetTouchPhase() == TouchPhase.Began)
            {
                m_ClickParticle.transform.position = mousePosition;

                m_ClickParticleSystem.Play();   // 1回再生(ParticleSystemのLoopingにチェックを入れていないため)
            }
            // タッチ終了
            else if (TouchStateManagerScript.GetTouchPhase() == TouchPhase.Ended)
            {
                // Particleの放出を停止する
                m_ClickParticleSystem.Stop();
                m_DragParticleSystem.Stop();

                DragFlag = false;
            }
            // タッチ中
            else if (TouchStateManagerScript.GetTouchPhase() == TouchPhase.Moved)
            {
                if (!DragFlag)
                {
                    m_DragParticleSystem.Play();    // ループ再生(Loopingにチェックが入っている)
                    //string scene_name = TouchStateManagerScript.GetCurrentSceneName();
                    if (script.GetCurrentSceneName() == "TITLE" ||
                        script.GetCurrentSceneName() == "SELECT STAGE")
                    {
                        audioSource.PlayOneShot(SE_awa);
                    }
                    DragFlag = true;
                }
            }
        }
    }
コード例 #2
0
    // Start is called before the first frame update
    void Start()
    {
        SceneNavigatorObj = GameObject.Find("SceneNavigator");
        script            = SceneNavigatorObj.GetComponent <SceneNavigator>();

        vol1 = GameObject.Find("vol1");
        vol2 = GameObject.Find("vol2");
        vol3 = GameObject.Find("vol3");

        scene_name = script.GetCurrentSceneName();

        if (scene_name != "SELECT STAGE")
        {
            setting_buttonObj = GameObject.Find("設定画面");
            setting_buttonObj.SetActive(false);
        }

        if (NowVol == 1)
        {
            vol1.SetActive(true);
            vol2.SetActive(false);
            vol3.SetActive(false);
        }
        else if (NowVol == 2)
        {
            vol1.SetActive(true);
            vol2.SetActive(true);
            vol3.SetActive(false);
        }
        else if (NowVol == 3)
        {
            vol1.SetActive(true);
            vol2.SetActive(true);
            vol3.SetActive(true);
        }
    }