void Start()
    {
        contentsData = AppData.ContentsData;
        for (int i = 0; i < fileIDList.Length; i++)
        {
            AboutItem item = Instantiate(itemPrefab, itemContainer);
            item.Init(contentsData.ContentDictionary[fileIDList[i]].ContentsName, fileIDList[i]);
        }

        AboutItem credit = Instantiate(itemPrefab, itemContainer);

        credit.Init(AppData.UsedLanguage == SystemLanguage.Japanese ? "クレジット": "Credit",
                    () =>
        {
            creditController.PushCredit();
        });


//#if DEVELOPMENT_BUILD || UNITY_EDITOR
//        AboutItem workSheet = Instantiate(itemPrefab, itemContainer);
//        workSheet.Init("アンケート回答",
//            () =>
//            {
//                developerMenu.StartWorkSheet();
//            });

        AboutItem developMenu = Instantiate(itemPrefab, itemContainer);

        developMenu.Init(AppData.UsedLanguage == SystemLanguage.Japanese ? "木札が見つからない時は" : "If the wooden tags can not be found.",
                         () =>
        {
            developerMenu.Open();
        });
//#endif
    }
    // Use this for initialization
    void Start()
    {
        contentsData = AppData.ContentsData;
       
        for (int i = 0; i < contentsData.Elements.Count; i++)
        {
            Sprite sprite = Resources.Load<Sprite>(contentsData.Elements[i].FileID);
            string name = contentsData.Elements[i].ContentsName;

            char h = contentsData.Elements[i].FileID[0];

            //タイプによって画像、色の変更
            if (h == 'N')
            {
                ContentGroupN.contentParams.Add(contentsData.Elements[i]);

            }
            else if (h == 'H')
            {
                ContentGroupH.contentParams.Add(contentsData.Elements[i]);

            }
            else if (h == 'Y')
            {
                ContentGroupY.contentParams.Add(contentsData.Elements[i]);
            }
        }

        ContentGroupN.Create();
        ContentGroupH.Create();
        ContentGroupY.Create(ContentGroupN.mostUnderItem);
        RectTransform hRect = ContentGroupH.transform as RectTransform;
        RectTransform nRect= ContentGroupN.transform as RectTransform;
        RectTransform yRect = ContentGroupY.transform as RectTransform;


        float iconSize = 100;
        //一つ上のグループのYからアイコンサイズ、グループ下の座標、Yサイズを引く、めんどいので関数化してない
        RectTransform hUnderItemRect = ContentGroupH.mostUnderItem.transform as RectTransform;
        float nY = hRect.anchoredPosition.y - iconSize + hUnderItemRect.anchoredPosition.y - hUnderItemRect.sizeDelta.y *hUnderItemRect.localScale.y;
        nRect.anchoredPosition = new Vector2(nRect.anchoredPosition.x, nY);


        RectTransform nUnderItemRect = ContentGroupN.mostUnderItem.transform as RectTransform;
        float yY = nRect.anchoredPosition.y - iconSize + nUnderItemRect.anchoredPosition.y 
            - nUnderItemRect.sizeDelta.y * nUnderItemRect.localScale.y;
        yRect.anchoredPosition = new Vector2(yRect.anchoredPosition.x, yY);


        RectTransform rec = ContentGroupY.mostUnderItem.transform as RectTransform;
        RectTransform parentRec = rec.parent as RectTransform;
        float limit = rec.anchoredPosition.y + parentRec.anchoredPosition.y - 100.0f;
        Vector2 contentRecSize = contentRec.sizeDelta;
        contentRecSize.y = Mathf.Abs(limit);
        contentRec.sizeDelta = contentRecSize;
    }
