Esempio n. 1
0
 void ValidateUICanvasCanvasName()
 {
     if (canvasName.stringValue.Equals(UICanvas.DEFAULT_CANVAS_NAME))
     {
         customCanvasName.boolValue = false;
     }
     if (customCanvasName.boolValue)
     {
         return;
     }
     if (!DUI.CanvasNamesDatabase.Contains(canvasName.stringValue)) //canvas name does not exist in canvas datatabase -> ask it it should be added
     {
         if (!string.IsNullOrEmpty(canvasName.stringValue.Trim()) && EditorUtility.DisplayDialog("Action Required", "The '" + canvasName.stringValue + "' canvas name does not exist in the canvas names database.\nDo you want to add it now?", "Yes", "No"))
         {
             DUI.AddCanvasName(canvasName.stringValue);
             customCanvasName.boolValue = false;
         }
         else
         {
             EditorUtility.DisplayDialog("Information", "The canvas name was left unchanged and this UICanvas was set to use a custom canvas name." +
                                         "\n\n" +
                                         "Having a custom canvas name means that the name is not in the Canvas Database.", "Ok");
             customCanvasName.boolValue = true;
             return;
         }
     }
     canvasNameIndex = DUI.CanvasNamesDatabase.IndexOf(canvasName.stringValue);
 }
Esempio n. 2
0
 void ValidateUICanvasCanvasName()
 {
     if (!DUI.CanvasNamesDatabase.Contains(targetCanvasName.stringValue)) //canvas name does not exist in canvas datatabase -> ask it it should be added
     {
         if (!string.IsNullOrEmpty(targetCanvasName.stringValue.Trim()) && EditorUtility.DisplayDialog("Action Required", "The '" + targetCanvasName.stringValue + "' target canvas name does not exist in the canvas names database.\nDo you want to add it now?", "Yes", "No"))
         {
             DUI.AddCanvasName(targetCanvasName.stringValue);
         }
         else
         {
             EditorUtility.DisplayDialog("Information", "The canvas name was reset to the default value. (" + UICanvas.DEFAULT_CANVAS_NAME + ")", "Ok");
             targetCanvasName.stringValue = UICanvas.DEFAULT_CANVAS_NAME;
             if (!DUI.CanvasNamesDatabase.Contains(targetCanvasName.stringValue))
             {
                 DUI.AddCanvasName(targetCanvasName.stringValue);
             }
         }
     }
     canvasNameIndex = DUI.CanvasNamesDatabase.IndexOf(targetCanvasName.stringValue);
 }