Exemplo n.º 1
0
    // ===========================================================
    // Constants
    // ===========================================================

    // ===========================================================
    // Methods
    // ===========================================================

    public static EnergyBar3DBase Create3DBar(EnergyBar3DBase.BarType type) {
        var panel = MadPanel.UniqueOrNull();
        if (panel == null) {
            EditorUtility.DisplayDialog("Not Initialized", "You have to initialize EBT first", "OK");
            MadInitTool.ShowWindow();
            return null;
        } else {
            switch (type) {
                case EnergyBar3DBase.BarType.Filled:
                    return FillRenderer3DBuilder.Create();
                case EnergyBar3DBase.BarType.Repeated:
                    return RepeatRenderer3DBuilder.Create();
                default:
                    Debug.LogError("Unknown bar type: " + type);
                    return null;
            }
            
        }
    }
Exemplo n.º 2
0
    // ===========================================================
    // Static Methods
    // ===========================================================

    public static RepeatedRenderer3D Create() {
        var panel = MadPanel.UniqueOrNull();

        if (panel == null) {
            var panels = MadPanel.All();
            if (panels.Length == 0) {
                if (EditorUtility.DisplayDialog(
                "Init Scene?",
                "Scene not initialized for 3D bars. You cannot place new bar without proper initialization. Do it now?",
                "Yes", "No")) {
                    MadInitTool.ShowWindow();
                }
            } else {
                CreateMeshBarTool.ShowWindow(EnergyBar3DBase.BarType.Repeated);
            }

            return null;
        } else {
            return Create(panel);
        }
    }
 // ===========================================================
 // Static Methods
 // ===========================================================
 
 public static FilledRenderer3D Create() {
     var panel = MadPanel.UniqueOrNull();
     
     if (panel == null) {
         if (EditorUtility.DisplayDialog(
             "Init Scene?",
             "Scene not initialized for 3D bars. You cannot place new bar without proper initialization. Do it now?",
             "Yes", "No")) {
             MadInitTool.ShowWindow();
             return null;
         }
         
         panel = MadPanel.UniqueOrNull();
     }
 
     var bar = MadTransform.CreateChild<FilledRenderer3D>(panel.transform, "fill progress bar");
     TryApplyExampleTextures(bar);
     Selection.activeObject = bar.gameObject;
     
     return bar;
 }
Exemplo n.º 4
0
 static void InitTool() {
     MadInitTool.ShowWindow();
 }