コード例 #1
0
ファイル: UITimeline.cs プロジェクト: GreenCalx/LD47
    // REDO ME
    private void updateUI()
    {
        ITimeline active_tl = __displayedTimeline;

        if (active_tl == null)
        {
            return;
        }
        bool is_previous_tl = (active_tl as PlayerTimeline).IsPrevious();

        // to update time units sprites
        Transform current_tick_square_transform = null;

        if (null == __time_units)
        {
            if (!tryRefreshTimeUnits())
            {
                return;
            }
        }


        for (int i = 0; i < __time_units.Length; i++)
        {
            bool            square_is_active = active_tl.IsCursorValuable(i);
            UITimelineInput curr_unit        = __time_units[i];

            // show enabled or disabled for curr unit
            if (!square_is_active)
            {
                __time_units[i].showDisabled();
                continue;
            }

            __time_units[i].showEnabled();

            updateSquareInputImage(i, (active_tl.GetCursorValue(i) as PlayerTimelineValue).GetValue());

            // RECORD exclusive logic for current timeline
            if (__WM.IM.CurrentMode == InputManager.Mode.RECORD && !is_previous_tl)
            {
                // Hide forward squares
                if (i > (active_tl as PlayerTimeline).getTickForTimeUnits())
                {
                    curr_unit.hide();
                }
                // Show none as next input at the last_tick position
                else if (i == active_tl.GetCursorIndex() + 1)
                {
                    if (Constants.ShowDefaultTileOnCursor)
                    {
                        __time_units[i].changeSprite(ui_input_none);
                    }
                }
            }
        }//! for time units
        // update timeline animator
        update_time(active_tl.GetCursorIndex() + 1);
    }//! updateUI