Пример #1
0
    public override void SetData(PopupBaseData data)
    {
        var popupData = data as PopupData;

        if (popupData == null)
        {
            return;
        }

        TrainingCount = popupData.Count;
        EndAction     = popupData.EndAction;

        TrainingType  = TKManager.Instance.GetTrainingType();
        PoseType      = TKManager.Instance.GetPoseType();
        AngleTypeList = TKManager.Instance.GetAngleType();

        DateTime time = new DateTime(DateTime.Now.Ticks);

        Date.text = string.Format("{0:D2}월 {1:D2}일", time.Month, time.Day);

        if (TrainingType == CommonData.TRAINING_TYPE.TRAINING_POSE)
        {
            TrainingPoint = TrainingCount * 3;
            Title.text    = string.Format("{0} {1}Point", CommonFunc.ConvertPoseTypeEngStr(PoseType), TrainingPoint);
        }
        else
        {
            TrainingPoint = 0;
            Title.text    = string.Format("{0} {1}회", CommonFunc.ConvertTrainingTypeEngStr(TrainingType, false), TrainingCount);
        }

        Msg.text  = "";
        StarCount = 5;
        RefreshStar();
    }
Пример #2
0
    public EvaluationData(long date,
                          CommonData.TRAINING_TYPE trainingType,
                          int trainingCount,
                          CommonData.TRAINING_POSE poseType,
                          Dictionary <CommonData.TRAINING_ANGLE, int> angleTypeList,
                          int starCount,
                          string msg)
    {
        Time = new DateTime(date);
        CultureInfo cultures = CultureInfo.CreateSpecificCulture("ko-KR");

        TKDate        = Time.ToString("yyyyMMddHHmmssffff", cultures);
        TrainingType  = trainingType;
        TrainingCount = trainingCount;
        PoseType      = poseType;
        AngleTypeList = angleTypeList;
        var e = AngleTypeList.GetEnumerator();

        while (e.MoveNext())
        {
            AngleTypeList_Str.Add(e.Current.Key.ToString(), e.Current.Value);
        }
        StarCount = starCount;
        Msg       = msg;
    }
Пример #3
0
    static public string ConvertTrainingTypeEngStr(CommonData.TRAINING_TYPE type, bool enter = false)
    {
        switch (type)
        {
        case CommonData.TRAINING_TYPE.TRAINING_POSE:
            return("포즈");

        case CommonData.TRAINING_TYPE.TRAINING_TEMPO:
        {
            if (enter)
            {
                return("Sound\nTraining");
            }
            else
            {
                return("Sound Training");
            }
        }

        default:
            break;
        }

        return("");
    }
Пример #4
0
    public void OnClickSoundTraning()
    {
        if (MenuAction)
        {
            return;
        }

        TrainingType = CommonData.TRAINING_TYPE.TRAINING_TEMPO;
        StartMenuAction();
    }
Пример #5
0
    public EvaluationData(Dictionary <string, object> dic)
    {
        TrainingType = CommonFunc.ToEnum <CommonData.TRAINING_TYPE>(dic["TrainingType"].ToString());

        long tkTime = Convert.ToInt64(dic["TKDate"].ToString());

        Time = DateTime.MinValue;
        if (tkTime <= 0)
        {
            Time = DateTime.MinValue;
        }
        else
        {
            try
            {
                Time = DateTime.ParseExact(tkTime.ToString(), "yyyyMMddHHmmssffff", null);
                CultureInfo cultures = CultureInfo.CreateSpecificCulture("ko-KR");
                TKDate = Time.ToString("yyyyMMddHHmmssffff", cultures);
            }
            catch
            {
                Time = DateTime.MinValue;
                CultureInfo cultures = CultureInfo.CreateSpecificCulture("ko-KR");
                TKDate = Time.ToString("yyyyMMddHHmmssffff", cultures);
            }
        }

        TrainingCount = Convert.ToInt32(dic["TrainingCount"].ToString());
        StarCount     = Convert.ToInt32(dic["StarCount"].ToString());
        if (dic.ContainsKey("Msg"))
        {
            Msg = dic["Msg"].ToString();
        }

        if (TrainingType == CommonData.TRAINING_TYPE.TRAINING_POSE)
        {
            PoseType = CommonFunc.ToEnum <CommonData.TRAINING_POSE>(dic["PoseType"].ToString());
            var dic_angle = dic["AngleTypeList"] as Dictionary <string, object>;
            var e         = dic_angle.GetEnumerator();
            while (e.MoveNext())
            {
                var k = CommonFunc.ToEnum <CommonData.TRAINING_ANGLE>(e.Current.Key);
                var v = Convert.ToInt32(e.Current.Value);
                AngleTypeList.Add(k, v);
            }

            var e_1 = AngleTypeList.GetEnumerator();
            while (e_1.MoveNext())
            {
                AngleTypeList_Str.Add(e_1.Current.Key.ToString(), e_1.Current.Value);
            }
        }
    }
Пример #6
0
    public void OnClickPoseTraning()
    {
        if (MenuAction)
        {
            return;
        }

        TrainingType    = CommonData.TRAINING_TYPE.TRAINING_POSE;
        TrainingSetStep = TRAINING_SET_STEP.POSE;

        StartMenuAction();
    }
Пример #7
0
    public EvaluationData(long date,
                          CommonData.TRAINING_TYPE trainingType,
                          int trainingCount,
                          int starCount,
                          string msg)
    {
        Time = new DateTime(date);
        CultureInfo cultures = CultureInfo.CreateSpecificCulture("ko-KR");

        TKDate        = Time.ToString("yyyyMMddHHmmssffff", cultures);
        TrainingType  = trainingType;
        TrainingCount = trainingCount;
        StarCount     = starCount;
        Msg           = msg;
    }
Пример #8
0
    // Start is called before the first frame update
    void Start()
    {
        // TODO 파베에서 데이터 받아와야함
        Mydata = new UserData();

        FirebaseManager.Instance.init();

        TrainingType = CommonData.TRAINING_TYPE.TRAINING_POSE;
        PoseType     = CommonData.TRAINING_POSE.TRAINING_ADDRESS;
        gyro         = Input.gyro;
        gyro.enabled = false;
        //Input.location.Start(0.5f);

        DontDestroyOnLoad(this);

        Screen.sleepTimeout         = SleepTimeout.NeverSleep;
        Application.targetFrameRate = 30;
//#if UNITY_ANDROID || UNITY_EDITOR
//        Screen.SetResolution((int)Screen.safeArea.width, ((int)Screen.safeArea.width * 16) / 9, false);
//#endif
        //Screen.SetResolution((int)Screen.safeArea.width, ((int)Screen.safeArea.width * 16) / 9, false);
    }
Пример #9
0
    public void OnClickBack()
    {
        if (MenuAction)
        {
            return;
        }

        if (TrainingType == CommonData.TRAINING_TYPE.TRAINING_POSE)
        {
            TrainingSetStep--;
            if (TrainingSetStep < 0)
            {
                TrainingSetStep = TRAINING_SET_STEP.MAIN;
            }
        }
        else
        {
            TrainingType    = CommonData.TRAINING_TYPE.TRAINING_POSE;
            TrainingSetStep = TRAINING_SET_STEP.MAIN;
        }

        StartMenuAction();
    }
Пример #10
0
 public void SetTrainingType(CommonData.TRAINING_TYPE type)
 {
     this.TrainingType = type;
 }
Пример #11
0
 public PracticeData(CommonData.TRAINING_TYPE trainingType, int practiceCount)
 {
     TrainingType  = trainingType;
     PracticeCount = practiceCount;
 }