Exemplo n.º 3
0
        private void GridMainContents_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            _DispInfoSelectGridMainContents = (ContentsData)GridMainContents.SelectedItem;

            try
            {
                _Player.Execute(_DispInfoSelectGridMainContents);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 4
0
    protected override void Start()
    {
        base.Start();
        contentsData = AppData.ContentsData;
        List <GameObject> tempList = new List <GameObject>();

        tempList.AddRange(GameObject.FindGameObjectsWithTag("Maker"));
        for (int i = 0; i < tempList.Count; i++)
        {
            makerList.Add(tempList[i].GetComponent <MapMaker>());
        }
        TouchManager.Instance.TouchEnd   += OnTouchEnd;
        TouchManager.Instance.TouchStart += OnTouchStart;
    }
Exemplo n.º 5
0
    static void FormatData()
    {
        ContentsData japanData = Resources.Load <ContentsData>("ContentsData/" + SystemLanguage.Japanese.ToString());

        ContentsData.Params element;

        for (int i = contentsData.Elements.Count - 1; i >= 0; i--)
        {
            if (japanData.ContentDictionary.TryGetValue(contentsData.Elements[i].FileID, out element))
            {
                continue;
            }

            contentsData.RemoveContent(contentsData.Elements[i].FileID);
        }
    }
Exemplo n.º 6
0
        private void GridMainContents_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (GridMainContents.SelectedItem == null)
            {
                return;
            }

            _DispInfoSelectGridMainContents = (ContentsData)GridMainContents.SelectedItem;

            if (String.IsNullOrEmpty(_DispInfoSelectGridMainContents.Path))
            {
                txtStatusBar.Text = "Pathなし";
            }

            cmbLargeRating1.SelectedItem = _DispInfoSelectGridMainContents.Rating1;
            cmbLargeRating2.SelectedItem = _DispInfoSelectGridMainContents.Rating2;
            txtLargeComment.Text         = _DispInfoSelectGridMainContents.Comment;
        }
Exemplo n.º 7
0
        public void Execute(ContentsData myData)
        {
            string executePathname = "";
            string playerName      = "GOM";

            if (myData.Path.Length <= 0)
            {
                return;
            }

            //if (playerName.Equals("GOM"))
            //    executePathname = PlayList.MakeAsxFile(myData, Path.GetTempPath());
            //else if (playerName.Equals("WMP"))
            //    executePathname = PlayList.MakeWplFile(myData, Path.GetTempPath());
            //executePathname = PlayList.MakeWplFile(myMovieContents.Path, null, Path.GetTempPath(), myMovieContents.Name);

            var targets = from player in listPlayer
                          where player.Name.ToUpper() == playerName.ToUpper()
                          select player;

            string name = Path.Combine(myData.Path, myData.Name.Replace(" − ", " - "));

            if (File.Exists(name))
            {
                executePathname = name;
            }

            if (executePathname.Length <= 0)
            {
                return;
            }

            foreach (PlayerInfo info in targets)
            {
                // 起動するファイル名の前後を""でくくる  例) test.mp4 --> "test.mp4"
                Process.Start(info.ExecuteName, "\"" + @executePathname + "\"");
                break;
            }
        }
Exemplo n.º 8
0
        public void SearchByText(string mySearchText)
        {
            if (mySearchText.Trim().Length <= 0)
            {
                ColViewListData.Filter = null;
            }

            string[] SearchArray = mySearchText.Trim().Split(' ');

            ColViewListData.Filter = delegate(object o)
            {
                ContentsData data = o as ContentsData;

                foreach (string text in SearchArray)
                {
                    if (data.Name.IndexOf(text) < 0)
                    {
                        return(false);
                    }
                }

                return(true);
            };
        }
Exemplo n.º 9
0
    // Use this for initialization
    void Awake()
    {
        contentsData = AppData.ContentsData;
        index        = GetIndex(AppData.SelectTargetName);

        if (index == -1)
        {
            return;
        }

        string  fileName      = contentsData.Elements[index].FileID;
        char    c             = 'b';
        string  up            = "_UP";
        Vector2 imagePosition = new Vector2(0.0f, 373.0f);
        int     fileNum       = 0;
        Sprite  sprite;

        while (true)
        {
            if (fileNum > 0)
            {
                fileName = contentsData.Elements[index].FileID + c;
                c++;
            }


            sprite = Resources.Load <Sprite>(fileName);
            if (sprite == null)
            {
                break;
            }

            Image image = Instantiate(imagePrefab, imageContainer.transform);
            imagePosition.x = fileNum * 1080.0f;
            image.rectTransform.anchoredPosition = imagePosition;
            image.sprite = sprite;

            fileNum++;
        }

        maxImageNum = fileNum;

        ContentsSwipeController.I.SetImageNum(maxImageNum);
        if (maxImageNum > 1)
        {
            pageControl.Initialize(maxImageNum);
        }

        ContentName.text = contentsData.Elements[index].ContentsName;
        ContentText.GetText(contentsData.Elements[index].ContentsText);

        contentsTextController.SetTextInterval();
        char h = contentsData.Elements[index].FileID[0];

        Color color = default(Color);

        //タイプによって画像、色の変更
        if (h == 'H')
        {
            backButtonImage.sprite = HistoryButton;
            ColorUtility.TryParseHtmlString("#826787", out color);
            Header.sprite = History;
        }
        else if (h == 'N')
        {
            backButtonImage.sprite = NatureButton;
            Header.sprite          = Nature;
            ColorUtility.TryParseHtmlString("#268050", out color);
        }
        else if (h == 'Y' || h == 'I')
        {
            backButtonImage.sprite = YoshinoButton;
            Header.sprite          = Yoshino;
            ColorUtility.TryParseHtmlString("#e79ea3", out color);
        }
        ContentsBack.color = color;


        //拡大があったら
        fileName = contentsData.Elements[index].FileID + up;
        sprite   = Resources.Load <Sprite>(fileName);
        if (sprite == null)
        {
            contentsViewController.gameObject.SetActive(false);
            return;
        }
        contentsViewController.SetInit(sprite);
    }
