void OnGUI() { List<Donuts.Sound.AudioClipCache.Info> list = Donuts.Sound.AudioClipCache.GetList(); GUIStyle style = new GUIStyle(); GUIStyleState stylestate = new GUIStyleState(); stylestate.textColor = Color.white; style.fontSize = 20; style.normal = stylestate; GUILayout.Label("AudioClipCacheList", style); if (list == null) { GUILayout.Label("List is null"); } else { GUILayout.Label("ListCount:"+list.Count+" Limit:"+Donuts.Sound.AudioClipCache.GetLimitNum()); positionScroll = GUILayout.BeginScrollView(positionScroll, GUILayout.Height(500)); GUILayout.BeginVertical(); for (int i=0; i<list.Count; i++) { GUILayout.Label(list[i].name); } GUILayout.EndVertical(); GUILayout.EndScrollView(); } }
internal static GUIStyleState GetGUIStyleState(GUIStyle sourceStyle, IntPtr source) { GUIStyleState state = new GUIStyleState(sourceStyle, source); state.m_Background = state.GetBackgroundInternal(); state.m_ScaledBackgrounds = state.GetScaledBackgroundsInternalFromDeserialization(); return state; }
void OnGUI() { Style = new GUIStyle(); State = new GUIStyleState(); GUI.skin = Skin; State.textColor = Color.red; Style.fontSize = Screen.width/20; Style.normal = State; if (GUI.Button(new Rect(Screen.width / 2 + Screen.width / 6, Screen.height / 2 + Screen.height / 6, Screen.width / 3, Screen.height / 4), "もう一度遊ぶ")) { Application.LoadLevel("Sato"); } if (GUI.Button(new Rect(0, Screen.height / 2 + Screen.height / 6, Screen.width / 3, Screen.height / 4 ), "メニューに戻る")) { Application.LoadLevel("Nishimaki"); } GUI.Label(new Rect(Screen.width / 2 - Screen.width / 10, Screen.height / 3, Screen.width / 2, Screen.height / 8), "視聴率 " + program_rating + " %", Style); GUI.Label(new Rect(Screen.width / 2 - Screen.width / 10, Screen.height / 2, Screen.width / 2, Screen.height / 8), "金額 " + program_money + " $", Style); }
void Update() { style = new GUIStyle(); style.fontSize = 40; GUIStyleState styleState = new GUIStyleState(); styleState.textColor = new Color(1f, 1f, 1f); style.normal = styleState; }
// Update is called once per frame void Update() { guiStyle = new GUIStyle(); guiStyle.fontSize = 30; guiStyleState = new GUIStyleState(); guiStyleState.textColor = Color.black;//Color.white; guiStyle.normal = guiStyleState; }
// Use this for initialization void Start () { guiStyle = new GUIStyle(); styleState = new GUIStyleState(); styleState.background = Texture2D.blackTexture; guiStyle.normal = styleState; latitudeAndLongitude = coreScript.getLatitudeAndLogitude(); }
void OnGUI() { var stylestate = new GUIStyleState(); stylestate.textColor = Color.magenta; var style = new GUIStyle(); style.normal = stylestate; total_score = GUI.HorizontalSlider(new Rect(100, 200, 100, 20), total_score, 0f, 10f); GUI.Label( new Rect(220, 200, 200, 20), total_score.ToString(), style); notifyAllObj(total_score); }
// Use this for initialization void Start() { this.rect = new Rect (Screen.width * 0.35f, Screen.height * 0.5f, 100, 50); this.style = new GUIStyle(); this.style.fontSize = 50; // フォントサイズの変更 GUIStyleState styleState = new GUIStyleState(); styleState.textColor = Color.green; this.style.normal = styleState; }
//Called during Deserialization from cpp internal void InternalOnAfterDeserialize() { m_Normal = GUIStyleState.ProduceGUIStyleStateFromDeserialization(this, GetStyleStatePtr(0)); m_Hover = GUIStyleState.ProduceGUIStyleStateFromDeserialization(this, GetStyleStatePtr(1)); m_Active = GUIStyleState.ProduceGUIStyleStateFromDeserialization(this, GetStyleStatePtr(2)); m_Focused = GUIStyleState.ProduceGUIStyleStateFromDeserialization(this, GetStyleStatePtr(3)); m_OnNormal = GUIStyleState.ProduceGUIStyleStateFromDeserialization(this, GetStyleStatePtr(4)); m_OnHover = GUIStyleState.ProduceGUIStyleStateFromDeserialization(this, GetStyleStatePtr(5)); m_OnActive = GUIStyleState.ProduceGUIStyleStateFromDeserialization(this, GetStyleStatePtr(6)); m_OnFocused = GUIStyleState.ProduceGUIStyleStateFromDeserialization(this, GetStyleStatePtr(7)); }
static public int get_textColor(IntPtr l) { try { UnityEngine.GUIStyleState self = (UnityEngine.GUIStyleState)checkSelf(l); pushValue(l, true); pushValue(l, self.textColor); return(2); } catch (Exception e) { return(error(l, e)); } }
internal void InternalOnAfterDeserialize() { this.m_FontInternal = this.GetFontInternalDuringLoadingThread(); this.m_Normal = GUIStyleState.ProduceGUIStyleStateFromDeserialization(this, this.GetStyleStatePtr(0)); this.m_Hover = GUIStyleState.ProduceGUIStyleStateFromDeserialization(this, this.GetStyleStatePtr(1)); this.m_Active = GUIStyleState.ProduceGUIStyleStateFromDeserialization(this, this.GetStyleStatePtr(2)); this.m_Focused = GUIStyleState.ProduceGUIStyleStateFromDeserialization(this, this.GetStyleStatePtr(3)); this.m_OnNormal = GUIStyleState.ProduceGUIStyleStateFromDeserialization(this, this.GetStyleStatePtr(4)); this.m_OnHover = GUIStyleState.ProduceGUIStyleStateFromDeserialization(this, this.GetStyleStatePtr(5)); this.m_OnActive = GUIStyleState.ProduceGUIStyleStateFromDeserialization(this, this.GetStyleStatePtr(6)); this.m_OnFocused = GUIStyleState.ProduceGUIStyleStateFromDeserialization(this, this.GetStyleStatePtr(7)); }
internal void InternalOnAfterDeserialize() { this.m_FontInternal = this.GetFontInternal(); this.m_Normal = new GUIStyleState(this, this.GetStyleStatePtr(0)); this.m_Hover = new GUIStyleState(this, this.GetStyleStatePtr(1)); this.m_Active = new GUIStyleState(this, this.GetStyleStatePtr(2)); this.m_Focused = new GUIStyleState(this, this.GetStyleStatePtr(3)); this.m_OnNormal = new GUIStyleState(this, this.GetStyleStatePtr(4)); this.m_OnHover = new GUIStyleState(this, this.GetStyleStatePtr(5)); this.m_OnActive = new GUIStyleState(this, this.GetStyleStatePtr(6)); this.m_OnFocused = new GUIStyleState(this, this.GetStyleStatePtr(7)); }
// Use this for initialization void Start() { this.rect = new Rect (Screen.width * 0.8f, 0, 100, 50); this.style = new GUIStyle(); this.style.fontSize = 30; // フォントサイズの変更 GUIStyleState styleState = new GUIStyleState(); styleState.textColor = Color.green; this.style.normal = styleState; this.score = 0; }
static public int constructor(IntPtr l) { try { UnityEngine.GUIStyleState o; o = new UnityEngine.GUIStyleState(); pushValue(l, true); pushValue(l, o); return(2); } catch (Exception e) { return(error(l, e)); } }
/// <summary> /// Constructor /// </summary> public ProgramaticStyle(InvalidationManagerClient client) { _client = client; _style = new GUIStyle(); _normal = new GUIStyleState(); _onNormal = new GUIStyleState(); _hover = new GUIStyleState(); _active = new GUIStyleState(); _focused = new GUIStyleState(); _onHover = new GUIStyleState(); _onActive = new GUIStyleState(); _onFocused = new GUIStyleState(); }
static public int set_background(IntPtr l) { try { UnityEngine.GUIStyleState self = (UnityEngine.GUIStyleState)checkSelf(l); UnityEngine.Texture2D v; checkType(l, 2, out v); self.background = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_textColor(IntPtr l) { try { UnityEngine.GUIStyleState self = (UnityEngine.GUIStyleState)checkSelf(l); UnityEngine.Color v; checkType(l, 2, out v); self.textColor = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
public UnityEngine.GUIStyleState ToUnityEngineGuiStyleState() { if (mIsDirty) { mCachedUnityStyleState = new UnityEngine.GUIStyleState(); mCachedUnityStyleState.background = this.Background; mCachedUnityStyleState.textColor = this.TextColor; mIsDirty = false; } return(mCachedUnityStyleState); }
void OnGUI() { Style = new GUIStyle(); State = new GUIStyleState(); GUI.skin=Skin; State.textColor = Color.white; Style.fontSize = 30; Style.normal = State; if (GUI.Button(new Rect(0, 0, Screen.width/4, Screen.height/4), Catalog)) { Application.LoadLevel("Catalog"); } if (GUI.Button(new Rect(Screen.width/2+Screen.width/4, 0, Screen.width/4 , Screen.height/4 ), Option)) { Application.LoadLevel("Option"); } if (GUI.Button(new Rect(0, Screen.height / 2, Screen.width / 6, Screen.height / 7),Icon1)) { menu_number--; if (menu_number < 0) { menu_number = Menu.Length - 1; } Debug.Log(menu_number); } if (GUI.Button(new Rect(Screen.width/2+Screen.width/3, Screen.height / 2, Screen.width / 6, Screen.height / 7), Icon2)) { menu_number++; if (Menu.Length == menu_number) { menu_number = 0; } Debug.Log(menu_number); } if (GUI.Button(new Rect(Screen.width / 12, Screen.height / 12, Screen.width / 2 + Screen.width / 3, Screen.height / 2 + Screen.height / 2), Menu[menu_number])) { Application.LoadLevel("Sato"); } }
private void SetGuiStyleTextField() { if (mGUIStyleTextField == null) { mGUIStyleTextField = new GUIStyle(); mGUIStyleTextField.fontSize = LABEL_FONT_SIZE; mGUIStyleTextField.alignment = TextAnchor.MiddleLeft; mGUIStyleTextField.padding.left = 10; mGUIStyleTextField.padding.right = 10; GUIStyleState style = new GUIStyleState(); style.background = bkgdTextField; mGUIStyleTextField.normal = style; } }
// fields // properties static void GUIStyleState_background(JSVCall vc) { if (vc.bGet) { UnityEngine.GUIStyleState _this = (UnityEngine.GUIStyleState)vc.csObj; var result = _this.background; JSMgr.datax.setObject((int)JSApi.SetType.Rval, result); } else { UnityEngine.Texture2D arg0 = (UnityEngine.Texture2D)JSMgr.datax.getObject((int)JSApi.GetType.Arg); UnityEngine.GUIStyleState _this = (UnityEngine.GUIStyleState)vc.csObj; _this.background = arg0; } }
static void GUIStyle_hover(JSVCall vc) { if (vc.bGet) { UnityEngine.GUIStyle _this = (UnityEngine.GUIStyle)vc.csObj; var result = _this.hover; JSMgr.datax.setObject((int)JSApi.SetType.Rval, result); } else { UnityEngine.GUIStyleState arg0 = (UnityEngine.GUIStyleState)JSMgr.datax.getObject((int)JSApi.GetType.Arg); UnityEngine.GUIStyle _this = (UnityEngine.GUIStyle)vc.csObj; _this.hover = arg0; } }
public static void DrawText(Vector2 pos,string text, Color color, int size = 12) { Color tmpColor = GUI.color; GUIStyle style = new GUIStyle(); GUIStyleState styleState = new GUIStyleState(); styleState.textColor = color; // 文字色の変更. style.normal = styleState; style.fontSize = size; GUI.color = new Color(1, 1, 1, 1); GUI.Label(new Rect(pos, new Vector2(text.Length * size, size)), text, style); GUI.color = tmpColor; }
public static void DrawText(string text, Color color, int size = 12) { Color tmpColor = GUI.color; GUIStyle style = new GUIStyle(); GUIStyleState styleState = new GUIStyleState(); styleState.textColor = color; // 文字色の変更. style.normal = styleState; style.fontSize = size; GUI.color = new Color(1, 1, 1, 1); EditorGUILayout.LabelField(text, style); GUI.color = tmpColor; }
private void SetGuiStylesPause() { float halfButtonWidth = BUTTON_SIZE_WIDTH * 0.5f; xPosPause = Screen.width - halfButtonWidth; yPosPause = 0.0f; mGUIStylePause = new GUIStyle(); mGUIStylePause.fontSize = 24; mGUIStylePause.fontStyle = FontStyle.Bold; GUIStyleState styleNormal = new GUIStyleState(); styleNormal.background = pauseButton; mGUIStylePause.normal = styleNormal; mGUIStylePause.alignment = TextAnchor.MiddleCenter; }
// Use this for initialization void Start () { UnityPlugins.StoreManager.AppInit(); UnityPlugins.StoreManager.GetListingInfo(); m_ScreenRectangle = new Rect(XOFFSET, Screen.height - YOFFSETNAME, Screen.width, Screen.height); m_ScreenRectangle2 = new Rect(XOFFSET, Screen.height - YOFFSETMSG, Screen.width, Screen.height); int count = UnityPlugins.StoreManager.GetCount(); m_ProductName = TILE_PRODUCTLIST; if (count == 0) { m_ProductName += "none"; } else { for (int i = 0; i < count; ++i) { m_ProductName += UnityPlugins.StoreManager.GetProductName(i) + " "; } mBuyProductName = UnityPlugins.StoreManager.GetProductName(TESTPRODUCTINDEX); mButtonText += mBuyProductName; mBuyProductId = UnityPlugins.StoreManager.GetProductId(TESTPRODUCTINDEX); } m_GUIStyle = new GUIStyle(); m_GUIStyle.fontSize = 20; m_GUIStyle.fontStyle = FontStyle.Bold; m_GUIStyleBtn = new GUIStyle(); m_GUIStyleBtn.fontSize = 20; m_GUIStyleBtn.fontStyle = FontStyle.Bold; GUIStyleState styleNormal = new GUIStyleState(); styleNormal.background = normalButton; GUIStyleState styleHover = new GUIStyleState(); styleHover.background = hoverButton; m_GUIStyleBtn.normal = styleNormal; m_GUIStyleBtn.hover = styleHover; m_GUIStyleBtn.alignment = TextAnchor.MiddleCenter; }
static int set_onActive(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.GUIStyle obj = (UnityEngine.GUIStyle)o; UnityEngine.GUIStyleState arg0 = (UnityEngine.GUIStyleState)ToLua.CheckObject(L, 2, typeof(UnityEngine.GUIStyleState)); obj.onActive = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onActive on a nil value" : e.Message)); } }
static int get_onFocused(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UnityEngine.GUIStyle obj = (UnityEngine.GUIStyle)o; UnityEngine.GUIStyleState ret = obj.onFocused; ToLua.PushObject(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onFocused on a nil value" : e.Message)); } }
// Use this for initialization void Start () { Style = new GUIStyle(); State = new GUIStyleState(); text = Scenario1.text.Split('/'); text_number = 0; if (gameroot==1) { text = Scenario1_1.text.Split('/'); text_number=0; } if (gameroot==2) { text = Scenario1_2.text.Split('/'); text_number = 0; } StartCoroutine(WaitTimeAndGo()); }
void OnGUI() { if (m_Player != null && m_RectList.Length > 0) { GUIStyle guiStyle = new GUIStyle(); GUIStyleState styleState = new GUIStyleState(); Color backColor = GUI.backgroundColor; GUI.backgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.5f); styleState.background = Texture2D.whiteTexture; styleState.textColor = Color.magenta; guiStyle.normal = styleState; guiStyle.fontSize = fontSize; GUI.Label(m_RectList[0], "NAME:" + m_Player.name, guiStyle); GUI.Label(m_RectList[1], "ID:" + m_Player.playerId, guiStyle); GUI.Label(m_RectList[2], "HP:" + m_Player.hp + "/" + m_Player.maxHP, guiStyle); GUI.Label(m_RectList[3], "DF:" + m_Player.deffence, guiStyle); GUI.Label(m_RectList[4], "AT:" + m_Player.attack, guiStyle); } }
private void SetGuiStyleBtn() { float halfButtonWidth = BUTTON_SIZE_WIDTH * 0.5f; xPos = Screen.width * 0.5f - halfButtonWidth; yPos = Screen.height * 0.5f - halfButtonWidth; mGUIStyleBtn = new GUIStyle(); mGUIStyleBtn.fontSize = 24; mGUIStyleBtn.fontStyle = FontStyle.Bold; GUIStyleState styleNormal = new GUIStyleState(); styleNormal.background = normalButton; GUIStyleState styleHover = new GUIStyleState(); styleHover.background = hoverButton; mGUIStyleBtn.normal = styleNormal; mGUIStyleBtn.hover = styleHover; mGUIStyleBtn.alignment = TextAnchor.MiddleCenter; }
// Use this for initialization void Start () { yPos = Screen.height - BUTTON_SIZE - OFFSET; xPos = Screen.width - BUTTON_SIZE - OFFSET; m_GUIStyleBtn = new GUIStyle(); m_GUIStyleBtn.fontSize = 24; m_GUIStyleBtn.fontStyle = FontStyle.Bold; GUIStyleState styleNormal = new GUIStyleState(); styleNormal.background = normalButton; GUIStyleState styleHover = new GUIStyleState(); styleHover.background = hoverButton; m_GUIStyleBtn.normal = styleNormal; m_GUIStyleBtn.hover = styleHover; m_GUIStyleBtn.alignment = TextAnchor.MiddleCenter; }
void Start () { if (DontDestroyEnabled) { DontDestroyOnLoad (this); } #if FPS_ONGUI styleState = new GUIStyleState(); styleState.textColor = OnGUIFontColor; style = new GUIStyle(); style.fontSize = OnGUIFontSize; style.normal = styleState; #endif UpdateNowFPS = 0.0f; UpdateAvgFPS = 0.0f; UpdateDeltaTime = 0.0f; FixedUpdateNowFPS = 0.0f; FixedUpdateAvgFPS = 0.0f; FixedUpdateDeltaTime = 0.0f; tm = GetComponent<TextMesh> (); }
void _Initialize() { if( !_initializedGUIStyle || _guiStyle_header == null ) { _guiStyle_header = new GUIStyle( EditorStyles.label ); var styleState = new GUIStyleState(); styleState.textColor = new Color( 0.7f, 0.7f, 0.0f ); _guiStyle_header.normal = styleState; _guiStyle_header.wordWrap = false; _guiStyle_header.fontStyle = FontStyle.Bold; } if( !_initializedGUIStyle || _guiStyle_section == null ) { _guiStyle_section = new GUIStyle( EditorStyles.label ); var styleState = new GUIStyleState(); styleState.textColor = new Color( 0.2f, 0.7f, 1.0f ); _guiStyle_section.normal = styleState; _guiStyle_section.wordWrap = false; _guiStyle_section.fontStyle = FontStyle.Bold; } if( !_initializedGUIStyle || _guiStyle_boneName_Unselected == null ) { _guiStyle_boneName_Unselected = new GUIStyle( EditorStyles.label ); var styleState = new GUIStyleState(); styleState.textColor = new Color( 1.0f, 0.4f, 0.4f ); _guiStyle_boneName_Unselected.normal = styleState; _guiStyle_boneName_Unselected.wordWrap = false; _guiStyle_boneName_Unselected.alignment = TextAnchor.MiddleLeft; _guiStyle_boneName_Unselected.fontStyle = FontStyle.Bold; } if( !_initializedGUIStyle || _guiStyle_boneName_Unselected_Optional == null ) { _guiStyle_boneName_Unselected_Optional = new GUIStyle( EditorStyles.label ); _guiStyle_boneName_Unselected_Optional.wordWrap = false; _guiStyle_boneName_Unselected_Optional.alignment = TextAnchor.MiddleLeft; _guiStyle_boneName_Unselected_Optional.fontStyle = FontStyle.Bold; } _initializedGUIStyle = true; }
private static GUIStyle CreateFromTextures(Texture2D texNormal, Texture2D texHover, Texture2D texActive, Texture2D texFocus) { GUIStyleState normal = new GUIStyleState() { background = texNormal, textColor = Color.white, }; return new GUIStyle() { name = texNormal.name, normal = new GUIStyleState() { background = texNormal, textColor = Color.white }, hover = new GUIStyleState() { background = texHover, textColor = Color.white }, active = new GUIStyleState() { background = texActive, textColor = Color.white }, onNormal = new GUIStyleState() { background = texNormal, textColor = Color.white }, onHover = new GUIStyleState() { background = texHover, textColor = Color.white }, onActive = new GUIStyleState() { background = texActive, textColor = Color.white }, focused = new GUIStyleState() { background = texFocus, textColor = Color.white }, onFocused = new GUIStyleState() { background = texFocus, textColor = Color.white }, border = new RectOffset(0, 0, 0, 0), margin = new RectOffset(0, 0, 0, 0), padding = new RectOffset(0, 0, 0, 0), overflow = new RectOffset(0, 0, 0, 0), imagePosition = ImagePosition.ImageAbove, alignment = TextAnchor.MiddleCenter, wordWrap = true, clipping = TextClipping.Clip, contentOffset = new Vector2(0, 0), fixedWidth = texNormal.width, fixedHeight = texNormal.height, stretchWidth = false, stretchHeight = false, font = null, fontSize = 0, fontStyle = FontStyle.Normal, richText = false, }; }
public static void PPP(this GUIStyleState s, string breadcrumbs) { string bkg = "null"; string colorName = ""; if (s.textColor == black && s.background == null) { return; } if (s.background != null) { bkg = s.background.ToString(); } if (Color_.knownColors.TryGetValue(s.textColor, out colorName)) { Log.Now("{0} {{ GUIss: textColor: {1} bkg: {2} }}", breadcrumbs, colorName, bkg); } else { Log.Now("{0} {{ GUIss: textColor: {1} bkg: {2} }}", breadcrumbs, s.textColor.ToString(), bkg); } }
public static string PP(this GUIStyleState s, params object[] strs) { string bkg = "null"; string colorName = ""; if (s.textColor == black && s.background == null) { return(""); } if (s.background != null) { bkg = s.background.ToString(); } if (Color_.knownColors.TryGetValue(s.textColor, out colorName)) { return("{ GUIss: textColor: " + colorName + " bkg: " + bkg + " }"); } else { return("{ GUIss: textColor: " + s.textColor.ToString() + " bkg: " + bkg + " }"); } }
public void Initialize() { black = new GUIStyleState() ; white = new GUIStyleState() ; white.textColor = new Color(1.0f, 1.0f, 0.9f) ; //右下でプレイヤに行動を促すメッセージ guiGuide = new GUIStyle() ; guiGuide.fontSize = 28 ; guideRect = new Rect(Screen.width - 480, Screen.height - 80, 300, 50) ; //情報を一定時間表示する guiInfo = new GUIStyle() ; infoList = new List<string>() ; infoTimer = new List<float>() ; infoTime = 10.0f ; guiTurnPlayer = new GUIStyle() ; guiTurnPlayer.fontSize = 36 ; turnPlayer = -1 ; //メッセージ表示の座標指定 rect = new Rect(0, 0, 300, 50) ; }
//It's only safe to call this during a deserialization operation. internal static GUIStyleState ProduceGUIStyleStateFromDeserialization(GUIStyle sourceStyle, IntPtr source) { GUIStyleState newState = new GUIStyleState(sourceStyle, source); return(newState); }
// background // textColor public static string backgroundPP(this GUIStyleState s, params object[] strs) { return(""); }
public GUIStyleState() { this.m_Ptr = GUIStyleState.Init(); }
/// <summary> /// SVNの状態アイコン表示 /// </summary> /// <param name="selectionRect"></param> private static void ShowStatusLabel(SVNStatus status, Rect selectionRect) { // アイコンの位置 const int size = 15; var pos = selectionRect; pos.y = selectionRect.position.y; pos.x = selectionRect.position.x; pos.width = size; pos.height = size; pos.yMin++; // ラベル表示 string text = "o"; Color mColor = new Color(0, 1, 0, 0.5f); if (status == SVNStatus.ADD) { text = "+"; mColor = new Color(0, 0, 1, 0.5f); } else if (status == SVNStatus.CONFRICT) { text = "!?"; mColor = new Color(1, 1, 0, 0.5f); } else if (status == SVNStatus.EDIT) { text = "!"; mColor = new Color(1, 0, 0, 0.5f); } else if (status == SVNStatus.NONE) { text = "?"; mColor = new Color(1, 1, 1, 0.5f); } else if (status == SVNStatus.DELETE) { text = "x"; mColor = new Color(1, 0, 0, 0.5f); } else if (status == SVNStatus.MOVE) { text = "!"; mColor = new Color(0.5f, 0.2f, 0.5f, 0.5f); } GUIStyleState styleState = new GUIStyleState(); styleState.textColor = Color.white; GUIStyle style = new GUIStyle(); style.fontSize = 14; style.fontStyle = FontStyle.Bold; style.normal = styleState; float offset = -12 + 3 * (selectionRect.height / 16.0f); // 小さいアイコンのときは端っこに寄せる pos.y = selectionRect.height > 16.0f ? selectionRect.position.y + offset : selectionRect.position.y+1; pos.x = selectionRect.height > 16.0f ? selectionRect.position.x + offset : 0; // BG var color = GUI.color; GUI.color = mColor; GUI.DrawTexture(pos, EditorGUIUtility.whiteTexture); GUI.color = color; // テキストは少し中に寄せる pos.y -= 2; pos.x += 2; // アイコン GUI.Label(pos, text, style); }
private void SetGuiStyles(ref GUIStyle guiStyle, Texture2D normal, Texture2D hover) { if (guiStyle == null) { guiStyle = new GUIStyle(); guiStyle.fontSize = LABEL_FONT_SIZE; guiStyle.fontStyle = FontStyle.Bold; GUIStyleState styleNormal = new GUIStyleState(); styleNormal.background = normal; GUIStyleState styleHover = new GUIStyleState(); styleHover.background = hover; guiStyle.normal = styleNormal; guiStyle.hover = styleHover; guiStyle.alignment = TextAnchor.MiddleCenter; } }
private static void GetValue(GUIStyleState guiStyleState) { if (string.IsNullOrEmpty(AssetDatabase.GetAssetPath(guiStyleState.background))) guiStyleState.background = null; }
// Use this for initialization void Start () { Jony = (GameObject.FindGameObjectWithTag ("Jony")).GetComponent<CharacterAnimator>(); Abery = GameObject.FindGameObjectWithTag ("Abery").GetComponent<CharacterAnimator>(); _extra_animator = GameObject.FindObjectOfType<ExtraAnimator> (); _scenario_text = GameObject.FindObjectOfType<ScenarioText> (); _view_camera = GameObject.FindObjectOfType<ChangeCamera> (); _camera_animator = GameObject.FindObjectOfType<CameraAnimator> (); _cv_reference = GameObject.FindObjectOfType<CVManager> (); _se_reference= GameObject.FindObjectOfType<SEManager> (); _start_count = GameObject.FindObjectOfType<StartCount> (); Style = new GUIStyle(); State = new GUIStyleState(); //CSVデータから、ルートごとに分けてテキストデータ等を読み込む var MasterTable = new CSVMasterTable(); MasterTable.Load(); foreach (var Master in MasterTable.All) { //一度データを取り出す。 Scenariodate data = new Scenariodate ( Master.Scenario, Master.WatchTime, (Route)Master.NextRoute, Master.JonyAnimation, Master.AberyAnimation, Master.JonyState, Master.AberyState, Master.CameraNumber,Master.CameraAnimation, Master.ExtraAnimation,Master.SEPetern); //ルートにあわせて保存 switch ((Route)Master.CurrentRoute) { case Route.Main: _Main.Add (data); break; case Route.A: _A.Add(data); break; case Route.B: _B.Add(data); break; case Route.C: _C.Add(data); break; } } // _A.Add(new Scenariodate("ENDTEXT",0,Route.Main)); //_B.Add(new Scenariodate("ENDTEXT",0,Route.Main)); //_C.Add(new Scenariodate("ENDTEXT",0,Route.Main)); _cv_reference.Init(); _next_route = Route.NULL; _do_skip_text = false; //UpdateScenerio (Route.Main); }
internal static GUIStyleState GetGUIStyleState(GUIStyle sourceStyle, IntPtr source) { GUIStyleState newState = new GUIStyleState(sourceStyle, source); return(newState); }