/* #region Encode & Decode * public override CfgEncoder Encode() => this.EncodeUnrecognized() * .Add_Reference("d", diffuse) * .Add_Reference("h", heightMap) * .Add_Reference("bump", normalMap) * .Add_Reference("g", gloss) * .Add_Reference("r", reflectivity) * .Add_Reference("ao", ambient) * .Add_Reference("lp", lastProduct) * .Add("tw", width) * .Add("th", height) * .Add_Bool("col", isColor) * .Add_String("n", name) * .Add("sp", selectedProfile); * * public override bool Decode(string tg, string data) * { * switch (tg) * { * case "d": data.Decode_Reference(ref diffuse); break; * case "h": data.Decode_Reference(ref heightMap); break; * case "bump": data.Decode_Reference(ref normalMap); break; * case "g": data.Decode_Reference(ref gloss); break; * case "r": data.Decode_Reference(ref reflectivity); break; * case "ao": data.Decode_Reference(ref ambient); break; * case "lp": data.Decode_Reference(ref lastProduct); break; * case "tw": width = data.ToInt(); break; * case "th": height = data.ToInt(); break; * case "col": isColor = data.ToBool(); break; * case "n": name = data; break; * case "sp": selectedProfile = data.ToInt(); break; * default: return false; * } * return true; * } #endregion */ #region Inspect public bool Inspect() { var changed = false; var id = InspectedImageMeta; if (InspectedPainter && id != null) { "Editing:".write(40); pegi.write(id.texture2D); pegi.nl(); } "Diffuse".edit("Texture that contains Color of your object. Usually used in _MainTex field.", 70, ref diffuse).nl(ref changed); "Height".edit("Greyscale Texture which represents displacement of your surface. Can be used for parallax effect" + "or height based terrain blending.", 70, ref heightMap).nl(ref changed); "Normal".edit("Normal map - a pinkish texture which modifies normal vector, adding a sense of relief. Normal can also be " + "generated from Height", 70, ref normalMap).nl(ref changed); "Gloss".edit("How smooth the surface is. Polished metal - is very smooth, while rubber is usually not.", 70, ref gloss).nl(ref changed); "Reflectivity".edit("Best used to add a feel of wear to the surface. Reflectivity blocks some of the incoming light.", 70, ref reflectivity).nl(ref changed); "Ambient".edit("Ambient is an approximation of how much light will fail to reach a given segment due to it's indentation in the surface. " + "Ambient map may look a bit similar to height map in some cases, but will more clearly outline shapes on the surface.", 70, ref ambient).nl(ref changed); "Last Result".edit("Whatever you produce, will be stored here, also it can be reused.", 70, ref lastProduct).nl(ref changed); if (!InspectedPainter) { var firstTex = GetAnyTexture(); "width:".edit(ref width).nl(ref changed); "height".edit(ref height).nl(ref changed); if (firstTex && "Match Source".Click().nl(ref changed)) { width = firstTex.width; height = firstTex.height; } "is Color".toggle(ref isColor).nl(ref changed); } pegi.select_Index(ref selectedProfile, Cfg.texturePackagingSolutions); if (icon.Add.Click("New Texture Packaging Profile").nl()) { QcUtils.AddWithUniqueNameAndIndex(Cfg.texturePackagingSolutions); selectedProfile = Cfg.texturePackagingSolutions.Count - 1; Cfg.SetToDirty(); } if ((selectedProfile < Cfg.texturePackagingSolutions.Count)) { if (Cfg.texturePackagingSolutions[selectedProfile].Inspect(this).nl(ref changed)) { Cfg.SetToDirty(); } } return(changed); }
public override bool Inspect() { var changed = false; var rtp = PainterCamera.Inst; if ("Modules".enter(ref inspectedItems, 10, false).nl_ifNotEntered() && rtp.ModulsInspect().nl(ref changed)) { rtp.SetToDirty(); } if ("Lists".enter(ref inspectedItems, 11).nl(ref changed)) { InspectLists().changes(ref changed); } if ("Painter Camera".enter(ref inspectedItems, 14).nl_ifNotEntered()) { PainterCamera.Inst.DependenciesInspect(true); } if ("Depth Projector Camera".enter(ref inspectedItems, 15).nl()) { if (DepthProjectorCamera.Instance) { DepthProjectorCamera.Instance.Nested_Inspect().nl(); } else if ("Instantiate".Click()) { PainterCamera.GetOrCreateProjectorCamera(); } } if ("Inspector & Debug".enter(ref inspectedItems, 16).nl()) { QcUtils.InspectInspector(); } if (inspectedItems == -1) { if ("Painter Data Encode / Decode Test".Click().nl()) { this.SaveCfgData(); matMetas.Clear(); this.LoadCfgData(); } #if UNITY_EDITOR if ("Enable PlayTime UI".toggleIcon(ref enablePainterUIonPlay).nl()) { MeshEditorManager.Inst.StopEditingMesh(); } "Hide documentation".toggleIcon(ref hideDocumentation).changes(ref changed); MsgPainter.aboutDisableDocumentation.DocumentationClick(); pegi.nl(); "Teaching Notifications".toggleIcon("Will show some notifications on the screen", ref showTeachingNotifications).nl(); "Where to save content".nl(PEGI_Styles.ListLabel); "Textures".edit(60, ref texturesFolderName).nl(); "Atlases: {0}/".F(texturesFolderName).edit(120, ref atlasFolderName).nl(); "Materials".edit(60, ref materialsFolderName).nl(); "Meshes".edit(60, ref meshesFolderName).nl(); if (icon.Discord.Click("Join Discord", 64)) { PlaytimePainter.Open_Discord(); } if (icon.Docs.Click("Open Asset Documentation", 64)) { PlaytimePainter.OpenWWW_Documentation(); } if (icon.Email.Click("Report a bug / send suggestion / ask question.", 64)) { PlaytimePainter.Open_Email(); } pegi.nl(); LazyLocalization.LanguageSelection().nl(); #endif } base.Inspect().nl(ref changed); return(changed); }
public override bool Inspect() { pegi.toggleDefaultInspector(this).nl(); var changed = false; if ("Camera Modules".enter(ref _inspectedStuff, 0, false).nl_ifNotEntered()) { _modulesMeta.edit_List(ref CameraModuleBase.modules, CameraModuleBase.all).changes(ref changed); if (!_modulesMeta.Inspecting) { if ("Find Modules".Click()) { CameraModuleBase.RefreshModules(); } if ("Delete Modules".Click().nl()) { CameraModuleBase.modules = null; } } pegi.nl(); } if ("Depth Projector Camera".enter(ref _inspectedStuff, 1).nl()) { if (DepthProjectorCamera.Instance) { DepthProjectorCamera.Instance.Nested_Inspect().nl(); } else if ("Instantiate".Click()) { GetOrCreateProjectorCamera(); } } if ("Painter Camera".enter(ref _inspectedStuff, 2).nl_ifNotEntered()) { DependenciesInspect(true); } if ("Data && Config".enter(ref _inspectedStuff, 3).nl_ifEntered()) { if (Data) { Data.Nested_Inspect().nl(ref changed); } else { "NO CONFIG Scriptable Object".writeWarning(); pegi.nl(); DependenciesInspect(true); } } if (_inspectedStuff == -1 && Data) { Data.ClickHighlight(); } pegi.nl(); if ("Inspector & Debug".enter(ref _inspectedStuff, 4).nl()) { QcUtils.InspectInspector(); } pegi.nl(); return(changed); }