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