示例#1
0
    public void AddStoryTile(StoryData data)
    {
        Debug.Log("Add Story Tile");
        RectTransform content  = scrollView.content;
        float         contentY = content.anchoredPosition.y;

        RectTransform tileTransfrom = Main.UIManager.InstantiateUI("UI/StoryTile", content);

        tileTransfrom.anchoredPosition = new Vector2(0, contentY);

        StoryTile storyTile = tileTransfrom.GetComponent <StoryTile>();

        if (storyTile != null)
        {
            storyTile.SetStoryData(data);
        }
    }
示例#2
0
    public void AddNewStoryTile()
    {
        Debug.Log("Add New Story Tile");
        RectTransform content = scrollView.content;

        RectTransform tileTransfrom = Main.UIManager.InstantiateUI("UI/StoryTile", content);

        tileTransfrom.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Top, 50, tileTransfrom.sizeDelta.y);

        StoryTile storyTile = tileTransfrom.GetComponent <StoryTile>();

        if (storyTile != null)
        {
            storyTile.SetStoryData(Main.storyDataManager.NewStory());
            storyTile.onSelected.AddListener(StorySelected);
        }
    }