Пример #1
0
    void endCheck()
    {
        SideCoordinator.current_phase = 4;

        if (armpit_Left_Angle <= 40)
        {
            SideCoordinator.armpLeftDegree.GetComponent <Text>().color = Color.black;
            wristLeftAngle_Check = true;
        }
        else
        {
            SideCoordinator.armpLeftDegree.GetComponent <Text>().color = Color.red;
            wristLeftAngle_Check = false;
        }
        if (armpit_Right_Angle <= 40)
        {
            SideCoordinator.armpRightDegree.GetComponent <Text>().color = Color.black;
            wristRightAngle_Check = true;
        }
        else
        {
            SideCoordinator.armpRightDegree.GetComponent <Text>().color = Color.red;
            wristRightAngle_Check = false;
        }



        if (wristLeftAngle_Check && wristRightAngle_Check)
        {
            judgment_position();

            GameObject PointsText;
            int        ct = 0;
            UnityEngine.Debug.Log("Arm Check");
            for (int i = 0; i < 2; i++)

            {
                UnityEngine.Debug.Log("LeftArm[" + i + "]" + LeftArmDepth[i]);
                UnityEngine.Debug.Log("RightArm[" + i + "]" + RightArmDepth[i]);
                if (!LeftArmDepth[i])
                {
                    ct++;
                }
                if (!RightArmDepth[i])
                {
                    ct++;
                }
            }
            //UnityEngine.Debug.Log("CT = " + ct);
            if (ct == 0)

            {
                if (SideCoordinator.practice_On)

                {
                    practice_count++;
                }

                PointsText = UnityEngine.Object.Instantiate(Resources.Load("Prefabs/yosi")) as GameObject;
                //Debug.Log("yosi");
                SideCoordinator.changeAni("greet_03");
            }
            else if (ct == 1)
            {
                PointsText = UnityEngine.Object.Instantiate(Resources.Load("Prefabs/soso")) as GameObject;
                SideCoordinator.changeAni("pose_00");
            }
            else

            {
                PointsText = UnityEngine.Object.Instantiate(Resources.Load("Prefabs/bad")) as GameObject;
                SideCoordinator.changeAni("refuse_01");
                bad_count++;
                //Debug.Log("BAD");
            }

            PointsText.GetComponent <ParticleSystem>().loop = false;
            show_pointText(PointsText);

            end_Flag = true;

            if (SideCoordinator.practice_On)
            {
                //Debug.Log(practice_count);
                if (practice_count > 1)
                {
                    practice_count = 0;
                    bad_count      = 0;
                    sideCoordi.ResumeScreen();
                }
            }


            else
            {
                if (score_Count > 2 || set_Count != 0)
                {
                    if (SideCoordinator.count_timer.ElapsedMilliseconds + 2000 > SideCoordinator.count_time_avg)
                    {
                        //Debug.Log("SLOW!!");
                        SideCoordinator.changeAni("nod_01");
                        //MSGorder = 5;
                    }
                    else
                    {
                        SideCoordinator.count_time_avg = (SideCoordinator.count_time_avg + SideCoordinator.count_timer.ElapsedMilliseconds) / score_Count;
                    }

                    //Debug.Log(SideCoordinator.count_timer.ElapsedMilliseconds + " / " + SideCoordinator.count_time_avg);
                }
                score_Count++;
                //if(status board is deactivate
                if (!SideCoordinator.Status.activeInHierarchy)
                {
                    SideCoordinator.Status.SetActive(true);
                }
                //set board txt
                clearBoard();
                setBoard();

                //clear MuscleFail
                LeftArmMuscle[0]  = true;
                LeftArmMuscle[1]  = true;
                RightArmMuscle[0] = true;
                RightArmMuscle[1] = true;

                SideCoordinator.count_timer.Reset();
            }


            Sound_Controller();
            clearFail();

            ready_Flag = false;
            start_Flag = false;
            top_Flag   = false;
            end_Flag   = false;



            sideCoordi.msg2Web("re:" + ready_Flag + " /st:" + start_Flag + " /tp:" + top_Flag + " /en:" + end_Flag);
            sideCoordi.msg2Web("after send" + score_Count);
            //Floating Text
            //GameObject PointsText = UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Kinniku")) as GameObject;
            //PointsText.transform.position = new Vector3(SideCoordinator.JointInfo["SpineShoulder"].X, SideCoordinator.JointInfo["SpineShoulder"].Y);

            if (!SideCoordinator.practice_On && bad_count > 2)
            {
                sideCoordi.SplitScreen();
            }
        }
    }
