示例#1
0
        public static T FindPreset <T>(string name) where T : PumkinPreset
        {
            object preset = null;

            if (typeof(T) == typeof(PumkinsCameraPreset))
            {
                preset = CameraPresets.Find(o => o.name.ToLower() == name.ToLower());
            }
            else if (typeof(T) == typeof(PumkinsCameraPreset))
            {
                preset = PosePresets.Find(o => o.name.ToLower() == name.ToLower());
            }
            else if (typeof(T) == typeof(PumkinsBlendshapePreset))
            {
                preset = BlendshapePresets.Find(o => o.name.ToLower() == name.ToLower());
            }

            return((T)preset);
        }
示例#2
0
        public static int GetPresetIndex <T>(T preset) where T : PumkinPreset
        {
            int i = -1;

            if (typeof(T) == typeof(PumkinsCameraPreset))
            {
                i = CameraPresets.IndexOf(preset as PumkinsCameraPreset);
            }
            else if (typeof(T) == typeof(PumkinsPosePreset))
            {
                i = PosePresets.IndexOf(preset as PumkinsPosePreset);
            }
            else if (typeof(T) == typeof(PumkinsBlendshapePreset))
            {
                i = BlendshapePresets.IndexOf(preset as PumkinsBlendshapePreset);
            }

            return(i);
        }
示例#3
0
        public static int GetPresetIndex <T>(string name) where T : PumkinPreset
        {
            int i = -1;

            if (typeof(T) == typeof(PumkinsCameraPreset))
            {
                i = CameraPresets.FindIndex(o => o.name.ToLower() == name.ToLower());
            }
            else if (typeof(T) == typeof(PumkinsPosePreset))
            {
                i = PosePresets.FindIndex(o => o.name.ToLower() == name.ToLower());
            }
            else if (typeof(T) == typeof(PumkinsBlendshapePreset))
            {
                i = BlendshapePresets.FindIndex(o => o.name.ToLower() == name.ToLower());
            }

            return(i);
        }