Esempio n. 1
0
    void OnTriggerEnter(Collider col)
    {
        // �ʉ߃I�u�W�F�N�g����
        if (col.gameObject.tag == "RotateObject")
        {
            GetComponent <CCreateEffect>().CreateEffect();

            OBJECT_SHAPE order = csOrderManager.Get_Order(iPassNum);

            // �w�߂ƈ�v
            if (order == col.gameObject.GetComponent <CRotateObject>().Get_Shape())
            {
                iMatchNum++;
                CClearLampManager.Instance.Lighting(iPassNum, Color.green);
            }
            else
            {
                CClearLampManager.Instance.Lighting(iPassNum, Color.red);
            }

            // �ʉ߂����I�u�W�F�N�g��폜
            CObjectManager.Instance.Remove(col.gameObject);
            Destroy(col.gameObject);
            //Debug.Log("hit");

            iPassNum++;

            int ordernum = csOrderManager.Get_iOrderNum();

            // �w�ߐ��̃I�u�W�F�N�g���ʉ߂����烊�Z�b�g
            if (iPassNum == ordernum)
            {
                if (iMatchNum == ordernum)
                {
                    // �N���A�X�^���v����
                    //Instantiate(gClear, new Vector3(20, 0, -10 + iClearNum * 5),
                    //    Quaternion.Euler(0, 180, 0));

                    //========== 2021/5/09
                    // �X�R�A��L�^����̂ɕK�v�Ȃ̂ő����܂����@by���X��
                    CScore.AddScore();
                    CCreateTrail.Create();
                    //-- 2021.5.15�lj� sasaki
                    gPanelGreen.SetActive(true);

                    //Debug.Log("SE!!");
                    aAudioSourceGreen.PlayOneShot(aSEClear);

                    CLevelManager.Instance.UpdateLevel();
                    // �w�ߐ���
                    csOrderManager.CreateOrder(CLevelManager.Instance.Get_iOrderNum());
                    CClearLampManager.Instance.CreateLamp(CLevelManager.Instance.Get_iOrderNum());
                    iClearNum++;
                }
                else
                {
                    //-- 2021.5.15�lj� sasaki
                    gPanelRed.SetActive(true);

                    //Debug.Log("SE!!");
                    aAudioSourceRed.PlayOneShot(aSEMiss);
                }
                // �V�����I�u�W�F�N�g����
                CObjectManager.Instance.Create(ordernum);
                CClearLampManager.Instance.LightingOff();

                csGateTimerController.Reset();
                gGateTimerController.transform.LookAt(new Vector3(0, 0, 10));
                Destroy(this.gameObject);
            }
        }
    }
Esempio n. 2
0
    void OnTriggerEnter(Collider col)
    {
        // �ʉ߃I�u�W�F�N�g����
        if (col.gameObject.tag == "RotateObject")
        {
            GetComponent <CCreateEffect>().CreateEffect();

            GameObject   lamp  = csOrderManager.Get_gClearLamp(iPassNum);
            OBJECT_SHAPE order = csOrderManager.Get_Order(iPassNum);

            // �w�߂ƈ�v
            if (order == col.gameObject.GetComponent <CRotateObject>().Get_Shape())
            {
                iMatchNum++;
                lamp.GetComponent <Renderer>().material.color = Color.green;
            }
            else
            {
                lamp.GetComponent <Renderer>().material.color = Color.red;
            }

            // �ʉ߂����I�u�W�F�N�g��폜
            CObjectManager.Instance.Remove(col.gameObject);
            CObjectManager.Instance.AcceleRemove(col.gameObject);
            Destroy(col.gameObject);
            Debug.Log("hit");

            iPassNum++;

            int ordernum = csOrderManager.Get_iOrderNum();

            // �w�ߐ��̃I�u�W�F�N�g���ʉ߂����烊�Z�b�g
            if (iPassNum == ordernum)
            {
                if (iMatchNum == ordernum)
                {
                    // �N���A�X�^���v����
                    //Instantiate(gClear, new Vector3(20, 0, -10 + iClearNum * 5),
                    //    Quaternion.Euler(0, 180, 0));

                    //========== 2021/5/09
                    // �X�R�A��L�^����̂ɕK�v�Ȃ̂ő����܂����@by���X��
                    //CScore.AddScore();
                    CCreateTrail.Create();
                    //-- 2021.5.15�lj� sasaki
                    gPanelGreen.SetActive(true);

                    // �w�ߐ���
                    csOrderManager.CreateOrder(3);
                    iClearNum++;
                }
                else
                {
                    for (int i = 0; i < ordernum; i++)
                    {
                        GameObject l = csOrderManager.Get_gClearLamp(i);
                        l.GetComponent <Renderer>().material.color = Color.white;
                    }
                    //-- 2021.5.15�lj� sasaki
                    gPanelRed.SetActive(true);
                }
                // �V�����I�u�W�F�N�g����
                CObjectManager.Instance.Create(3);

                csGateTimerController.Reset();
                gGateTimerController.transform.LookAt(new Vector3(0, 0, 10));
                Destroy(this.gameObject);
            }
        }
    }