Exemplo n.º 10
0
 private void Start()
 {
     nowDraw      = firstWindow;
     contentsData = AppData.ContentsData;
 }
Exemplo n.º 11
0
    static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
    {
        string targetFile = "Assets/CSV/English.json";
        string exportFile = "Assets/Resources/ContentsData/English.asset";

        foreach (string asset in importedAssets)
        {
            //合致しないものはスルー
            if (!targetFile.Equals(asset))
            {
                continue;
            }

            // 既存のマスタを取得
            ContentsData data = AssetDatabase.LoadAssetAtPath <ContentsData>(exportFile);

            // 見つからなければ作成する
            if (data == null)
            {
                data = ScriptableObject.CreateInstance <ContentsData>();
                AssetDatabase.CreateAsset((ScriptableObject)data, exportFile);
                AssetDatabase.SaveAssets();
            }
            else
            {
                // 中身を削除
                data.Elements.Clear();
            }
            //変更ここから//
            AssetDatabase.StartAssetEditing();
            // CSVファイルをオブジェクトへ保存
            using (StreamReader sr = new StreamReader(targetFile))
            {
                string line = sr.ReadToEnd();

                string[] cutStr   = { ":\"" };
                string[] dataStrs = line.Split(cutStr, System.StringSplitOptions.None);
                int      nowCount = 1;

                char[] removeChar = new char[2] {
                    ' ', ' '
                };
                // ファイルの終端まで繰り返す
                while (nowCount < dataStrs.Length)
                {
                    // 追加するパラメータを生成
                    ContentsData.Params p = new ContentsData.Params();
                    // 値を設定する
                    p.FileID = ChangeString(ReturnIntervalString(RemoveTopChar(dataStrs[nowCount], removeChar)));
                    nowCount++;
                    p.ContentsName = ChangeString(ReturnIntervalString(RemoveNumberChar(RemoveTopChar(dataStrs[nowCount], removeChar))));
                    nowCount++;
                    p.ContentsText = ChangeString(ReturnIntervalString(RemoveTopChar(dataStrs[nowCount], removeChar), "\"}"));
                    nowCount++;
                    // 追加
                    data.Elements.Add(p);
                }
            }

            //変更ここまで//
            AssetDatabase.StopAssetEditing();

            //変更をUnityEditorに伝える//
            EditorUtility.SetDirty(data);

            //すべてのアセットを保存//
            AssetDatabase.SaveAssets();

            Debug.Log("Json updated.");
        }
    }
