Beispiel #1
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);
        }
    }
Beispiel #2
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);
        }
    }
Beispiel #3
0
    public void StorySelected(StoryTile storyTile)
    {
        selectedStory = storyTile;

        switch (eState)
        {
        case EStoryScreenState.EShowAll:
            SetState(EStoryScreenState.EStoryOpen);
            break;

        case EStoryScreenState.EStoryOpen:
            SetState(EStoryScreenState.EShowAll);
            break;

        case EStoryScreenState.EPlotOpen:
            SetState(EStoryScreenState.EShowAll);
            break;

        default:
            break;
        }

        Debug.Log("StorySelected: " + storyTile.GetStoryData().ToStringValues());
    }