Beispiel #1
0
        private void LocalDataImport()
        {
            LocalData localData = AssetDatabase.LoadAssetAtPath <LocalData>(LocalAssetPath);

            if (localData == null)
            {
                return;
            }
            _localData = localData;
        }
        private void LocalDataImport()
        {
            LocalData localData = AssetDatabase.LoadAssetAtPath <LocalData>(GameJam2020inWinterProgress.LocalAssetPath);

            if (localData == null)
            {
                return;
            }
            _localData = localData;
        }
Beispiel #3
0
        private void Awake()
        {
            if (_localData == null)
            {
                _localData = ScriptableObject.CreateInstance <LocalData>();
            }
            LocalDataImport();

            if (_rankingData == null)
            {
                _rankingData = ScriptableObject.CreateInstance <RankingData>();
            }
            RankingDataImport();
            MakePublicData();
        }
Beispiel #4
0
        private void DataEdit()
        {
            if (_localData == null)
            {
                _localData = ScriptableObject.CreateInstance <LocalData>();
            }

//            LocalDataImport();
            using (var horizontalArea = new EditorGUILayout.HorizontalScope())
            {
                using (var verticalArea = new EditorGUILayout.VerticalScope())
                {
                    GUILayout.Label("チーム名:");

                    using (var horizontalArea5 = new EditorGUILayout.HorizontalScope())
                    {
                        GUILayout.Label("進捗率:", GUILayout.Height(22));
                        GUILayout.Box(_localData.Progress.ToString().PadLeft(3, ' ') + "%");
                    }

                    GUILayout.Label("コメント(24字迄):");
                    GUILayout.Label("ワールド名:");
                    GUILayout.Label("ワールドURL:");
                    GUILayout.Label("データ登録:");
                }

                using (var verticalArea = new EditorGUILayout.VerticalScope())
                {
                    using (var horizontalArea4 = new EditorGUILayout.HorizontalScope())
                    {
                        _localData.TeamName = EditorGUILayout.TextField("", _localData.TeamName);
                        GUILayout.Label("       ");
                    }

                    using (var horizontalArea2 = new EditorGUILayout.HorizontalScope())
                    {
                        using (var horizontalArea3 = new EditorGUILayout.HorizontalScope())
                        {
                            if (GUILayout.Button("  + 5%  "))
                            {
                                ChangeProgress(5);
                            }

                            if (GUILayout.Button(" + 10%   "))
                            {
                                ChangeProgress(10);
                            }

                            GUILayout.Space(3.0f);
                            if (GUILayout.Button("  - 5%   "))
                            {
                                ChangeProgress(-5);
                            }
                        }

                        GUILayout.Label("");
                        GUILayout.Label("");
                    }

                    _localData.Comment = EditorGUILayout.TextField("", _localData.Comment);
                    _localData.Title   = EditorGUILayout.TextField("", _localData.Title);
                    _localData.URL     = EditorGUILayout.TextField("", _localData.URL);
                    using (var horizontalArea2 = new EditorGUILayout.HorizontalScope())
                    {
                        if (GUILayout.Button("登録/更新"))
                        {
                            UserDataUpdate();
                        }

                        GUILayout.Label("");
                        GUILayout.Label("");
                    }
                }

                using (var verticalArea = new EditorGUILayout.VerticalScope())
                {
                    if (GUILayout.Button("他チーム"))
                    {
                        OpenListWindow();
                    }

                    GUILayout.Label("");

                    GUILayout.Label("任意入力");
                    GUILayout.Label("任意入力");
                    GUILayout.Label("任意入力");
                }
            }
        }
        void Awake()
        {
            try
            {
                if (_localData == null)
                {
                    _localData = ScriptableObject.CreateInstance <LocalData>();
                }

                LocalDataImport();

                if (_rankingData == null)
                {
                    _rankingData = ScriptableObject.CreateInstance <RankingData>();
                }

                RankingDataImport();

                MySQLUtil.DBConnection();

                string _selectUserProgress =
                    "select tbl1.Name ,tbl1.UpdateTime,tbl1.Progress,tbl1.URL,tbl1.Comment,tbl1.Title " +
                    "FROM Cluster.GameJam2020inWinter as tbl1 " +
                    "INNER JOIN (	 "+
                    "   SELECT tbl2.Name,UpdateTime ,MAX(Progress) as MAXProgress " +
                    "FROM Cluster.GameJam2020inWinter " +
                    "   INNER JOIN ( " +
                    "SELECT Name, MAX(UpdateTime) as LastTime " +
                    "FROM Cluster.GameJam2020inWinter " +
                    "GROUP BY Name  " +
                    ")as tbl2 " +
                    "Where UpdateTime = tbl2.LastTime " +
                    "GROUP BY Name	 "+
                    ") as tbl3 " +
                    "where tbl1.UpdateTime = tbl3.UpdateTime and Progress =tbl3.MAXProgress AND tbl1.Name =tbl3.Name " +
                    "ORDER BY Progress DESC,tbl1.UpdateTime ASC " +
                    "; ";


                DataTable tbl = MySQLUtil.DBSelect(_selectUserProgress);

                foreach (DataRow row in tbl.Rows)
                {
                    if (_rankingData.rankingData.ContainsKey(row["Name"].ToString()))
                    {
                        _rankingData.rankingData[row["Name"].ToString()]._progress = (int)row["Progress"];
                        _rankingData.rankingData[row["Name"].ToString()]._comment  = row["Comment"].ToString();
                        _rankingData.rankingData[row["Name"].ToString()]._url      = row["URL"].ToString();
                        _rankingData.rankingData[row["Name"].ToString()]._title    = row["Title"].ToString();
                        _rankingData.rankingData[row["Name"].ToString()]._dateTime = (DateTime)row["UPdateTime"];
                    }
                    else
                    {
                        RankingDataStruct rankingDataStruct = new RankingDataStruct();
                        rankingDataStruct._progress = (int)row["Progress"];
                        rankingDataStruct._comment  = row["Comment"].ToString();
                        rankingDataStruct._url      = row["URL"].ToString();
                        rankingDataStruct._title    = row["Title"].ToString();
                        rankingDataStruct._dateTime = (DateTime)row["UPdateTime"];
                        _rankingData.rankingData.Add(row["Name"].ToString(), rankingDataStruct);
                    }
                }

                MySQLUtil.DBClose();
            }
            catch (Exception e)
            {
                Debug.Log("error");
                Debug.Log(e);
                MySQLUtil.DBClose();
            }
        }