コード例 #1
0
    protected override void Awake()
    {
        base.Awake();

        if (useScrollView && autoCalculateContentBounds && statsToDisplay.Length > 0)
        {
            Rect[] rects = new Rect[statsToDisplay.Length];
            for (int i = 0; i < statsToDisplay.Length; i++)
            {
                rects[i] = statsToDisplay[i].bounds;
            }
            Rect boundsUnion = RoarUIUtil.UnionRect(rects);
            ScrollViewContentWidth  = boundsUnion.width + Mathf.Abs(boundsUnion.x);
            ScrollViewContentHeight = boundsUnion.height + Mathf.Abs(boundsUnion.y);
        }

        foreach (Stat stat in statsToDisplay)
        {
            if (stat.valueFormat == null || stat.valueFormat.Length == 0)
            {
                stat.valueFormat = defaultValueFormat;
            }
        }

        RoarManager.propertiesChangeEvent += LoadPropertyData;
    }
コード例 #2
0
    protected override void Awake()
    {
        base.Awake();

        if (useScrollView && autoCalculateContentBounds && statsToDisplay.Length > 0)
        {
            Rect[] rects       = new Rect[statsToDisplay.Length];
            Rect   boundsUnion = RoarUIUtil.UnionRect(rects);
            ScrollViewContentWidth  = boundsUnion.width + Mathf.Abs(boundsUnion.x);
            ScrollViewContentHeight = boundsUnion.height + Mathf.Abs(boundsUnion.y);
        }

        foreach (Prop stat in statsToDisplay)
        {
            if (stat.valueFormat == null || stat.valueFormat.Length == 0)
            {
                stat.valueFormat = defaultValueFormat;
            }
        }
    }