Example #1
0
 bool    SetViewOption(FPointView fp, PointEasyOrHard bpp, bool bTest)
 {
     if (fp.ViewParts == bpp)
     {
         return(false);
     }
     if (!bTest)
     {
         fp.ViewParts = bpp;
     }
     return(true);
 }
Example #2
0
 bool SetViewOption(FPointView fp, PointDistort bpr, bool bTest)
 {
     if (fp.ViewTrans == bpr)
     {
         return(false);
     }
     if (!bTest)
     {
         fp.ViewTrans = bpr;
     }
     return(true);
 }
Example #3
0
        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();
        }
Example #4
0
 private bool ApplyFaceRandom(FPointView fp, bool tOnly)
 {
     return(SetViewOption(fp, PointDistort.eRandom, tOnly));
 }
Example #5
0
 private bool ApplyFaceCamera(FPointView fp, bool tOnly)
 {
     return(SetViewOption(fp, PointDistort.eFaceCamera, tOnly));
 }
Example #6
0
 private bool ApplyFaceFixed(FPointView fp, bool isTestOnly)
 {
     return(SetViewOption(fp, PointDistort.eFix, isTestOnly));
 }
Example #7
0
 private bool    ApplyShowFixed(FPointView fp, bool isTestOnly)
 {
     return(SetViewOption(fp, PointEasyOrHard.eFix, isTestOnly));
 }
Example #8
0
 private bool ApplyShowLess(FPointView fp, bool isTestOnly)
 {
     return(SetViewOption(fp, PointEasyOrHard.eShowLess, isTestOnly));
 }