public void OnEnable()
 {
   this.m_CurveLibraryType = this.GetCurveLibraryTypeFromExtension(Path.GetExtension(AssetDatabase.GetAssetPath(this.target.GetInstanceID())).TrimStart('.'));
   this.m_GenericPresetLibraryInspector = new GenericPresetLibraryInspector<CurvePresetLibrary>(this.target, this.GetHeader(), new System.Action<string>(this.OnEditButtonClicked));
   this.m_GenericPresetLibraryInspector.presetSize = new Vector2(72f, 20f);
   this.m_GenericPresetLibraryInspector.lineSpacing = 5f;
 }
Пример #2
0
 public void OnEnable()
 {
     this.m_CurveLibraryType = this.GetCurveLibraryTypeFromExtension(Path.GetExtension(AssetDatabase.GetAssetPath(this.target.GetInstanceID())).TrimStart('.'));
     this.m_GenericPresetLibraryInspector             = new GenericPresetLibraryInspector <CurvePresetLibrary>(this.target, this.GetHeader(), new System.Action <string>(this.OnEditButtonClicked));
     this.m_GenericPresetLibraryInspector.presetSize  = new Vector2(72f, 20f);
     this.m_GenericPresetLibraryInspector.lineSpacing = 5f;
 }
Пример #3
0
        public void OnEnable()
        {
            string filePath = AssetDatabase.GetAssetPath(target.GetInstanceID());

            m_CurveLibraryType = GetCurveLibraryTypeFromExtension(Path.GetExtension(filePath).TrimStart('.'));
            m_GenericPresetLibraryInspector             = new GenericPresetLibraryInspector <CurvePresetLibrary>(target, GetHeader(), OnEditButtonClicked);
            m_GenericPresetLibraryInspector.presetSize  = new Vector2(72, 20);
            m_GenericPresetLibraryInspector.lineSpacing = 5f;
        }
Пример #4
0
        public void OnEnable()
        {
            string assetPath = AssetDatabase.GetAssetPath(base.target.GetInstanceID());

            char[] trimChars = new char[] { '.' };
            this.m_CurveLibraryType = this.GetCurveLibraryTypeFromExtension(Path.GetExtension(assetPath).TrimStart(trimChars));
            this.m_GenericPresetLibraryInspector             = new GenericPresetLibraryInspector <CurvePresetLibrary>(base.target, this.GetHeader(), new Action <string>(this.OnEditButtonClicked));
            this.m_GenericPresetLibraryInspector.presetSize  = new Vector2(72f, 20f);
            this.m_GenericPresetLibraryInspector.lineSpacing = 5f;
        }
        private static string GetExtension(CurveLibraryType curveLibraryType)
        {
            switch (curveLibraryType)
            {
                case CurveLibraryType.Unbounded:
                    return PresetLibraryLocations.GetCurveLibraryExtension(false);

                case CurveLibraryType.NormalizedZeroToOne:
                    return PresetLibraryLocations.GetCurveLibraryExtension(true);
            }
            Debug.LogError("Enum not handled!");
            return "curves";
        }
		private static string GetExtension(CurveLibraryType curveLibraryType)
		{
			if (curveLibraryType == CurveLibraryType.Unbounded)
			{
				return PresetLibraryLocations.GetCurveLibraryExtension(false);
			}
			if (curveLibraryType != CurveLibraryType.NormalizedZeroToOne)
			{
				Debug.LogError("Enum not handled!");
				return "curves";
			}
			return PresetLibraryLocations.GetCurveLibraryExtension(true);
		}
