bool SetViewOption(FPointView fp, PointEasyOrHard bpp, bool bTest) { if (fp.ViewParts == bpp) { return(false); } if (!bTest) { fp.ViewParts = bpp; } return(true); }
bool SetViewOption(FPointView fp, PointDistort bpr, bool bTest) { if (fp.ViewTrans == bpr) { return(false); } if (!bTest) { fp.ViewTrans = bpr; } return(true); }
public override void OnInspectorGUI() { FPointView holder = (FPointView)target; DrawDefaultInspector(); GUILayout.Box("", GUILayout.ExpandWidth(true)); GUILayout.Label("Color the point if you like" , Utils.JfGUIStyle.LABEL_TEXT_STYLE , GUILayout.ExpandWidth(true)); GUILayout.Label( "color the position holder only,has no use in game logic" , Utils.JfGUIStyle.LABEL_TEXT_STYLE , GUILayout.ExpandWidth(true)); var ct = (ColorMaterialGallery.EditTagType)EditorGUILayout .EnumPopup("ColorTag" , holder.ColorTag , GUILayout.ExpandWidth(true)); if (holder.ColorTag != ct) { var rend = holder.GetComponent <Renderer>(); Object[] gos = new Object[] { holder, rend, }; Undo.RecordObjects(gos, "Level Inspector"); holder.ColorTag = ct; var mg = holder.GetComponentInParent <ColorMaterialGallery>(); rend.material = mg.GetSchemaMaterial(ct); Undo.FlushUndoRecordObjects(); } GUILayout.Box("", GUILayout.ExpandWidth(true)); serializedObject.ApplyModifiedProperties(); }
private bool ApplyFaceRandom(FPointView fp, bool tOnly) { return(SetViewOption(fp, PointDistort.eRandom, tOnly)); }
private bool ApplyFaceCamera(FPointView fp, bool tOnly) { return(SetViewOption(fp, PointDistort.eFaceCamera, tOnly)); }
private bool ApplyFaceFixed(FPointView fp, bool isTestOnly) { return(SetViewOption(fp, PointDistort.eFix, isTestOnly)); }
private bool ApplyShowFixed(FPointView fp, bool isTestOnly) { return(SetViewOption(fp, PointEasyOrHard.eFix, isTestOnly)); }
private bool ApplyShowLess(FPointView fp, bool isTestOnly) { return(SetViewOption(fp, PointEasyOrHard.eShowLess, isTestOnly)); }