コード例 #1
0
		//METHODS:
#if UNITY_EDITOR
		public override void Draw(E.SceneView sceneView)
		{
			base.Draw(sceneView);
			EditorUtil.BeginColorPocket(m_color);
			G.DrawTexture(GetPositionedRect(sceneView), image);
			EditorUtil.EndColorPocket();
		}
コード例 #2
0
ファイル: GUI.cs プロジェクト: kmlkmljkl2/Anarchy
 public static void DrawTexture(SmartRect position, Texture tex, bool move = false)
 {
     UGUI.DrawTexture(position.ToRect(), tex);
     if (move)
     {
         position.MoveY();
     }
 }
コード例 #3
0
        public void overlayWindow(int windowid)
        {
            GUILayout.BeginVertical();
            if (GUILayout.Button("Show overlay"))
            {
                MapOverlay.ToggleOverlay();
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label("Opacity: ");
            //byte temp0 = 0;
            opacity          = (byte)GUILayout.HorizontalSlider(opacity, 0, 255);
            MapOverlay.alpha = opacity;
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("<"))
            {
                MapOverlay.prevResource(); RegrabVals();
            }
            GUILayout.TextField(MapOverlay.resource.Resource);
            if (GUILayout.Button(">"))
            {
                MapOverlay.nextResource(); RegrabVals();
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            minVal = GUILayout.TextField(minVal);
            maxVal = GUILayout.TextField(maxVal);
            double temp1, temp2;

            double.TryParse(maxVal, out temp1);
            double.TryParse(minVal, out temp2);
            MapOverlay.resource.MaxQuantity = temp1;
            MapOverlay.resource.MinQuantity = temp2;
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            GUILayout.Label("Layer:");
            if (GUILayout.Button("-"))
            {
                currentLayer = currentLayer > 0 ? currentLayer - 1 : 0; MapOverlay.currentLayer = currentLayer;
            }
            GUILayout.Label("" + currentLayer);
            if (GUILayout.Button("+"))
            {
                currentLayer = currentLayer == PD.LiveMap.Count + PD.LiveStratoMap.Count - 1 ? PD.LiveMap.Count + PD.LiveStratoMap.Count - 1 : currentLayer + 1; MapOverlay.currentLayer = currentLayer;
            }
            GUILayout.EndHorizontal();
            if (GUILayout.Button("Apply"))
            {
                MapOverlay.refreshCellColours();
            }
            int height = MapOverlay.getOverlayTextureScale(MapOverlay.resource.Resource).height;

            GUI.DrawTexture(new Rect(25, 192, 150, height), MapOverlay.getOverlayTextureScale(MapOverlay.resource.Resource));
            GUILayout.Label("Colour Scale");
            GUILayout.EndVertical();
            GUI.DragWindow();
        }
コード例 #4
0
        public static void BackgroundColor(Rect rect, Color color)
        {
            var oldColor = GUI.color;

            GUI.color = color;

            GUI.DrawTexture(rect, EditorGUIUtility.whiteTexture);
            GUI.color = oldColor;
        }
コード例 #5
0
ファイル: GUI.cs プロジェクト: kmlkmljkl2/Anarchy
 public static void DrawTexture(Rect position, Texture tex)
 {
     UGUI.DrawTexture(position, tex);
 }