//关键对象使用前更新 public void UpdateKeyObject() { keyObject.transform.localPosition += new Vector3(0, 0, -300); //坐标前移 up = keyObject.GetComponent <UIPanel>(); newpanel = up == null ? true : false; if (up == null) { up = keyObject.AddComponent <UIPanel>(); //获取panel } UIDragPanelContents uidpc = keyObject.GetComponent <UIDragPanelContents>(); if (uidpc != null) { uidpc.enabled = false; //关闭dragpanel } UIButtonOffset ubo = keyObject.GetComponent <UIButtonOffset>(); if (ubo != null) { Destroy(ubo); } keyObject.SetActive(false); keyObject.SetActive(true); }
protected override void OnAwake() { base.OnAwake(); this.m_gameui = XSingleton <XInterfaceMgr> .singleton.GetInterface <IXGameUI>(XSingleton <XCommon> .singleton.XHash("XGameUI")); this.m_tutorial = XSingleton <XInterfaceMgr> .singleton.GetInterface <IXTutorial>(XSingleton <XCommon> .singleton.XHash("XTutorial")); this.m_operation = XSingleton <XInterfaceMgr> .singleton.GetInterface <IXOperationRecord>(XSingleton <XCommon> .singleton.XHash("XOperationRecord")); this.m_uiButton = base.GetComponent <UIButton>(); this.m_uiButtonColor = this.m_uiButton; this.m_uiButtonScale = base.GetComponent <UIButtonScale>(); this.m_uiButtonOffset = base.GetComponent <UIButtonOffset>(); this.m_uiSpriteBG = base.GetComponentInChildren <UISprite>(); if (this.m_uiButton != null) { this.m_colliderCached = this.m_uiButton.cacheCol; } else { this.m_colliderCached = base.GetComponent <Collider>(); } this.CloneFromTpl(); if (this.m_NeedAudio && (string.IsNullOrEmpty(this.audioClip) || !this.audioClip.StartsWith("Audio"))) { this.SetAudioClip("Audio/UI/UI_Button_ok"); } this.m_CD.SetClickCD(this.CustomClickCDGroup, this.CustomClickCD); if (this.m_uiButton != null) { this.m_uiButton.changeStateSprite = this.ChangeStateSprite; } }
protected override void awakeInit() { UIEventListener.Get(btnLeo.gameObject).onClick = onClickLeo; UIEventListener.Get(btnKiley.gameObject).onClick = onClickKiley; UIEventListener.Get(btnChloe.gameObject).onClick = onClickChloe; UIEventListener.Get(btnShowCharacterInfo[0].gameObject).onClick = onClickShowCharacterInfo; UIEventListener.Get(btnShowCharacterInfo[1].gameObject).onClick = onClickShowCharacterInfo; UIEventListener.Get(btnInteractive.gameObject).onPress = onPressInteractive; UIEventListener.Get(btnInteractive.gameObject).onClick = onClickHero; UIEventListener.Get(btnUse.gameObject).onClick = onClickUseHero; UIEventListener.Get(btnUseSub.gameObject).onClick = onClickUseHeroAsSub; UIEventListener.Get(btnSelectCancel.gameObject).onClick = onClickCancelSub; UIButtonOffset tempBo = btnUse.GetComponent <UIButtonOffset>(); if (tempBo != null) { tempBo.enabled = false; } tempBo = btnUseSub.GetComponent <UIButtonOffset>(); if (tempBo != null) { tempBo.enabled = false; } }
public override void Init() { base.Init(); this.m_colliderCached = base.collider; if (null == this.m_colliderCached) { Debug.Log("null == m_colliderCached"); } this.m_uiButtonColor = base.GetComponent <UIButtonColor>(); this.m_uiButtonScale = base.GetComponent <UIButtonScale>(); this.m_uiButtonOffset = base.GetComponent <UIButtonOffset>(); this.m_uiButtoSounds = base.GetComponents <UIPlaySound>(); this.m_uiSprites = base.GetComponentsInChildren <UISprite>(true); this.m_uiTextures = base.GetComponentsInChildren <UITexture>(true); this.m_uiHovers = base.GetComponents <UIHover>(); this.m_ButtonKeyBinds = base.GetComponents <UIButtonKeyBinding>(); this.m_dicInitColorLabel.Clear(); UILabel[] componentsInChildren = base.GetComponentsInChildren <UILabel>(true); UILabel[] array = componentsInChildren; for (int i = 0; i < array.Length; i++) { UILabel uILabel = array[i]; if (null != uILabel && !this.m_dicInitColorLabel.ContainsKey(uILabel)) { this.m_dicInitColorLabel.Add(uILabel, uILabel.color); } } }
void Awake() { uiButton = GetComponent <UIButton>(); uiButtonScale = GetComponent <UIButtonScale>(); uiButtonOffset = GetComponent <UIButtonOffset>(); uiButtonSound = GetComponent <UIButtonSound>(); }
static public int get_duration(IntPtr l) { try { UIButtonOffset self = (UIButtonOffset)checkSelf(l); pushValue(l, true); pushValue(l, self.duration); return(2); } catch (Exception e) { return(error(l, e)); } }
static public int set_pressed(IntPtr l) { try { UIButtonOffset self = (UIButtonOffset)checkSelf(l); UnityEngine.Vector3 v; checkType(l, 2, out v); self.pressed = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_tweenTarget(IntPtr l) { try { UIButtonOffset self = (UIButtonOffset)checkSelf(l); UnityEngine.Transform v; checkType(l, 2, out v); self.tweenTarget = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
static public int set_duration(IntPtr l) { try { UIButtonOffset self = (UIButtonOffset)checkSelf(l); System.Single v; checkType(l, 2, out v); self.duration = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } }
public static float $Get2(object instance, int index) { UIButtonOffset expr_06_cp_0 = (UIButtonOffset)instance; switch (index) { case 0: return(expr_06_cp_0.pressed.x); case 1: return(expr_06_cp_0.pressed.y); case 2: return(expr_06_cp_0.pressed.z); default: throw new ArgumentOutOfRangeException("index"); } }
public static void $Set2(object instance, float value, int index) { UIButtonOffset expr_06_cp_0 = (UIButtonOffset)instance; switch (index) { case 0: expr_06_cp_0.pressed.x = value; return; case 1: expr_06_cp_0.pressed.y = value; return; case 2: expr_06_cp_0.pressed.z = value; return; default: throw new ArgumentOutOfRangeException("index"); } }