public override void OnEnable() { resolutionMode = FindParameterOverride(x => x.resolutionMode); pixelSize = FindParameterOverride(x => x.pixelSize); resolution = FindParameterOverride(x => x.resolution); opacity = FindParameterOverride(x => x.opacity); dither = FindParameterOverride(x => x.dither); blueNoise = FindParameterOverride(x => x.bluenoise); presetsList = FindParameterOverride(x => x.presetsList); presetIndex = FindParameterOverride(x => x.presetIndex); string[] paths = AssetDatabase.FindAssets("RetroLookProColorPaletePresetsList"); string assetpath = AssetDatabase.GUIDToAssetPath(paths[0]); effectPresets tempPreset = (effectPresets)AssetDatabase.LoadAssetAtPath(assetpath, typeof(effectPresets)); palettePresets = new string[tempPreset.presetsList.Count]; for (int i = 0; i < palettePresets.Length; i++) { palettePresets[i] = tempPreset.presetsList[i].preset.effectName; } }
public override void OnEnable() { base.OnEnable(); var o = new PropertyFetcher <ColormapPalette_RLPRO>(serializedObject); intencity = Unpack(o.Find(x => x.intensity)); pixelSize = Unpack(o.Find(x => x.pixelSize)); opacity = Unpack(o.Find(x => x.opacity)); dither = Unpack(o.Find(x => x.dither)); blueNoise = Unpack(o.Find(x => x.bluenoise)); presetsList = Unpack(o.Find(x => x.presetsList)); presetIndex = Unpack(o.Find(x => x.presetIndex)); string[] paths = AssetDatabase.FindAssets("RetroLookProColorPaletePresetsList"); string assetpath = AssetDatabase.GUIDToAssetPath(paths[0]); effectPresets tempPreset = (effectPresets)AssetDatabase.LoadAssetAtPath(assetpath, typeof(effectPresets)); palettePresets = new string[tempPreset.presetsList.Count]; for (int i = 0; i < palettePresets.Length; i++) { palettePresets[i] = tempPreset.presetsList[i].preset.effectName; } }
void OnEnable() { so = new SerializedObject(target); //serializedObject pre = so.FindProperty("currPreset"); string[] paths = AssetDatabase.FindAssets("RetroLookProColorPaletePresetsList"); string assetpath = AssetDatabase.GUIDToAssetPath(paths[0]); effectPresets tempPreset = (effectPresets)AssetDatabase.LoadAssetAtPath(assetpath, typeof(effectPresets)); string[] texturePaths = AssetDatabase.FindAssets("editorRLImage"); string texturePath = AssetDatabase.GUIDToAssetPath(texturePaths[0]); texture = (Texture)AssetDatabase.LoadAssetAtPath(texturePath, typeof(Texture)); palettePresets = new string[tempPreset.presetsList.Count]; for (int i = 0; i < palettePresets.Length; i++) { palettePresets[i] = tempPreset.presetsList[i].preset.effectName; } animFolds = new AnimBool[11]; for (int i = 0; i < animFolds.Length; i++) { animFolds[i] = new AnimBool(); animFolds[i].valueChanged.AddListener(Repaint); } //pre = new SerializedObject(target) // Preset lalal = so.FindProperty("currPreset"); b_useBottomNoise = pre.FindPropertyRelative("useBottomNoise"); b_bottomHeight = pre.FindPropertyRelative("bottomHeight"); b_bottomIntensity = pre.FindPropertyRelative("bottomIntensity"); b_useBottomStretch = pre.FindPropertyRelative("useBottomStretch"); _enableTVmode = pre.FindPropertyRelative("_enableTVmode"); _VHSNoise = pre.FindPropertyRelative("_VHSNoise"); _textureIntensity = pre.FindPropertyRelative("_textureIntensity"); _VerticalOffsetFrequency = pre.FindPropertyRelative("_VerticalOffsetFrequency"); _verticalOffset = pre.FindPropertyRelative("_verticalOffset"); _offsetColor = pre.FindPropertyRelative("_offsetColor"); _OffsetDistortion = pre.FindPropertyRelative("_OffsetDistortion"); _scan = pre.FindPropertyRelative("_scan"); _adjustLines = pre.FindPropertyRelative("_adjustLines"); _scanLinesColor = pre.FindPropertyRelative("_scanLinesColor"); _hardScan = pre.FindPropertyRelative("_hardScan"); _resolution = pre.FindPropertyRelative("_resolution"); maskDark = pre.FindPropertyRelative("maskDark"); maskLight = pre.FindPropertyRelative("maskLight"); warp = pre.FindPropertyRelative("warp"); f_show_Bottom_Noise_mode = pre.FindPropertyRelative("f_show_Bottom_Noise_mode"); f_show_TV_mode = pre.FindPropertyRelative("f_show_TV_mode"); f_show_Bleed = pre.FindPropertyRelative("f_show_Bleed"); f_show_Fisheye = pre.FindPropertyRelative("f_show_Fisheye"); f_show_Vignette = pre.FindPropertyRelative("f_show_Vignette"); f_show_Noise = pre.FindPropertyRelative("f_show_Noise"); f_show_Jitter = pre.FindPropertyRelative("f_show_Jitter"); f_show_Signal = pre.FindPropertyRelative("f_show_Signal"); f_show_Artefacts = pre.FindPropertyRelative("f_show_Artefacts"); f_show_Bypass = pre.FindPropertyRelative("f_show_Bypass"); b_Bleed = pre.FindPropertyRelative("b_Bleed"); b_Mode = pre.FindPropertyRelative("b_Mode"); b_LinesMode = pre.FindPropertyRelative("b_LinesMode"); b_ScreenLinesNum = pre.FindPropertyRelative("b_ScreenLinesNum"); b_BleedAmount = pre.FindPropertyRelative("b_BleedAmount"); b_BleedCurve1 = pre.FindPropertyRelative("b_BleedCurve1"); b_BleedCurve2 = pre.FindPropertyRelative("b_BleedCurve2"); b_BleedCurve3 = pre.FindPropertyRelative("b_BleedCurve3"); b_BleedCurveSync = pre.FindPropertyRelative("b_BleedCurveSync"); b_BleedLength = pre.FindPropertyRelative("b_BleedLength"); b_BleedDebug = pre.FindPropertyRelative("b_BleedDebug"); f_Fisheye = pre.FindPropertyRelative("f_Fisheye"); f_FisheyeBend = pre.FindPropertyRelative("f_FisheyeBend"); f_FisheyeType = pre.FindPropertyRelative("f_FisheyeType"); f_CutoffX = pre.FindPropertyRelative("f_CutoffX"); f_CutoffY = pre.FindPropertyRelative("f_CutoffY"); f_FadeX = pre.FindPropertyRelative("f_FadeX"); f_FadeY = pre.FindPropertyRelative("f_FadeY"); v_Vignette = pre.FindPropertyRelative("v_Vignette"); v_VignetteAmount = pre.FindPropertyRelative("v_VignetteAmount"); v_VignetteSpeed = pre.FindPropertyRelative("v_VignetteSpeed"); //n_enableNoise = pre.FindPropertyRelative("n_enableNoise"); n_NoiseMode = pre.FindPropertyRelative("n_NoiseMode"); n_NoiseLinesAmountY = pre.FindPropertyRelative("n_NoiseLinesAmountY"); n_NoiseSignalProcessing = pre.FindPropertyRelative("n_NoiseSignalProcessing"); f_Granularity = pre.FindPropertyRelative("f_Granularity"); f_GranularityAmount = pre.FindPropertyRelative("f_GranularityAmount"); f_TapeNoise = pre.FindPropertyRelative("f_TapeNoise"); f_TapeNoiseTH = pre.FindPropertyRelative("f_TapeNoiseTH"); f_TapeNoiseAmount = pre.FindPropertyRelative("f_TapeNoiseAmount"); f_TapeNoiseSpeed = pre.FindPropertyRelative("f_TapeNoiseSpeed"); f_LineNoise = pre.FindPropertyRelative("f_LineNoise"); f_LineNoiseAmount = pre.FindPropertyRelative("f_LineNoiseAmount"); f_LineNoiseSpeed = pre.FindPropertyRelative("f_LineNoiseSpeed"); //j_enableJitter = pre.FindPropertyRelative("j_enableJitter"); j_ScanLines = pre.FindPropertyRelative("j_ScanLines"); j_ScanLinesWidth = pre.FindPropertyRelative("j_ScanLinesWidth"); j_LinesFloat = pre.FindPropertyRelative("j_LinesFloat"); j_LinesSpeed = pre.FindPropertyRelative("j_LinesSpeed"); j_Stretch = pre.FindPropertyRelative("j_Stretch"); j_TwitchHorizontal = pre.FindPropertyRelative("j_TwitchHorizontal"); j_TwitchHorizFreq = pre.FindPropertyRelative("j_TwitchHorizFreq"); j_TwitchVertical = pre.FindPropertyRelative("j_TwitchVertical"); j_TwitchVertFreq = pre.FindPropertyRelative("j_TwitchVertFreq"); j_JitterHorizontal = pre.FindPropertyRelative("j_JitterHorizontal"); j_JitterHorizAmount = pre.FindPropertyRelative("j_JitterHorizAmount"); j_JitterVertical = pre.FindPropertyRelative("j_JitterVertical"); j_VertAmount = pre.FindPropertyRelative("j_VertAmount"); j_VertSpeed = pre.FindPropertyRelative("j_VertSpeed"); p_PictureCorrection = pre.FindPropertyRelative("p_PictureCorrection"); p_PictureCorr1 = pre.FindPropertyRelative("p_PictureCorr1"); p_PictureCorr2 = pre.FindPropertyRelative("p_PictureCorr2"); p_PictureCorr3 = pre.FindPropertyRelative("p_PictureCorr3"); p_PictureShift1 = pre.FindPropertyRelative("p_PictureShift1"); p_PictureShift2 = pre.FindPropertyRelative("p_PictureShift2"); p_PictureShift3 = pre.FindPropertyRelative("p_PictureShift3"); f_SignalNoise = pre.FindPropertyRelative("f_SignalNoise"); f_SignalNoiseAmount = pre.FindPropertyRelative("f_SignalNoiseAmount"); f_SignalNoisePower = pre.FindPropertyRelative("f_SignalNoisePower"); p_Gamma = pre.FindPropertyRelative("p_Gamma"); a_Artefacts = pre.FindPropertyRelative("a_Artefacts"); a_ArtefactsAmount = pre.FindPropertyRelative("a_ArtefactsAmount"); a_ArtefactsFadeAmount = pre.FindPropertyRelative("a_ArtefactsFadeAmount"); a_ArtefactsColor = pre.FindPropertyRelative("a_ArtefactsColor"); a_ArtefactsThreshold = pre.FindPropertyRelative("a_ArtefactsThreshold"); a_ArtefactsDebug = pre.FindPropertyRelative("a_ArtefactsDebug"); //colorPalette resolutionMode = pre.FindPropertyRelative("resolutionMode"); resolutionModeIndex = pre.FindPropertyRelative("resolutionModeIndex"); resolution = pre.FindPropertyRelative("resolution"); pixelSize = pre.FindPropertyRelative("pixelSize"); dither = pre.FindPropertyRelative("dither"); opacity = pre.FindPropertyRelative("opacity"); colorPresetIndex = pre.FindPropertyRelative("colorPresetIndex"); f_show_colorPalette = pre.FindPropertyRelative("f_show_colorPalette"); enableColorPalette = pre.FindPropertyRelative("enableColorPalette"); // independentTimeOn = pre.FindPropertyRelative("independentTimeOn"); enableCustomTexture = pre.FindPropertyRelative("enableCustomTexture"); bypassTex = pre.FindPropertyRelative("bypassTex"); spriteTex = pre.FindPropertyRelative("spriteTex"); }