private void ReadMasterDataFromFile()
    {
        // TODO: 抽象クラスにまとめるために、マスタファイルパス取得処理を、抽象メソッド化する.
        List <Dictionary <string, object> > rawDataList = CsvParser.ReadAndParse(MasterFilePath.Fukidashi);

        foreach (var rawData in rawDataList)
        {
            ParseMasterData(rawData);
            var item = new MasterItemFukidashi(rawData);
            _items.Add(item);
        }
    }
Beispiel #2
0
    private Fukidashi InstantiateObject(MasterItemFukidashi master, Action <Fukidashi> onTouch)
    {
        GameObject fukidashiGameObj = Instantiate(_fukidashiPrefab, _canvas.transform);
        Fukidashi  fukidashi        = fukidashiGameObj.GetComponent <Fukidashi>();

        Debug.Assert(fukidashi != null);

        fukidashi.SetMasterData(master);
        fukidashi.TouchCallback = onTouch;

        return(fukidashi);
    }
Beispiel #3
0
    public void SetMasterData(MasterItemFukidashi master)
    {
        GetComponent <RectTransform>().anchoredPosition = new Vector3((float)master.X, (float)master.Y, 0.0f);

        TextMeshProUGUI[] texts = this.GetComponentsInChildren <TextMeshProUGUI>();
        if (texts.Length >= 1)
        {
            texts[0].text     = master.Title;
            texts[0].fontSize = FontSize;
        }
        else
        {
            Debug.AssertFormat(false, "Text Object was not set.");
        }

        _answerId = master.AnswerId;
    }