Пример #2
0
    void endCheck()
    {
        //DumbelCoordinator.setBallonText("팔을 천천히 내려 주세요");
        DumbelCoordinator.current_phase = 4;

        if (armpit_Left_Angle <= 95)
        {
            DumbelCoordinator.armpLeftDegree.GetComponent <Text>().color = Color.black;
            wristLeftAngle_Check = true;
        }
        else
        {
            DumbelCoordinator.armpLeftDegree.GetComponent <Text>().color = Color.red;
            wristLeftAngle_Check = false;
        }

        if (armpit_Right_Angle <= 95)
        {
            DumbelCoordinator.armpRightDegree.GetComponent <Text>().color = Color.black;
            wristRightAngle_Check = true;
        }
        else
        {
            DumbelCoordinator.armpRightDegree.GetComponent <Text>().color = Color.red;
            wristRightAngle_Check = false;
        }


        if (wristLeftAngle_Check && wristRightAngle_Check)
        {
            judgment_position();

            // 4,5 ->0

            GameObject PointsText;
            int        ct = 0;
            UnityEngine.Debug.Log("Arm Check");
            for (int i = 0; i < 2; i++)
            {
                UnityEngine.Debug.Log("LeftArm[" + i + "]" + LeftArmDepth[i]);
                UnityEngine.Debug.Log("RightArm[" + i + "]" + RightArmDepth[i]);
                if (!LeftArmDepth[i])
                {
                    ct++;
                }
                if (!RightArmDepth[i])
                {
                    ct++;
                }
            }
            //UnityEngine.Debug.Log("CT = " + ct);
            if (ct == 0)
            {
                if (DumbelCoordinator.practice_On)
                {
                    practice_count++;
                }

                PointsText = UnityEngine.Object.Instantiate(Resources.Load("Prefabs/yosi")) as GameObject;
                //Debug.Log("yosi");
                DumbelCoordinator.changeAni("greet_03");
            }
            else if (ct == 1)
            {
                PointsText = UnityEngine.Object.Instantiate(Resources.Load("Prefabs/soso")) as GameObject;
                DumbelCoordinator.changeAni("pose_00");
            }
            else
            {
                PointsText = UnityEngine.Object.Instantiate(Resources.Load("Prefabs/bad")) as GameObject;
                DumbelCoordinator.changeAni("refuse_01");
                bad_count++;
                //Debug.Log("BAD");
            }

            PointsText.GetComponent <ParticleSystem>().loop = false;
            show_pointText(PointsText);

            end_Flag = true;

            if (DumbelCoordinator.practice_On)
            {
                //Debug.Log(practice_count);
                if (practice_count > 1)
                {
                    practice_count = 0;
                    bad_count      = 0;
                    dumbelCoordi.practice_mod(false);
                    dumbelCoordi.ResumeScreen();
                }
            }


            else
            {
                if (score_Count > 2 || set_Count != 0)
                {
                    if (DumbelCoordinator.count_timer.ElapsedMilliseconds + 2000 > DumbelCoordinator.count_time_avg)
                    {
                        //Debug.Log("SLOW!!");
                        DumbelCoordinator.changeAni("nod_01");
                        //MSGorder = 5;
                    }
                    else
                    {
                        DumbelCoordinator.count_time_avg = (DumbelCoordinator.count_time_avg + DumbelCoordinator.count_timer.ElapsedMilliseconds) / score_Count;
                    }

                    //Debug.Log(DumbelCoordinator.count_timer.ElapsedMilliseconds + " / " + DumbelCoordinator.count_time_avg);
                }
                score_Count++;
                //if(status board is deactivate
                if (!DumbelCoordinator.Status.activeInHierarchy)
                {
                    DumbelCoordinator.Status.SetActive(true);
                }
                //set board txt
                clearBoard();
                setBoard();

                //clear MuscleFail
                LeftArmMuscle[0]  = true;
                LeftArmMuscle[1]  = true;
                RightArmMuscle[0] = true;
                RightArmMuscle[1] = true;
                DumbelCoordinator.count_timer.Reset();

                //if (set_Count == 0 && score_Count == 2)
                //{
                //    //DumbelCoordinator.Status.SetActive(false);
                //    DumbelCoordinator.Status.GetComponent<Image>().material = Resources.Load("blackMaterial") as Material;
                //    DumbelCoordinator.title.transform.parent = GameObject.Find("Canvas").transform;
                //    DumbelCoordinator.Status.GetComponent<RectTransform>().localScale = new Vector3(0.1203983f, 0.118181f, 1f);
                //    DumbelCoordinator.Status.GetComponent<RectTransform>().offsetMin = new Vector2(-462f, -77f);
                //    DumbelCoordinator.Status.GetComponent<RectTransform>().offsetMax = new Vector2(680f, 275f);
                //    DumbelCoordinator.title.transform.parent = DumbelCoordinator.Status.transform;
                //}
            }


            Sound_Controller();
            clearFail();
            ready_Flag = false;
            start_Flag = false;
            top_Flag   = false;
            end_Flag   = false;

            dumbelCoordi.msg2Web("re:" + ready_Flag + " /st:" + start_Flag + " /tp:" + top_Flag + " /en:" + end_Flag);
            dumbelCoordi.msg2Web("after send" + score_Count);
            //Floating Text
            //GameObject PointsText = UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Kinniku")) as GameObject;
            //PointsText.transform.position = new Vector3(DumbelCoordinator.JointInfo["SpineShoulder"].X, DumbelCoordinator.JointInfo["SpineShoulder"].Y);
            if (!DumbelCoordinator.practice_On && bad_count > 2)
            {
                dumbelCoordi.SplitScreen();
            }
        }
    }