Exemplo n.º 12
0
        public List <ContentsData> GetList(MySqlDbConnection myDbCon)
        {
            List <ContentsData> listData = new List <ContentsData>();

            if (myDbCon == null)
            {
                myDbCon = new MySqlDbConnection();
            }

            string queryString
                = "SELECT f.id"
                  + "    , f.contents_id, f.detail_id, f.store_id, f.label"
                  + "    , f.name, f.source, f.duration, f.time "
                  + "    , f.video_info, f.comment, f.size, f.priority_num  "
                  + "    , f.file_date, f.quality, f.rating1, f.rating2  "
                  + "    , f.remark  "
                  + "    , f.created_at, f.updated_at, d.path "
                  + "  FROM tv.file as f LEFT JOIN tv.real_dir as d "
                  + "    ON f.store_id = d.id  "
                  + "  ORDER BY f.file_date DESC "
                  + "";

            MySqlDataReader reader = null;

            try
            {
                reader = myDbCon.GetExecuteReader(queryString);

                do
                {
                    if (reader.IsClosed)
                    {
                        //_logger.Debug("reader.IsClosed");
                        throw new Exception("av.storeの取得でreaderがクローズされています");
                    }

                    while (reader.Read())
                    {
                        ContentsData data = new ContentsData();

                        int colIdx = 0;
                        data.Id          = MySqlDbExportCommon.GetDbInt(reader, colIdx++);
                        data.ContentsId  = MySqlDbExportCommon.GetDbInt(reader, colIdx++);
                        data.DetailId    = MySqlDbExportCommon.GetDbInt(reader, colIdx++);
                        data.StoreId     = MySqlDbExportCommon.GetDbInt(reader, colIdx++);
                        data.Label       = MySqlDbExportCommon.GetDbString(reader, colIdx++);
                        data.Name        = MySqlDbExportCommon.GetDbString(reader, colIdx++);
                        data.Source      = MySqlDbExportCommon.GetDbString(reader, colIdx++);
                        data.Duration    = MySqlDbExportCommon.GetDbInt(reader, colIdx++);
                        data.Time        = MySqlDbExportCommon.GetDbString(reader, colIdx++);
                        data.VideoInfo   = MySqlDbExportCommon.GetDbString(reader, colIdx++);
                        data.Comment     = MySqlDbExportCommon.GetDbString(reader, colIdx++);
                        data.Size        = MySqlDbExportCommon.GetLong(reader, colIdx++);
                        data.PriorityNum = MySqlDbExportCommon.GetDbInt(reader, colIdx++);
                        data.FileDate    = MySqlDbExportCommon.GetDbDateTime(reader, colIdx++);
                        data.Quality     = MySqlDbExportCommon.GetDbInt(reader, colIdx++);
                        data.Rating1     = MySqlDbExportCommon.GetDbInt(reader, colIdx++);
                        data.Rating2     = MySqlDbExportCommon.GetDbInt(reader, colIdx++);
                        data.Remark      = MySqlDbExportCommon.GetDbString(reader, colIdx++);
                        data.CreatedAt   = MySqlDbExportCommon.GetDbDateTime(reader, colIdx++);
                        data.UpdatedAt   = MySqlDbExportCommon.GetDbDateTime(reader, colIdx++);
                        data.Path        = MySqlDbExportCommon.GetDbString(reader, colIdx++);

                        listData.Add(data);
                    }
                } while (reader.NextResult());
            }
            catch (Exception ex)
            {
                Debug.Write(ex);
            }
            finally
            {
                reader.Close();
            }

            reader.Close();

            myDbCon.closeConnection();

            return(listData);
        }
Exemplo n.º 13
0
    static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
    {
        string targetFile = "Assets/CSV/Japanese.csv";
        string exportFile = "Assets/Resources/ContentsData/Japanese.asset";

        // 現在のデータだと余計なものも入ってしまう為コメントアウト

        foreach (string asset in importedAssets)
        {
            // 合致しないものはスルー
            if (!targetFile.Equals(asset))
            {
                continue;
            }

            // 既存のマスタを取得
            ContentsData data = AssetDatabase.LoadAssetAtPath <ContentsData>(exportFile);

            // 見つからなければ作成する
            if (data == null)
            {
                data = ScriptableObject.CreateInstance <ContentsData>();
                AssetDatabase.CreateAsset((ScriptableObject)data, exportFile);
                AssetDatabase.SaveAssets();
            }
            else
            {
                // 中身を削除
                data.Elements.Clear();
            }
            //変更ここから//
            AssetDatabase.StartAssetEditing();
            // CSVファイルをオブジェクトへ保存
            using (StreamReader sr = new StreamReader(targetFile))
            {
                // ヘッダをやり過ごす
                sr.ReadLine();

                // ファイルの終端まで繰り返す
                while (!sr.EndOfStream)
                {
                    string   line     = sr.ReadLine();
                    string[] dataStrs = line.Split(',');

                    // 追加するパラメータを生成
                    ContentsData.Params p = new ContentsData.Params();
                    // 値を設定する
                    p.FileID       = dataStrs[0];
                    p.ContentsName = dataStrs[1];
                    p.ContentsText = dataStrs[2];

                    ////p.FileID = dataStrs[1];
                    ////p.ContentsName = dataStrs[2];
                    ////p.ContentsText = dataStrs[5];

                    // 追加
                    data.Elements.Add(p);
                }
            }

            //変更ここまで//
            AssetDatabase.StopAssetEditing();

            //変更をUnityEditorに伝える//
            EditorUtility.SetDirty(data);

            //すべてのアセットを保存//
            AssetDatabase.SaveAssets();

            Debug.Log("Data updated.");
        }
    }
Exemplo n.º 14
0
 public void Add(ContentsData myStoreData)
 {
     //service.DbExport(myStoreData, new MySqlDbConnection());
     dataList.Add(myStoreData);
 }