void Awake() { button1 = NameButton.GetComponent <SpriteText>(); button2 = LevelButton.GetComponent <SpriteText>(); button3 = WuXingButton.GetComponent <ActionButton>(); button4 = AmbitButton.GetComponent <ActionButton>(); button5 = HPButton.GetComponent <UIProgressBar>(); button6 = MPButton.GetComponent <UIProgressBar>(); //gameObject.SetActiveRecursively(false); CEventSystem.Instance.RegisterEventHandle(GAME_EVENT_ID.GE_MAINTARGET_CHANGED, TargetFrame_Update); CEventSystem.Instance.RegisterEventHandle(GAME_EVENT_ID.GE_UNIT_MP, TargetFrame_Update); CEventSystem.Instance.RegisterEventHandle(GAME_EVENT_ID.GE_UNIT_HP, TargetFrame_Update); CEventSystem.Instance.RegisterEventHandle(GAME_EVENT_ID.GE_UNIT_LEVEL, TargetFrame_Update); // Init Camera [4/1/2012 Ivan] EZScreenPlacement ScreenPlacement = gameObject.GetComponent <EZScreenPlacement>(); if (ScreenPlacement != null) { ScreenPlacement.SetCamera(UISystem.Instance.UiCamrea); } updateTargetTip(); }
// Use this for initialization void Awake() { CEventSystem.Instance.RegisterEventHandle(GAME_EVENT_ID.GE_PLAY_DIALOGUE, PlayDialogue); EZScreenPlacement ScreenPlacement = gameObject.transform.root.gameObject.GetComponent <EZScreenPlacement>(); if (ScreenPlacement != null) { ScreenPlacement.SetCamera(UISystem.Instance.UiCamrea); } gameObject.transform.root.gameObject.SetActiveRecursively(false); InitialAllDialogue(); BoxCollider box = mask.GetComponent <BoxCollider>(); if (box != null) { box.size = new UnityEngine.Vector3(1280, 720, 0); box.center = new UnityEngine.Vector3(0, 360, 0); } head.autoResize = false; head.pixelPerfect = false; bgDownOther.transform.localPosition = new Vector3(-0.5f, 0, 1); bgUpOther.transform.localPosition = new Vector3(-0.5f, 721, 1); bgDownMe.transform.localPosition = new Vector3(-0.5f, 0, 1); bgUpMe.transform.localPosition = new Vector3(-0.5f, 721, 1); }
void Start() { EZScreenPlacement ScreenPlacement = gameObject.GetComponent <EZScreenPlacement>(); if (ScreenPlacement != null) { ScreenPlacement.SetCamera(UISystem.Instance.UiCamrea); } }
public void FirstEnter(GAME_EVENT_ID gAME_EVENT_ID, List <string> vParam) { gameObject.transform.localPosition = oldPos; EZScreenPlacement ScreenPlacement = gameObject.GetComponent <EZScreenPlacement>(); if (ScreenPlacement != null) { ScreenPlacement.SetCamera(UISystem.Instance.UiCamrea); } }
void Show() { gameObject.transform.parent.gameObject.SetActiveRecursively(true); EZScreenPlacement ScreenPlacement = gameObject.transform.parent.gameObject.GetComponent <EZScreenPlacement>(); if (ScreenPlacement != null) { ScreenPlacement.SetCamera(UISystem.Instance.UiCamrea); } }
void Awake() { //Hide(); EZScreenPlacement ScreenPlacement = gameObject.transform.root.gameObject.GetComponent <EZScreenPlacement>(); if (ScreenPlacement != null) { ScreenPlacement.SetCamera(UISystem.Instance.UiCamrea); } CEventSystem.Instance.RegisterEventHandle(GAME_EVENT_ID.GE_RELIVE_SHOW, ToggleRelive); CEventSystem.Instance.RegisterEventHandle(GAME_EVENT_ID.GE_RELIVE_HIDE, ToggleRelive); }
void Start() { EZScreenPlacement ScreenPlacement = gameObject.GetComponent <EZScreenPlacement>(); if (ScreenPlacement != null) { ScreenPlacement.SetCamera(UISystem.Instance.UiCamrea); } CEventSystem.Instance.RegisterEventHandle(GAME_EVENT_ID.GE_NEW_ITEM, OnEvent); //CEventSystem.Instance.RegisterEventHandle(GAME_EVENT_ID.GE_PACKAGE_ITEM_CHANGED, OnEvent); CEventSystem.Instance.RegisterEventHandle(GAME_EVENT_ID.GE_UNIT_HP, OnEvent); actionButton.AddInputDelegate(OnActionButtonClicked); gameObject.SetActiveRecursively(false); }
private void InitUi() { mapControl.InitialControls(); mapControl.EnableAll(); mapControl.AlwaysInCenter = false; EZScreenPlacement ScreenPlacement = gameObject.transform.root.gameObject.GetComponent <EZScreenPlacement>(); if (ScreenPlacement != null) { ScreenPlacement.SetCamera(UISystem.Instance.UiCamrea); } //gameObject.transform.root.gameObject.SetActiveRecursively(false); inputX.SetValidationDelegate(MyValidator); inputY.SetValidationDelegate(MyValidator); }
protected virtual void Init() { // Get our screen placer, if any: screenPlacer = (EZScreenPlacement)GetComponent(typeof(EZScreenPlacement)); if (!Application.isPlaying) { if (screenPlacer != null) screenPlacer.SetCamera(renderCamera); } // Get a default font: if(font == null && UIManager.Exists()) font = UIManager.instance.defaultFont; if (meshRenderer.sharedMaterial == null && UIManager.Exists()) { meshRenderer.sharedMaterial = UIManager.instance.defaultFontMaterial; if (meshRenderer.sharedMaterial != null) texture = meshRenderer.sharedMaterial.mainTexture; } else { if (meshRenderer.sharedMaterial != null) texture = meshRenderer.sharedMaterial.mainTexture; } #if WARN_ON_NO_MATERIAL if (texture == null && Application.isPlaying) Debug.LogWarning("Text on GameObject \"" + name + "\" has not been assigned either a texture or a material."); #endif // Get the font: if (font != null) { spriteFont = FontStore.GetFont(font); if (spriteFont == null) Debug.LogWarning("Warning: " + name + " was unable to load font \"" + font.name + "\"!"); } else if(Application.isPlaying) Debug.LogWarning("Warning: " + name + " currently has no font assigned."); if (mesh == null) { CreateMesh(); } // If this mesh is to persist, prevent it from being // destroyed on load: if (persistent) { Persistent = true; } if (texture != null) SetPixelToUV(texture); // Build our tab expansion string: StringBuilder sb = new StringBuilder(); for (int i = 0; i < tabSize; ++i) { sb.Append(' '); } tabSpaces = sb.ToString(); }
protected virtual void Init() { // Get our screen placer, if any: screenPlacer = (EZScreenPlacement)GetComponent(typeof(EZScreenPlacement)); if (!Application.isPlaying) { if (screenPlacer != null) screenPlacer.SetCamera(renderCamera); } if(font == null) { // Get a default font: if(UIManager.Exists()) font = UIManager.instance.defaultFont; } // Get the font: if (font != null) { spriteFont = FontStore.GetFont(font); if (spriteFont == null) Debug.LogWarning("Warning: " + name + " was unable to load font \"" + font.name + "\"!"); } else if(Application.isPlaying) Debug.LogWarning("Warning: " + name + " currently has no font assigned."); if (mesh == null) { meshFilter.sharedMesh = new Mesh(); mesh = meshFilter.sharedMesh; } // If this mesh is to persist, prevent it from being // destroyed on load: if (persistent) { Persistent = true; } if (texture != null) SetPixelToUV(texture); // Build our tab expansion string: StringBuilder sb = new StringBuilder(); for (int i = 0; i < tabSize; ++i) { sb.Append(' '); } tabSpaces = sb.ToString(); ProcessString(text); }