Beispiel #1
0
        private void DrawPublicPoint()
        {
            if (_rankingData != null)
            {
                Vector2[] publicPoint;
                foreach (KeyValuePair <string, PublicDataStruct[]> dic in _publicData.publicDatas)
                {
                    if (_rankingData.rankingData != null && (_rankingData.rankingData.ContainsKey(dic.Key) && _rankingData.rankingData[dic.Key]._show))
                    {
                        publicPoint = new Vector2[] { new Vector2(0f, 0f) };
                        foreach (PublicDataStruct data in dic.Value)
                        {
                            Array.Resize(ref publicPoint, publicPoint.Length + 1);
                            float x = 48f - ((float)(_endDt - ((DateTime)data.DateTime)).TotalMinutes / 60f);
                            float y = (float)data.Progress;
                            publicPoint[publicPoint.Length - 1] = new Vector2(x, y);
//                        Debug.Log(((_endDt-((DateTime)row[0])).TotalMinutes)/60);
                        }

                        GUIChartEditor.PushLineChart(publicPoint, _rankingData.rankingData[dic.Key]._color);
                    }
                }
            }
            else
            {
                if (_rankingData == null)
                {
                    _rankingData = ScriptableObject.CreateInstance <RankingData>();
                }
                RankingDataImport();
            }
        }
Beispiel #2
0
        private void RankingDataImport()
        {
            RankingData rankingData = AssetDatabase.LoadAssetAtPath <RankingData>(GameJam2020inWinterProgress.RankingAssetPath);

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

            if (_rankingData == null)
            {
                _rankingData = ScriptableObject.CreateInstance <RankingData>();
            }
            RankingDataImport();
            MakePublicData();
        }
        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();
            }
        }