public TmplLoaderBase AddLoaderFunc(string name, LoadRes fnc) { TmplLoaderBase loader = this.ConfirmLoadRes(name); loader.LoadFunc = fnc; return(loader); }
public CUResizableContainerStyle() { resizerVertical = new GUIStyle(); resizerVertical.fixedHeight = 6; resizerVertical.fixedWidth = 42; resizerVertical.margin = new RectOffset(0, 0, 1, 0); resizerVertical.imagePosition = ImagePosition.ImageOnly; if (EditorGUIUtility.isProSkin) { resizerVertical.normal.background = LoadRes.FindTextureOrGUISkin <Texture2D>("CUResizeDarkVertical.png"); } else { resizerVertical.normal.background = LoadRes.FindTextureOrGUISkin <Texture2D>("CUResizeLightVertical.png"); } resizerHorizontal = new GUIStyle(); resizerHorizontal.fixedHeight = 42; resizerHorizontal.fixedWidth = 6; resizerHorizontal.margin = new RectOffset(1, 0, 0, 0); resizerHorizontal.imagePosition = ImagePosition.ImageOnly; if (EditorGUIUtility.isProSkin) { resizerHorizontal.normal.background = LoadRes.FindTextureOrGUISkin <Texture2D>("CUResizeDarkHorizontal.png"); } else { resizerHorizontal.normal.background = LoadRes.FindTextureOrGUISkin <Texture2D>("CUResizeLightHorizontal.png"); } }
void Start() { LoadRes res = new LoadRes(); for (int i = 0; i < 4; ++i) { string str = path + i.ToString(); //Resources.Load(str,typeof(Sprite)) as Sprite; } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); cRCM _cRCM = new cRCM(this.Handle); LoadRes.LoadFrameImages(_cRCM, (int)FormStyle); LoadRes.LoadControlImages(_cRCM, (int)FormStyle); this.Width = this.Width + 10; _cRCM.Start(); this.Refresh(); }
protected static void ShowButtomImage(string path) { Texture2D texture = LoadRes.DownImage(path); if (null != texture) { MyCreate.Image(texture); } else { MyCreate.Image(Texture2D.whiteTexture); } }
public CUListStyle() { GUISkin skin = EditorGUIUtility.GetBuiltinSkin(EditorSkin.Inspector); evenBackground = new GUIStyle(skin.FindStyle("OL EntryBackEven")); oddBackground = new GUIStyle(skin.FindStyle("OL EntryBackOdd")); // default style doesn't handle focus. therefore we have to swap the textures evenBackground.onFocused.background = evenBackground.onNormal.background; oddBackground.onFocused.background = oddBackground.onNormal.background; Texture2D texture; if (EditorGUIUtility.isProSkin) { texture = LoadRes.FindTextureOrGUISkin <Texture2D>("CUNotFocusedSelectionDark.png"); } else { texture = LoadRes.FindTextureOrGUISkin <Texture2D>("CUNotFocusedSelectionLight.png"); } evenBackground.onNormal.background = texture; oddBackground.onNormal.background = texture; item = new GUIStyle(skin.FindStyle("PlayerSettingsPlatform")); item.alignment = TextAnchor.MiddleLeft; item.fixedHeight = 0; item.padding = new RectOffset(5, 0, 0, 0); item.margin = new RectOffset(); dropIntoHighlight = new GUIStyle(); dropIntoHighlight.normal.background = LoadRes.FindTextureOrGUISkin <Texture2D>("CUDragIntoHighlight.png"); dropIntoHighlight.border = new RectOffset(3, 3, 3, 3); dropIntoHighlight.stretchWidth = true; dropIntoHighlight.stretchHeight = true; dropIntoHighlight.imagePosition = ImagePosition.ImageOnly; dropBeforeHighlight = new GUIStyle(); dropBeforeHighlight.normal.background = LoadRes.FindTextureOrGUISkin <Texture2D>("CUDragBeforeHighlight.png"); dropBeforeHighlight.border = new RectOffset(0, 0, 3, 0); dropBeforeHighlight.stretchWidth = true; dropBeforeHighlight.stretchHeight = true; dropBeforeHighlight.overflow = new RectOffset(0, 0, 1, 0); dropBeforeHighlight.imagePosition = ImagePosition.ImageOnly; dropAfterHighlight = new GUIStyle(); dropAfterHighlight.normal.background = LoadRes.FindTextureOrGUISkin <Texture2D>("BottomLine_Blue.png"); dropAfterHighlight.border = new RectOffset(0, 0, 0, 3); dropAfterHighlight.stretchWidth = true; dropAfterHighlight.stretchHeight = true; dropAfterHighlight.overflow = new RectOffset(0, 0, 0, 1); dropAfterHighlight.imagePosition = ImagePosition.ImageOnly; }
protected static void ShowImage(string path) { Texture2D texture = LoadRes.DownImage(path); if (null != texture) { Rect rect = GUILayoutUtility.GetRect(0f, 0f); rect.width = texture.width; rect.height = texture.height; GUILayout.Space(rect.height); GUI.DrawTexture(rect, texture); } else { MyCreate.Image(Texture2D.whiteTexture); } }
void OnEnable() { tex = LoadRes.FindTextureOrGUISkin <Texture>("replace.png"); if (tex == null) { tex = Texture2D.blackTexture; } list = new ReorderableList(serializedObject, serializedObject.FindProperty("papers"), true, true, true, true); list.elementHeight = 75; list.drawElementCallback = DrawElement; list.drawHeaderCallback = drawHeader; list.onAddCallback = addElement; list.onCanRemoveCallback = canremove; list.onRemoveCallback = (ReorderableList l) => { if (EditorUtility.DisplayDialog("Warning!", "Are you sure you want to delete this Paper?\r\nThe paper pages (front and back) will be deleted from the scene", "Yes", "No")) { BookPro book = target as BookPro; if (book.EndFlippingPaper == book.papers.Length - 1) { book.EndFlippingPaper--; } OnInspectorGUI(); Paper paper = book.papers[l.index]; book.LeftPageShadow.gameObject.SetActive(false); book.LeftPageShadow.transform.SetParent(book.transform); book.RightPageShadow.gameObject.SetActive(false); book.RightPageShadow.transform.SetParent(book.transform); Undo.DestroyObjectImmediate(paper.Back); Undo.DestroyObjectImmediate(paper.Front); ReorderableList.defaultBehaviours.DoRemoveButton(l); EditorUtility.SetDirty(book); } }; }
protected override void OnLoad(EventArgs e) { try { base.OnLoad(e); cRCM _cRCM = new cRCM(this.Handle); LoadRes.LoadFrameImages(_cRCM, (int)FormStyle); LoadRes.LoadControlImages(_cRCM, (int)FormStyle); this.Width = this.Width + 10; _cRCM.Start(); this.ShowInTaskbar = false; this.Refresh(); } catch (Exception ex) { //do nothing } }
protected static void ShowImage(string path, int kongGe = 13) { Texture2D texture = LoadRes.DownImage(path); ShowImage(texture); }
public TmplLoaderBase(string name) { _dictTmpl = new Dictionary <string, UnityEngine.Object>(); _loaderName = name; _loadFunc = null; }