Пример #7
0
 private static string GetExtension(CurveLibraryType curveLibraryType)
 {
     if (curveLibraryType == CurveLibraryType.Unbounded)
     {
         return(PresetLibraryLocations.GetCurveLibraryExtension(false));
     }
     if (curveLibraryType != CurveLibraryType.NormalizedZeroToOne)
     {
         Debug.LogError("Enum not handled!");
         return("curves");
     }
     return(PresetLibraryLocations.GetCurveLibraryExtension(true));
 }
        private static string GetExtension(CurveLibraryType curveLibraryType)
        {
            switch (curveLibraryType)
            {
            case CurveLibraryType.Unbounded:
                return(PresetLibraryLocations.GetCurveLibraryExtension(false));

            case CurveLibraryType.NormalizedZeroToOne:
                return(PresetLibraryLocations.GetCurveLibraryExtension(true));
            }
            Debug.LogError("Enum not handled!");
            return("curves");
        }
Пример #9
0
        private Rect GetCurveRanges()
        {
            CurveLibraryType curveLibraryType = this.m_CurveLibraryType;

            if (curveLibraryType == CurveLibraryType.Unbounded)
            {
                return(default(Rect));
            }
            if (curveLibraryType != CurveLibraryType.NormalizedZeroToOne)
            {
                return(default(Rect));
            }
            return(new Rect(0f, 0f, 1f, 1f));
        }
Пример #10
0
        private string GetHeader()
        {
            CurveLibraryType curveLibraryType = this.m_CurveLibraryType;

            if (curveLibraryType == CurveLibraryType.Unbounded)
            {
                return("Curve Preset Library");
            }
            if (curveLibraryType != CurveLibraryType.NormalizedZeroToOne)
            {
                return("Curve Preset Library ?");
            }
            return("Curve Preset Library (Normalized 0 - 1)");
        }
Пример #11
0
        private string GetHeader()
        {
            CurveLibraryType curveLibraryType = this.m_CurveLibraryType;
            string           result;

            if (curveLibraryType != CurveLibraryType.NormalizedZeroToOne)
            {
                if (curveLibraryType != CurveLibraryType.Unbounded)
                {
                    result = "Curve Preset Library ?";
                }
                else
                {
                    result = "Curve Preset Library";
                }
            }
            else
            {
                result = "Curve Preset Library (Normalized 0 - 1)";
            }
            return(result);
        }
Пример #12
0
        private Rect GetCurveRanges()
        {
            CurveLibraryType curveLibraryType = this.m_CurveLibraryType;
            Rect             result;

            if (curveLibraryType != CurveLibraryType.NormalizedZeroToOne)
            {
                if (curveLibraryType != CurveLibraryType.Unbounded)
                {
                    result = default(Rect);
                }
                else
                {
                    result = default(Rect);
                }
            }
            else
            {
                result = new Rect(0f, 0f, 1f, 1f);
            }
            return(result);
        }
		public static string GetBasePrefText(CurveLibraryType curveLibraryType)
		{
			return CurvePresetsContentsForPopupWindow.GetExtension(curveLibraryType);
		}
Пример #14
0
 public static string GetBasePrefText(CurveLibraryType curveLibraryType) =>
 GetExtension(curveLibraryType);
 public CurvePresetsContentsForPopupWindow(AnimationCurve animCurve, CurveLibraryType curveLibraryType, Action <AnimationCurve> presetSelectedCallback)
 {
     this.m_CurveLibraryType       = curveLibraryType;
     this.m_Curve                  = animCurve;
     this.m_PresetSelectedCallback = presetSelectedCallback;
 }
 public static string GetBasePrefText(CurveLibraryType curveLibraryType)
 {
     return(GetExtension(curveLibraryType));
 }
 public static string GetBasePrefText(CurveLibraryType curveLibraryType)
 {
     return GetExtension(curveLibraryType);
 }
 public CurvePresetsContentsForPopupWindow(AnimationCurve animCurve, CurveLibraryType curveLibraryType, Action<AnimationCurve> presetSelectedCallback)
 {
     this.m_CurveLibraryType = curveLibraryType;
     this.m_Curve = animCurve;
     this.m_PresetSelectedCallback = presetSelectedCallback;
 }
Пример #19
0
 public static string GetBasePrefText(CurveLibraryType curveLibraryType)
 {
     return(CurvePresetsContentsForPopupWindow.GetExtension(curveLibraryType));
 }