示例#1
0
    public void OnLoad(GUISkin skin)
    {
        this.customSkin = skin;
        string str    = "Cinema Suite/Cinema Director/";
        string str2   = ".png";
        float  min    = 0f;
        float  @float = 60f;

        if (EditorPrefs.HasKey("DirectorControl.areaX"))
        {
            min = EditorPrefs.GetFloat("DirectorControl.areaX");
        }
        if (EditorPrefs.HasKey("DirectorControl.areaWidth"))
        {
            @float = EditorPrefs.GetFloat("DirectorControl.areaWidth");
        }
        if (EditorPrefs.HasKey("DirectorControl.isSnappingEnabled"))
        {
            this.directorState.IsSnapEnabled = EditorPrefs.GetBool("DirectorControl.isSnappingEnabled");
        }
        base.SetShownHRangeInsideMargins(min, min + @float);
        if (EditorPrefs.HasKey("DirectorControl.SidebarWidth"))
        {
            this.track_header_area_width = EditorPrefs.GetFloat("DirectorControl.SidebarWidth");
        }
        if (this.playButton == null)
        {
            this.playButton = EditorGUIUtility.Load(str + "Director_PlayIcon" + str2) as Texture;
        }
        if (this.playButton == null)
        {
            Debug.Log("Play button icon missing from Resources folder.");
        }
        if (this.pauseButton == null)
        {
            this.pauseButton = EditorGUIUtility.Load(str + "Director_PauseIcon" + str2) as Texture;
        }
        if (this.pauseButton == null)
        {
            Debug.Log("Pause button missing from Resources folder.");
        }
        if (this.stopButton == null)
        {
            this.stopButton = EditorGUIUtility.Load(str + "Director_StopIcon" + str2) as Texture;
        }
        if (this.stopButton == null)
        {
            Debug.Log("Stop button icon missing from Resources folder.");
        }
        if (this.frameForwardButton == null)
        {
            this.frameForwardButton = EditorGUIUtility.Load(str + "Director_FrameForwardIcon" + str2) as Texture;
        }
        if (this.frameForwardButton == null)
        {
            Debug.Log("Director_FrameForwardIcon.png missing from Resources folder.");
        }
        if (this.frameBackwardButton == null)
        {
            this.frameBackwardButton = EditorGUIUtility.Load(str + "Director_FrameBackwardIcon" + str2) as Texture;
        }
        if (this.frameBackwardButton == null)
        {
            Debug.Log("Director_FrameBackwardIcon.png missing from Resources folder.");
        }
        if (this.scrubHead == null)
        {
            this.scrubHead = EditorGUIUtility.Load(str + "Director_Playhead" + str2) as Texture;
        }
        if (this.scrubHead == null)
        {
            Debug.Log("Director_Playhead missing from Resources folder.");
        }
        if (this.scrubDurationHead == null)
        {
            this.scrubDurationHead = EditorGUIUtility.Load(str + "Director_Duration_Playhead" + str2) as Texture;
        }
        if (this.scrubDurationHead == null)
        {
            Debug.Log("Director_Duration_Playhead missing from Resources folder.");
        }
        if (this.customSkin != null)
        {
            DirectorControlStyles.BoxSelect     = this.customSkin.FindStyle("BoxSelect");
            DirectorControlStyles.UpArrowIcon   = this.customSkin.FindStyle("UpArrowIcon");
            DirectorControlStyles.DownArrowIcon = this.customSkin.FindStyle("DownArrowIcon");
        }
        else
        {
            DirectorControlStyles.BoxSelect     = "box";
            DirectorControlStyles.UpArrowIcon   = "box";
            DirectorControlStyles.DownArrowIcon = "box";
        }
        TrackGroupControl.InitStyles(this.customSkin);
        TimelineTrackControl.InitStyles(this.customSkin);
    }
示例#2
0
    public void OnLoad(GUISkin skin)
    {
        customSkin = skin;
        float num  = 0f;
        float num2 = 60f;

        if (EditorPrefs.HasKey("DirectorControl.areaX"))
        {
            num = EditorPrefs.GetFloat("DirectorControl.areaX");
        }
        if (EditorPrefs.HasKey("DirectorControl.areaWidth"))
        {
            num2 = EditorPrefs.GetFloat("DirectorControl.areaWidth");
        }
        if (EditorPrefs.HasKey("DirectorControl.isSnappingEnabled"))
        {
            directorState.IsSnapEnabled = EditorPrefs.GetBool("DirectorControl.isSnappingEnabled");
        }
        float expr_64 = num;

        SetShownHRangeInsideMargins(expr_64, expr_64 + num2);
        if (EditorPrefs.HasKey("DirectorControl.SidebarWidth"))
        {
            track_header_area_width = EditorPrefs.GetFloat("DirectorControl.SidebarWidth");
        }
        if (this.playButton == null)
        {
            this.playButton = (Resources.Load("Director_PlayIcon", typeof(Texture)) as Texture);
        }
        if (this.playButton == null)
        {
            Debug.Log("Play button icon missing from Resources folder.");
        }
        if (this.pauseButton == null)
        {
            this.pauseButton = (Resources.Load("Director_PauseIcon", typeof(Texture)) as Texture);
        }
        if (this.pauseButton == null)
        {
            Debug.Log("Pause button missing from Resources folder.");
        }
        if (this.stopButton == null)
        {
            this.stopButton = (Resources.Load("Director_StopIcon", typeof(Texture)) as Texture);
        }
        if (this.stopButton == null)
        {
            Debug.Log("Stop button icon missing from Resources folder.");
        }
        if (this.frameForwardButton == null)
        {
            this.frameForwardButton = (Resources.Load("Director_FrameForwardIcon", typeof(Texture)) as Texture);
        }
        if (this.frameForwardButton == null)
        {
            Debug.Log("Director_FrameForwardIcon.png missing from Resources folder.");
        }
        if (this.frameBackwardButton == null)
        {
            this.frameBackwardButton = (Resources.Load("Director_FrameBackwardIcon", typeof(Texture)) as Texture);
        }
        if (frameBackwardButton == null)
        {
            Debug.Log("Director_FrameBackwardIcon.png missing from Resources folder.");
        }
        if (scrubHead == null)
        {
            scrubHead = Resources.Load("Director_Playhead", typeof(Texture)) as Texture;
        }
        if (scrubHead == null)
        {
            Debug.Log("Director_Playhead missing from Resources folder.");
        }
        if (scrubDurationHead == null)
        {
            scrubDurationHead = (Resources.Load("Director_Duration_Playhead", typeof(Texture)) as Texture);
        }
        if (scrubDurationHead == null)
        {
            Debug.Log("Director_Duration_Playhead missing from Resources folder.");
        }
        DirectorControlStyles.BoxSelect     = customSkin.FindStyle("BoxSelect");
        DirectorControlStyles.UpArrowIcon   = customSkin.FindStyle("UpArrowIcon");
        DirectorControlStyles.DownArrowIcon = customSkin.FindStyle("DownArrowIcon");
        TrackGroupControl.InitStyles(customSkin);
        TimelineTrackControl.InitStyles(customSkin);
    }