void Awake() { label = GetComponent<UILabel>(); tween = GetComponent<TweenAlpha>(); originColor = label.color; }
void AddEffectTo(GameObject gameObject) { //创建需要的特效 if (mTweenAlpha == null) { mTweenAlpha = TweenAlpha.Begin(gameObject, duration, endAlpah); mTweenAlpha.value = startAlpah; mTweenAlpha.from = startAlpah; mTweenAlpha.to = endAlpah; mTweenAlpha.duration = duration; mTweenList.Add(mTweenAlpha); } else { TweenAlpha newAlpha = null; if(mTweenAlpha.gameObject != gameObject) newAlpha = TweenAlpha.Begin(gameObject, duration, endAlpah); else newAlpha = mTweenAlpha; newAlpha.animationCurve = mTweenAlpha.animationCurve; newAlpha.value = startAlpah; newAlpha.from = startAlpah; newAlpha.to = endAlpah; newAlpha.duration = duration; mTweenList.Add(newAlpha); } }
void Update() { if (tween != null && tween.value == 1f) { tween = null; TransitionScene(); } }
// Use this for initialization void Start () { if( null == tween ) { tween = this.GetComponent<TweenAlpha>() ; } }
void OnCollisionEnter2D(Collision2D other) { if (other.gameObject.tag == "Main" && this.tag == "Up(Idle)") { PlayerPrefs.SetInt("SpawnCheck",1); if((PlayerPrefs.GetInt("StageLevel")+1)%2==0){ PlayerPrefs.SetInt("Spawn",2); PlayerPrefs.SetInt("StageLevel",PlayerPrefs.GetInt("StageLevel")+1); Stage.GetComponent<UILabel> ().text = "Stage : "+PlayerPrefs.GetInt("StageLevel"); other.gameObject.GetComponent<Transform> ().localPosition = new Vector3 (260,70,other.gameObject.GetComponent<Transform> ().position.z); LStair.tag = "Up(Idle)"; RStair.tag = "Up(Close)"; Debug.Log("위로 이동"); } else if((PlayerPrefs.GetInt("StageLevel")+1)%2!=0) { PlayerPrefs.SetInt("Spawn",1); PlayerPrefs.SetInt("StageLevel",PlayerPrefs.GetInt("StageLevel")+1); Stage.GetComponent<UILabel> ().text = "Stage : "+PlayerPrefs.GetInt("StageLevel"); other.gameObject.GetComponent<Transform> ().localPosition = new Vector3 (-260,70,other.gameObject.GetComponent<Transform> ().position.z); LStair.tag = "Up(Close)"; RStair.tag = "Up(Idle)"; Debug.Log("위로 이동"); } } else if (other.gameObject.tag == "Main" &&this.tag == "Up(Close)") { SystemMessage.GetComponent<UILabel> ().text = "계단이 잠겨있습니다.(반대 계단으로 이동)"; FadeOut = TweenAlpha.Begin(SystemMessage,2f,1f); FadeOut.enabled = true; FadeOut.from = 1f; FadeOut.to = 0f; FadeOut.Reset(); } }
public virtual void Glow() { NGUITools.SetActive(glowSprite.gameObject, true); sprite.color = Color.red; tweenAlpha = TweenAlpha.Begin(gameObject, 0.8f, 0.2f); tweenAlpha.from = 1f; tweenAlpha.style = UITweener.Style.PingPong; }
public override void InitWindowOnAwake() { base.InitWindowOnAwake(); InitWindowCoreData(); btnStart = GameUtility.FindDeepChild(this.gameObject, "LevelDetailRight/BtnEnter").gameObject; this.lbLevelDes = GameUtility.FindDeepChild<UILabel>(this.gameObject, "LevelDetailRight/Content/des"); this.lbLevelName = GameUtility.FindDeepChild<UILabel>(this.gameObject, "levelName"); this.listStarts.Add(GameUtility.FindDeepChild(this.gameObject, "Stars/star01").gameObject); this.listStarts.Add(GameUtility.FindDeepChild(this.gameObject, "Stars/star02").gameObject); this.listStarts.Add(GameUtility.FindDeepChild(this.gameObject, "Stars/star03").gameObject); twAlpha = this.gameObject.GetComponent<TweenAlpha>(); UIEventListener.Get(btnStart).onClick = delegate { // Application.LoadLevel("AnimationCurve"); GameMonoHelper.GetInstance().LoadGameScene("RealGame-AnimationCurve", false, delegate { UICenterMasterManager.Instance.ShowWindow(WindowID.WindowID_Matching); UICenterMasterManager.Instance.GetGameWindowScript<UIMatching>(WindowID.WindowID_Matching).SetMatchingData(this.ID); }); }; }
public override void InitWindowOnAwake() { InitWindowCoreData(); base.InitWindowOnAwake(); trsLevelItemsParent = GameUtility.FindDeepChild(this.gameObject, "LevelItems/Items"); twAlpha = gameObject.GetComponent<TweenAlpha>(); }
//public bool isTest = false; void Awake() { hideTween = GetComponent<TweenPosition>(); hideAlpha = GetComponent<TweenAlpha>(); hideTween.enabled = false; }
void Start() { TA = gameObject.GetComponent<TweenAlpha>(); TP=gameObject.GetComponent<TweenPosition>(); TP.from = transform.localPosition; a = 1 - 0.25f; b = transform.localPosition.y +110; }
void Awake() { tex = transform.GetComponentsInChildren<UITexture>(true)[0]; ta = transform.GetComponentsInChildren<TweenAlpha>(true)[0]; GetComponentsInChildren<UIFXUnit>(true)[0].UIFXPlayFuncWithFloat = Play; GetComponentsInChildren<UIFXUnit>(true)[0].UIFXStopFuncWithFloat = Stop; }
void Awake() { //_instance = this; numLabel = transform.Find("Label").GetComponent<UILabel>(); numTween = transform.GetComponent<TweenAlpha>(); EventDelegate ed = new EventDelegate(this, "OnTween"); numTween.onFinished.Add(ed); gameObject.SetActive(false); }
//public bool isTest = false; void Awake() { ShowTween = GetComponent<TweenPosition>(); ShowAlpha = GetComponent<TweenAlpha>(); ShowTween.enabled = false; ShowAlpha.enabled = false; }
public override void InitWindowOnAwake() { this.windowID = WindowID.WindowID_Level; InitWindowData(); base.InitWindowOnAwake(); // this.RegisterReturnLogic(RetrunPreLogic); trsLevelItemsParent = GameUtility.FindDeepChild(this.gameObject, "LevelItems/Items"); twAlpha = gameObject.GetComponent<TweenAlpha>(); }
void Awake() { m_myTransform = transform; Initialize(); m_lblText = m_myTransform.GetComponentsInChildren<UILabel>(true)[0]; m_tweenAlpha = m_myTransform.GetComponentsInChildren<TweenAlpha>(true)[0]; m_tweenPosition = m_myTransform.GetComponentsInChildren<TweenPosition>(true)[0]; }
void Awake() { _instance = this; messageLabel = transform.Find("MsgBg/Label").GetComponent<UILabel>(); messagePanel = this.GetComponent<TweenAlpha>(); msgTween = this.GetComponent<TweenPosition>(); EventDelegate ed = new EventDelegate(this,"OnTweenFinished"); messagePanel.onFinished.Add(ed); gameObject.SetActive(false); }
public void Initialize(GameObject rootObject, string texture, string newsTxt) { // _iconTexture.mainTexture = Resources.Load (texture) as Texture; _iconTexture.spriteName = texture; _newsLabel.text = newsTxt; _rootObject = rootObject; // _tweenScale = GetComponent<TweenScale> (); _tweenAlpha = GetComponent<TweenAlpha> (); }
void Start () { positionTweener = this.GetComponent<TweenPosition>(); alphaTweener = this.GetComponent<TweenAlpha>(); alphaTweener.enabled = false; if(this.name=="SelectMoveLabel") { if(QuestLog.GetQuestState("Find_the_Elders")==QuestState.Success) { this.enabled = false; } } }
private void InitFloatMsgForPower() { m_goFloatMsgForPower = GetUIChild("floatMsgForPower").gameObject; m_lblFloatMsgForPower = GetUIChild("floatMsgForPowerLbl").GetComponent<UILabel>(); m_tpFloatMsgForPower = m_goFloatMsgForPower.GetComponent<TweenScale>(); m_taFloatMsgForPower = m_goFloatMsgForPower.GetComponent<TweenAlpha>(); m_taFloatMsgForPowerBg = GetUIChild("floatMsgForPowerBg").GetComponent<TweenAlpha>(); m_tpFloatMsgForPower.enabled = false; m_taFloatMsgForPower.enabled = false; m_taFloatMsgForPowerBg.enabled = false; m_goFloatMsgForPower.SetActive(false); }
void Awake() { // Reference the this.scripts tweenPosScript = GetComponent<TweenPosition>(); tweenAlphaScript = GetComponent<TweenAlpha>(); bonusScoreLabel = GetComponent<UILabel>(); // Reference the end pos endPosition = endPositionGO.transform.position; // Tween to the end target position tweenPosScript.to = new Vector3(-289, 271, 0);// endPosition; }
void Awake() { //AssetCacheMgr.GetUIResource("MogoCameraLighting.mat", (go) => //{ // Mat = go as Material; // Mat.SetFloat("_LastTime", 0); //}); m_ta = GameObject.Find("BillboardPanel").transform.FindChild("CGCameraLighting").GetComponentsInChildren<TweenAlpha>(true)[0]; m_spLighting = m_ta.transform.parent.GetComponentsInChildren<UISprite>(true)[0]; }
/// <summary> /// Playbackward this instance. /// close the panel /// </summary> protected void playbackward () { tweenaph = TweenAlpha.Begin (TEXTURE, scaleAnimationTime * 0.8f, 0f); tweenaph.from = 1.0f; tweenaph.SetStartToCurrentValue (); tweenaph.to = 0.0f; tweenaph.animationCurve = curve1; DIALOG.SetActive (true); tweenScale = TweenScale.Begin (DIALOG, scaleAnimationTime * 1.1f, new Vector3 (1f, 0f, 1f)); EventDelegate.Add (tweenScale.onFinished, onAniDoneBackward); tweenaph.SetStartToCurrentValue (); questionTextView.text = ""; all_buttons (false); }
// Use this for initialization void Start () { GameManager gm = GameManager.Instanace; pos = gm.baymax.transform; transform.parent = this.transform; treeTT = GetComponent<TweenTransform> (); treeTT.from = start; treeTT.to = end; treeTT.duration = duration; treeTT.enabled = true; ta = GetComponent<TweenAlpha> (); gm.tweenscript.Add (treeTT); GetComponent<UI2DSprite> ().enabled = true; }
public void OnFinished() { if( isForward ) { isForward = false ; if( null == tween ) { tween = this.GetComponent<TweenAlpha>() ; } tween.PlayReverse() ; waitingTime = Time.timeSinceLevelLoad + waitingSec ; } }
void Awake() { m_tweenScale = GetComponent<TweenScale>(); if (m_tweenScale == null) { m_tweenScale = gameObject.AddComponent<TweenScale>(); } m_tweenAlpha = GetComponent<TweenAlpha>(); if (m_tweenAlpha == null) { m_tweenAlpha = gameObject.AddComponent<TweenAlpha>(); } transform.localPosition = Vector3.zero; InitBackGround(); }
public override void InitWindowOnAwake() { this.windowID = WindowID.WindowID_LevelDetail; base.InitWindowOnAwake(); InitWindowData(); btnStart = GameUtility.FindDeepChild(this.gameObject, "LevelDetailRight/BtnEnter").gameObject; twAlpha = this.gameObject.GetComponent<TweenAlpha>(); UIEventListener.Get(btnStart).onClick = delegate { // Application.LoadLevel("AnimationCurve"); GameMonoHelper.GetInstance().LoadGameScene("AnimationCurve", delegate { UIManager.GetInstance().ShowWindow(WindowID.WindowID_Matching); UIManager.GetInstance().GetGameWindowScript<UIMatching>(WindowID.WindowID_Matching).SetMatchingData(this.windowID); }); }; }
// Use this for initialization private void Start() { // if( m_Hint == null ) { Debug.LogError( "The Hint has not assigned.", this ); return; } // m_TweenAlphaHint = m_Hint.GetComponent<TweenAlpha>(); // if( m_TweenAlphaHint == null ) { Debug.LogError( "The Hint has not assigned a Component:'TweenAlpha'.", this ); return; } // m_bInit = true; }
public void FadeOut() { Camera mainCamera = Camera.main; AudioSource musicPlayer = mainCamera.GetComponent(typeof(AudioSource)) as AudioSource; TweenVolume volTween = mainCamera.gameObject.AddComponent<TweenVolume>() as TweenVolume; volTween.from = musicPlayer.volume; volTween.to = 0f; volTween.delay = 2.0f; volTween.duration = 2.5f; panel.gameObject.SetActive(true); tween = panel.GetComponent<TweenAlpha>() as TweenAlpha; tween.from = 0f; tween.to = 1f; tween.duration = 3.0f; tween.delay = 2.0f; tween.ResetToBeginning(); tween.Play(true); volTween.Play(true); }
public void init () { soundComponent = GetComponentsInChildren<UIPlaySound> (); setSoundClipOnButton (0.5f, "uibutton", button); interface_engine = gameEngine.Instance; UILabel[] lbl = control_panel.GetComponentsInChildren<UILabel> (); foreach (UILabel r in lbl) { if (r.gameObject.name.Equals ("NameTag")) { nametag = r; } if (r.gameObject.name.Equals ("money")) { money = r; } //Debug.Log ("found the name: " + r.gameObject.name); } waiting_panel.SetActive (true); control_panel.SetActive (true); control_panel_alpha = control_panel.GetComponent<TweenAlpha> (); waiting_panel_alpha = waiting_panel.GetComponent<TweenAlpha> (); waiting_panel.SetActive (false); control_panel.SetActive (false); }
public void Initialize(GameObject rootObject, string questDesc, string questRewards) { _questDesc.text = questDesc; float offset = _questDesc.transform.localScale.y * 1.1f; float lineThickness = (questDesc.Split (new string[] {"\n"}, System.StringSplitOptions.None).Length) * offset; _questRewards.text = questRewards; _rootObject = rootObject; float rewardsPosY = _questDesc.transform.localPosition.y - lineThickness; _questRewards.transform.localPosition = new Vector3 (0, rewardsPosY); _tweenAlpha = gameObject.GetComponent<TweenAlpha> (); _tweenScale = gameObject.GetComponent<TweenScale> (); // float y = _questDesc.transform.localPosition.y - lineThickness; float buttonY = Mathf.Min (rewardsPosY - offset * 2, -75f); _completeButton.transform.localPosition = new Vector3 (0, buttonY); }
/// <summary> /// 拷贝指引的目标控件 /// </summary> public void CopyTargetObj() { if (TargetObject == null) { return; } CopyObj = UnityEngine.GameObject.Instantiate(TargetObject) as GameObject; var toggle = CopyObj.GetComponent <Toggle>(); if (toggle != null) { toggle.group = null; } CopyTrans = CopyObj.transform; // 需要特殊处理的MonoBehaviour var spec_list = SGameEngine.Pool <MonoBehaviour> .List.New(); // 把非UI控件的MonoBehaviour销毁掉 var remove_list = SGameEngine.Pool <MonoBehaviour> .List.New(); var db_guide_copy_behavior = DBManager.Instance.GetDB <DBGuideCopyBehavior>(); foreach (var com in CopyObj.GetComponentsInChildren <MonoBehaviour>(true)) { // 处理特殊的组件 TargetModelInfo target_model_info = com as TargetModelInfo; if (target_model_info != null) { spec_list.Add(target_model_info); continue; } // 因为UIItemNewSlot采用了延迟加载图标,直接拷贝会图标丢失,需要把UIItemNewSlot也拷贝进来并进行加载工作 UIItemNewSlot slot = com as UIItemNewSlot; if (slot != null) { UIItemNewSlot source_slot = TargetObject.GetComponentInChildren <UIItemNewSlot>(); if (source_slot != null) { slot.ItemInfo = source_slot.ItemInfo; slot.SetUI(); if (slot.ItemInfo != null && GoodsHelper.GetGoodsType(slot.ItemInfo.type_idx) == GameConst.GIVE_TYPE_SOUL) { slot.CanShowCircleBkg = true; slot.SetColor(false); slot.SetBgImageVisiable(false); slot.SetEffectRootVisiable(false); } } continue; } // ui控件的基类 if (com == null || com is ICanvasElement || com is Selectable) { continue; } // 其他需要添加的组件 string class_name = com.GetType().Name; if (db_guide_copy_behavior.ContainType(class_name)) { continue; } //有Alpha渐变时直接设为不透明 TweenAlpha tween = com as TweenAlpha; if (tween != null) { tween.value = 1; } // 剩余的组件添加到remove_list remove_list.Add(com); } for (int i = remove_list.Count - 1; i >= 0; i--) { //包含序列帧特效的GameObject直接删掉,因为有特效重叠不同步的问题,物品除外 if (remove_list[i] is UGUIFrameAnimation) { if (remove_list[i].transform.parent != null && remove_list[i].transform.parent.parent != null) { if (remove_list[i].transform.parent.parent.GetComponent <UIItemNewSlot>() == null) { UnityEngine.Object.DestroyImmediate(remove_list[i].gameObject); } } } else { UnityEngine.Object.DestroyImmediate(remove_list[i]); } } SGameEngine.Pool <MonoBehaviour> .List.Free(remove_list); var canvas = CopyObj.GetComponent <Canvas>(); if (canvas != null) { UnityEngine.Object.DestroyImmediate(canvas); } CopyObj.SetActive(false); CopyTrans.SetParent(Wnd.TargetTmpRoot); var local_pos = CopyTrans.localPosition; local_pos.z = 0f; CopyTrans.localPosition = local_pos; RectTransform copy_trans = CopyTrans.GetComponent <RectTransform>(); RectTransform traget_trans = TargetObject.GetComponent <RectTransform>(); UGUIMath.SetWidgetSize(copy_trans, traget_trans); CopyObj.SetActive(true); // 可能traget_trans的父亲节点有缩放 var rect_corner = new Vector3[4]; copy_trans.GetWorldCorners(rect_corner); float copy_rect_size_x = rect_corner[2].x - rect_corner[0].x; traget_trans.GetWorldCorners(rect_corner); float target_size_x = rect_corner[2].x - rect_corner[0].x; float scale = 1; if (copy_rect_size_x != 0) { scale = target_size_x / copy_rect_size_x; } Vector3 ori_scale = CopyTrans.localScale; CopyTrans.localScale = new Vector3(ori_scale.x * scale, ori_scale.y * scale, ori_scale.z * scale); for (int i = spec_list.Count - 1; i >= 0; i--) { var com = spec_list[i]; //StartLoadModel 函数中播放模型动作在object隐藏时会不生效,需延后调用 TargetModelInfo target_model_info = com as TargetModelInfo; if (target_model_info != null) { target_model_info.StartLoadModel(); } } SGameEngine.Pool <MonoBehaviour> .List.Free(spec_list); }
void Awake() { _alpha = transform.Find("PromptContainer").GetComponent <TweenAlpha>(); _label = transform.Find("PromptContainer/Label").GetComponent <UILabel>(); }
protected override void OnOpen() { //临时关闭图鉴入口2019.1.8 TZJ GetComponent <Transform>("main/top_left/icons/collection").gameObject.SetActive(false); level = Level.current as Level_Home; m_rankActiveRoot = GetComponent <Transform>("fight/rank/bg"); m_rankCountDown = GetComponent <Text>("fight/rank/bg/Text"); m_rankOpenTime = GetComponent <Text>("fight/rank/decription_text"); m_btnWelfare = GetComponent <Button>("main/top_left/icons/welfare"); m_homeIcons[1] = MarkableIcon.Create(1, m_btnWelfare, () => { CanEnterWelfre(); }); m_btnNotice = GetComponent <Button>("main/top_left/icons/announce"); m_homeIcons[3] = MarkableIcon.Create(3, m_btnNotice, ShowWindow <Window_Announcement>); m_btnQuest = GetComponent <Button>("main/top_left/icons/mission"); m_homeIcons[4] = MarkableIcon.Create(4, m_btnQuest, () => { moduleActive.ActiveClick = 0; ShowWindow <Window_Active>(); }); m_btnNote = GetComponent <Button>("main/top_left/icons/note"); m_homeIcons[34] = MarkableIcon.Create(34, m_btnNote, ShowWindow <Window_DatingSelectNpc>); m_btnChat = GetComponent <Button>("main/bottom_left/chat"); m_homeIcons[7] = MarkableIcon.Create(7, m_btnChat, () => { moduleChat.opChatType = OpenWhichChat.WorldChat; ShowWindow <Window_Chat>(); }); m_btnCollection = GetComponent <Button>("main/top_left/icons/collection"); m_homeIcons[33] = MarkableIcon.Create(33, m_btnCollection, ShowWindow <Window_Collection>); m_btnPet = GetComponent <Button>("main/bottom_right/icons/sprite"); m_homeIcons[25] = MarkableIcon.Create(25, m_btnPet, ShowWindow <Window_Sprite>); m_btnRole = GetComponent <Button>("main/bottom_right/icons/attribute"); m_homeIcons[8] = MarkableIcon.Create(8, m_btnRole, ShowWindow <Window_Attribute>); m_btnSkill = GetComponent <Button>("main/bottom_right/icons/skill"); m_homeIcons[27] = MarkableIcon.Create(27, m_btnSkill, ShowWindow <Window_Skill>); m_btnEquipment = GetComponent <Button>("main/bottom_right/icons/bag"); m_homeIcons[9] = MarkableIcon.Create(9, m_btnEquipment, () => { Module_Equip.selectEquipType = EnumSubEquipWindowType.MainPanel; ShowWindow <Window_Equip>(); }); m_btnRune = GetComponent <Button>("main/bottom_right/icons/rune"); m_homeIcons[10] = MarkableIcon.Create(10, m_btnRune, ShowWindow <Window_RuneStart>); m_btnBag = GetComponent <Button>("main/bottom_right/icons/closet"); m_homeIcons[11] = MarkableIcon.Create(11, m_btnBag, () => { moduleCangku.chickType = WareType.Prop; ShowWindow <Window_Cangku>(); }); m_awake = GetComponent <Button>("main/bottom_right/icons/awake"); m_homeIcons[28] = MarkableIcon.Create(28, m_awake, ShowWindow <Window_Awakeinit>); m_btnTakePhoto = GetComponent <Button>("main/bottom_right/shot/go"); m_btnTakePhoto.onClick.AddListener(TakePhoto); m_btnHideBottom = GetComponent <Toggle>("main/bottom_right/home"); m_btnHideBottom.onValueChanged.AddListener(YouAreBeautyBaby); m_btnShop = GetComponent <Button>("main/middle_right/street"); m_homeIcons[12] = MarkableIcon.Create(12, m_btnShop, () => { SwitchTo(CommStreet); }); m_btnDungeon = GetComponent <Button>("main/middle_right/dungeons_btn"); m_homeIcons[13] = MarkableIcon.Create(13, m_btnDungeon, () => { SwitchTo(Dungeon); }); m_btnFight = GetComponent <Button>("main/middle_right/battle"); m_homeIcons[14] = MarkableIcon.Create(14, m_btnFight, () => { SwitchTo(Fight); }); m_btnAttack = GetComponent <Button>("main/middle_right/attack"); m_homeIcons[15] = MarkableIcon.Create(15, m_btnAttack, ShowWindow <Window_Chase>); m_btnUnion = GetComponent <Button>("main/middle_right/union"); m_homeIcons[29] = MarkableIcon.Create(29, m_btnUnion, ShowWindow <Window_Union>); m_btnStreet = GetComponent <Button>("main/middle_right/npcStreet"); m_homeIcons[31] = MarkableIcon.Create(31, m_btnStreet, OnClickDatingStreet); m_train = GetComponent <Button>("fight/train"); m_homeIcons[16] = MarkableIcon.Create(16, m_train, () => { Game.LoadLevel(GeneralConfigInfo.sTrainLevel); }); m_pvp = GetComponent <Button>("fight/match"); m_homeIcons[17] = MarkableIcon.Create(17, m_pvp, () => { modulePVP.Enter(OpenWhichPvP.FreePvP); }); m_match = GetComponent <Button>("fight/rank"); m_homeIcons[18] = MarkableIcon.Create(18, m_match, () => { modulePVP.Enter(OpenWhichPvP.LolPvP); }); m_labyrinth = GetComponent <Button>("dungeons/labyrinth"); m_homeIcons[19] = MarkableIcon.Create(19, m_labyrinth, () => { moduleLabyrinth.SendLabyrinthEnter(); }); m_bordlands = GetComponent <Button>("dungeons/bordlands"); m_homeIcons[20] = MarkableIcon.Create(20, m_bordlands, () => { moduleBordlands.Enter(); }); m_forge = GetComponent <Button>("commercialstreet/forge"); m_homeIcons[21] = MarkableIcon.Create(21, m_forge, () => { moduleForging.ClickType = EquipType.Weapon; ShowWindow <Window_Forging>(); }); m_fashionShop = GetComponent <Button>("commercialstreet/shizhuangdian"); m_homeIcons[22] = MarkableIcon.Create(22, m_fashionShop, ShowWindow <Window_Shizhuangdian>); m_drifterShop = GetComponent <Button>("commercialstreet/liulangshangdian"); m_homeIcons[23] = MarkableIcon.Create(23, m_drifterShop, ShowWindow <Window_Liulangshangdian>); m_wishingWell = GetComponent <Button>("commercialstreet/wish"); m_homeIcons[24] = MarkableIcon.Create(24, m_wishingWell, ShowWindow <Window_Wish>); m_petSummon = GetComponent <Button>("commercialstreet/summon"); m_homeIcons[26] = MarkableIcon.Create(26, m_petSummon, ShowWindow <Window_Summon>); m_factionBattle = GetComponent <Button>("fight/faction"); m_homeIcons[35] = MarkableIcon.Create(35, m_factionBattle, () => { if (moduleFactionBattle.state >= Module_FactionBattle.State.Processing) { ShowWindow <Window_FactionBattle>(); } else { ShowWindow <Window_FactionSign>(); } }); m_pettip = GetComponent <RectTransform>("tips").gameObject; m_canenter = GetComponent <Button>("dungeons/sprite/highlight"); m_canopen = GetComponent <Button>("dungeons/sprite/progress"); m_waite = GetComponent <Button>("dungeons/sprite/countdown"); m_progressvalue = GetComponent <Image>("dungeons/sprite/progress/progressframe_01/progressframe_02"); m_waitprogress = GetComponent <RectTransform>("dungeons/sprite/countdown/countdownframe_img_01").gameObject; m_mazeReadyImg = GetComponent <Image>("dungeons/labyrinth/icon/ready"); m_mazeChallengeImg = GetComponent <Image>("dungeons/labyrinth/icon/chanllenge"); m_mazeRestImg = GetComponent <Image>("dungeons/labyrinth/icon/rest"); m_mazeSettlementImg = GetComponent <Image>("dungeons/labyrinth/icon/settlement"); m_labyrinthCountDown = GetComponent <Text>("dungeons/labyrinth/stateSign_Txt"); #region faction m_factionTint = GetComponent <Transform>("main/middle_right/battle/faction_battle"); m_rankTint = GetComponent <Transform>("main/middle_right/battle/rank_battle"); m_factionLock = GetComponent <Transform>("fight/faction/lock"); m_stateTintRoot = GetComponent <Transform>("fight/faction/bg"); m_stateTint = GetComponent <Text>("fight/faction/bg/Text (1)"); m_factionActiveTime = GetComponent <Text>("fight/faction/bg/Text"); m_factionOpenTime = GetComponent <Text>("fight/faction/Text"); #endregion m_canenter.onClick.AddListener(SetTip); m_waite.onClick.AddListener(() => { moduleGlobal.ShowMessage(ConfigText.GetDefalutString(239, 6)); }); m_canopen.onClick.AddListener(SetTip); m_unionBossBtn = GetComponent <Button>("main/middle_right/union/mark"); m_unionBossBtn.onClick.RemoveAllListeners(); m_unionBossBtn.onClick.AddListener(delegate { moduleUnion.OpenBossWindow = true; ShowWindow <Window_Union>(); }); m_showTypes[0] = new ShowTypeInfo() { o = transform.Find("main").gameObject, handler = UpdateMain }; m_showTypes[1] = new ShowTypeInfo() { o = transform.Find("fight").gameObject, handler = UpdateFight }; m_showTypes[2] = new ShowTypeInfo() { o = transform.Find("dungeons").gameObject, handler = UpdateDungeon }; m_showTypes[3] = new ShowTypeInfo() { o = transform.Find("commercialstreet").gameObject, handler = UpdateCommStreet }; m_showPetToggle = GetComponent <Toggle>("main/bottom_right/showsprite"); m_showPetToggle.isOn = true; m_showPetToggle.onValueChanged.AddListener(b => ToggleShowPet(b, true)); m_combatValue = GetComponent <Text>("main/top_left/icons/combatEffectiveness/value"); m_tweenTLIcons = GetComponent <TweenPosition>("main/top_left/icons"); m_tfEffectNode = GetComponent <RectTransform>("effectnode"); m_tweenDatingNpc = GetComponent <TweenAlpha>("main/content"); m_datingNpcMono = GetComponent <NpcMono>("main/content/npcInfo"); m_banPrefab = GetComponent <RectTransform>("main/banner/templte"); m_banPlane = GetComponent <RectTransform>("main/banner/banScroll"); m_pagePrefab = GetComponent <RectTransform>("main/banner/pageTog"); m_pagePlane = GetComponent <ToggleGroup>("main/banner/pageScroll"); GetChildenObj(); m_tgSwitchDating = GetComponent <Toggle>("main/top_left/lanternTop"); m_tgSwitchDating.isOn = moduleHome.showDatingModel; m_tgSwitchDating.onValueChanged.AddListener(b => SwitchDatingModel(b)); InitializeIcons(); InitializeUnlockText(); MultiLangrage(); }
void OnDestory() { TweenAlpha.Begin(gameObject, 0.1f, 0f).onFinished.Clear(); Destroy(gameObject); }
void Awake() { instance = this; blood = GetComponent <UISprite>(); tween = GetComponent <TweenAlpha>(); }
// Token: 0x06000327 RID: 807 RVA: 0x0001EF58 File Offset: 0x0001D158 public void Set(bool state, bool notify = true) { if (this.validator != null && !this.validator(state)) { return; } if (!this.mStarted) { this.mIsActive = state; this.startsActive = state; if (this.activeSprite != null) { this.activeSprite.alpha = (this.invertSpriteState ? (state ? 0f : 1f) : (state ? 1f : 0f)); return; } } else if (this.mIsActive != state) { if (this.group != 0 && state) { int i = 0; int size = UIToggle.list.size; while (i < size) { UIToggle uitoggle = UIToggle.list.buffer[i]; if (uitoggle != this && uitoggle.group == this.group) { uitoggle.Set(false, true); } if (UIToggle.list.size != size) { size = UIToggle.list.size; i = 0; } else { i++; } } } this.mIsActive = state; if (this.activeSprite != null) { if (this.instantTween || !NGUITools.GetActive(this)) { this.activeSprite.alpha = (this.invertSpriteState ? (this.mIsActive ? 0f : 1f) : (this.mIsActive ? 1f : 0f)); } else { TweenAlpha.Begin(this.activeSprite.gameObject, 0.15f, this.invertSpriteState ? (this.mIsActive ? 0f : 1f) : (this.mIsActive ? 1f : 0f), 0f); } } if (notify && UIToggle.current == null) { UIToggle uitoggle2 = UIToggle.current; UIToggle.current = this; if (EventDelegate.IsValid(this.onChange)) { EventDelegate.Execute(this.onChange); } else if (this.eventReceiver != null && !string.IsNullOrEmpty(this.functionName)) { this.eventReceiver.SendMessage(this.functionName, this.mIsActive, SendMessageOptions.DontRequireReceiver); } UIToggle.current = uitoggle2; } if (this.animator != null) { ActiveAnimation activeAnimation = ActiveAnimation.Play(this.animator, null, state ? AnimationOrTween.Direction.Forward : AnimationOrTween.Direction.Reverse, EnableCondition.IgnoreDisabledState, DisableCondition.DoNotDisable); if (activeAnimation != null && (this.instantTween || !NGUITools.GetActive(this))) { activeAnimation.Finish(); return; } } else if (this.activeAnimation != null) { ActiveAnimation activeAnimation2 = ActiveAnimation.Play(this.activeAnimation, null, state ? AnimationOrTween.Direction.Forward : AnimationOrTween.Direction.Reverse, EnableCondition.IgnoreDisabledState, DisableCondition.DoNotDisable); if (activeAnimation2 != null && (this.instantTween || !NGUITools.GetActive(this))) { activeAnimation2.Finish(); return; } } else if (this.tween != null) { bool active = NGUITools.GetActive(this); if (this.tween.tweenGroup != 0) { UITweener[] componentsInChildren = this.tween.GetComponentsInChildren <UITweener>(true); int j = 0; int num = componentsInChildren.Length; while (j < num) { UITweener uitweener = componentsInChildren[j]; if (uitweener.tweenGroup == this.tween.tweenGroup) { uitweener.Play(state); if (this.instantTween || !active) { uitweener.tweenFactor = (state ? 1f : 0f); } } j++; } return; } this.tween.Play(state); if (this.instantTween || !active) { this.tween.tweenFactor = (state ? 1f : 0f); } } } }
//在创建或者复用完成后,调用该接口,显示伤害信息 public bool ActiveDamageBoard(int nType, string strValue, Vector3 pos, bool isPlayerSkill = true) { // bool isCriticalDamage = nType == (int)(Games.GlobeDefine.GameDefine_Globe.DAMAGEBOARD_TYPE.PLAYER_ATTACK_CRITICAL) || // nType == (int)(Games.GlobeDefine.GameDefine_Globe.DAMAGEBOARD_TYPE.PLAYER_ATTACK_CRITICAL_PARTNER) || // nType == (int)(Games.GlobeDefine.GameDefine_Globe.DAMAGEBOARD_TYPE.TARGET_ATTACK_CRITICAL); Tab_DamageBoardType tabDamageBoardType = DamageBoardManager.DamageBoardType[nType][0]; if (tabDamageBoardType == null) { tabDamageBoardType = DamageBoardManager.DamageBoardType[0][0]; } m_run = true; // 读取该类型的表格项 // 初始位置 初速度 加速度 //Vector3 vecOrigin = new Vector3(tabDamageBoardType.OriginX, tabDamageBoardType.OriginY, 0); Vector3 vecVelocity = new Vector3(tabDamageBoardType.VelocityX, tabDamageBoardType.VelocityY, 0); Vector3 vecAcceleration = new Vector3(tabDamageBoardType.AccelerationX, tabDamageBoardType.AccelerationY, 0); float fShowTime = tabDamageBoardType.ShowTime; // 正常显示时间 float fFadeTime = tabDamageBoardType.FadeTime; // 渐变消失时间 m_totalShowTime = fShowTime + fFadeTime; // 总运动时间 string strTextColor = tabDamageBoardType.TextColor; // 字体颜色 //string strOutlineColor = tabDamageBoardType.OutlineColor; // 描边颜色 float fTextSize = tabDamageBoardType.TextSize; // 文字大小 float fScaleDelayTime = tabDamageBoardType.ScaleDelayTime; // 尺寸变化延迟时间 float fTextSizeMax = tabDamageBoardType.TextSizeMax; // 最大尺寸 float fScalePlusTime = tabDamageBoardType.ScalePlusTime; // 放大时间 float fTextSizeOver = tabDamageBoardType.TextSizeOver; // 结束尺寸 float fScaleMinusTime = tabDamageBoardType.ScaleMinusTime; // 缩小时间 if (null == m_DamageBoardRootTransform) { m_DamageBoardRootTransform = gameObject.transform; } if (null == m_DamageBoardLabel) { m_DamageBoardLabel = gameObject.GetComponent <UILabel>(); if (null != m_DamageBoardLabel) { m_DamageBoardLabel.effectStyle = UILabel.Effect.None; m_DamageBoardLabel.color = Color.white; } } if (null == m_UAMotion) { m_UAMotion = gameObject.AddComponent <UniformAcceleratedMotion>(); } if (null == m_TweenScalePlus) { m_TweenScalePlus = gameObject.AddComponent <TweenScale>(); } if (null == m_TweenScaleMinus) { m_TweenScaleMinus = gameObject.AddComponent <TweenScale>(); } if (m_TweenAlpha == null) { m_TweenAlpha = gameObject.AddComponent <TweenAlpha>(); } // 使用旧的TweenAlpha需要Reset m_TweenAlpha.Reset(); m_TweenScalePlus.Reset(); m_TweenScaleMinus.Reset(); //LogModule.ErrorLog(fFadeTime+"_" + fShowTime); if (fFadeTime > 0) { m_TweenAlpha.from = 1; m_TweenAlpha.to = 0.001f; m_TweenAlpha.delay = fShowTime; m_TweenAlpha.duration = fFadeTime; m_TweenAlpha.Play(); } // 设置Label控件 // string strText = "[" + strTextColor + "]"; // strText += strValue; // m_DamageBoardLabel.text = strText; m_DamageBoardLabel.text = StrDictionary.GetClientDictionaryString("#{10003}", strTextColor, strValue); if (isPlayerSkill) { m_DamageBoardLabel.font = m_PlayerSkillDamageFont; } else { m_DamageBoardLabel.font = m_OtherSkillDamageFont; } //damageBoardLabel.effectColor = Utils.GetColorByString(strOutlineColor); // 匀变速运动 传入初速度 加速度 运动时间 m_UAMotion.Init(vecVelocity, vecAcceleration, m_totalShowTime); // TweenScale动画 m_TweenScalePlus.from = fTextSize * Vector3.one; m_TweenScalePlus.to = fTextSizeMax * Vector3.one; m_TweenScalePlus.delay = fScaleDelayTime; m_TweenScalePlus.duration = fScalePlusTime; m_TweenScaleMinus.from = fTextSizeMax * Vector3.one; m_TweenScaleMinus.to = fTextSizeOver * Vector3.one; m_TweenScaleMinus.delay = fScalePlusTime; m_TweenScaleMinus.duration = fScaleMinusTime; // 两个动作开始播放 m_UAMotion.Go(); if (fScaleDelayTime >= 0 && fTextSizeMax > 0 && fScalePlusTime >= 0 && fTextSizeOver > 0 && fScaleMinusTime >= 0) { m_TweenScalePlus.enabled = true; m_TweenScaleMinus.enabled = true; m_TweenScalePlus.Play(); m_TweenScaleMinus.Play(); } else { m_TweenScalePlus.enabled = false; m_TweenScaleMinus.enabled = false; } // 最后设置位置 大小 //Add by Lijia,伤害数字高度统一进行2.0的修正,如果以后发现有非2.0的情况,可以找我协商 pos.y += 2.0f; m_DamageBoardRootTransform.position = pos; m_DamageBoardRootTransform.localScale = fTextSize * Vector3.one; m_DamageBoardRootTransform.localRotation = Quaternion.LookRotation(Vector3.forward, Vector3.up); //伤害板面向当前摄像机 Vector3 vecUp = Camera.main.transform.rotation * Vector3.up; m_DamageBoardRootTransform.LookAt(m_DamageBoardRootTransform.position + Camera.main.transform.rotation * Vector3.back, vecUp); m_DamageBoardRootTransform.Rotate(Vector3.up * 180); ShowTime = Time.time; m_DamageBoardLabel.color = Color.white; return(true); }
private void InitController() { m_entry_Tog = new GameButton[MAXPANEL]; this.m_maskBG = Make <GameUIComponent>("MaskBG"); //m_entry_tog_show_tween_pos = new List<TweenPosition>(); //m_entry_tog_hide_tween_pos = new List<TweenPosition>(); //m_entry_tog_tween_alpha = new List<TweenAlpha>(); this.m_activityUI = Make <GameUIComponent>("ActivityAnimator"); this.m_entryBackground = new GameImage[MAXPANEL]; m_red_points = new Dictionary <string, GameImage>(); this.m_bottomUI = Make <GameUIComponent>("Panel_down"); this.m_bottomButtonComponent = Make <GameUIComponent>("Panel_down:mask:grid"); this.m_gridComponent = this.m_bottomButtonComponent.Widget.GetComponent <UnityEngine.UI.GridLayoutGroup>(); for (int i = 0; i < MAXPANEL; i++) { m_entry_Tog[i] = Make <GameButton>(string.Format("Panel_down:mask:grid:Toggle_{0}", i + 1)); #if OFFICER_SYS if (i == 2) { m_newPoliceEffect = m_entry_Tog[i].Make <GameUIEffect>("newPolice"); } #endif GameImage img = m_entry_Tog[i].Make <GameImage>("ImgWarn"); m_red_points[m_panelName[i]] = img; this.m_entryBackground[i] = m_entry_Tog[i].Make <GameImage>(m_entry_Tog[i].gameObject); btnEntry(i); } m_entry_tog_show_tween_pos = this.m_bottomButtonComponent.GetComponent <TweenPosition>(); m_entry_tog_tween_alpha = this.m_bottomButtonComponent.GetComponent <TweenAlpha>(); m_entry_tog_show_tween_pos.SetTweenCompletedCallback(() => EnableBottomButtons(true)); m_hide_btn = Make <GameButton>("Panel_down:Button_hide"); m_menuBtnTweener = m_hide_btn.GetComponent <TweenRotationEuler>(); m_btnSwitchRedPointMark = m_hide_btn.Make <GameImage>("ImgWarn"); m_playerTaskPanelComponent = Make <PlayerTaskComponent>("Panel_Task"); this.m_taskPanel = m_playerTaskPanelComponent.Make <GameUIComponent>("Panel"); m_activity_btn = Make <GameButton>("ActivityAnimator:Button_activities"); m_activity_btn_effect = Make <GameUIEffect>("ActivityAnimator:Button_activities:UI_huodong_02"); m_activity_btn_effect.EffectPrefabName = "UI_huodong_02.prefab"; m_ActivityRedPoint = m_activity_btn.Make <GameImage>("ImgWarn"); #if OFFICER_SYS m_remove_red_points = new Dictionary <string, SafeAction>() { { m_panelName[0], GameEvents.RedPointEvents.Sys_OnNewEmailReadedEvent }, { m_panelName[1], null }, { m_panelName[2], null }, { m_panelName[3], null }, { m_panelName[4], GameEvents.RedPointEvents.Sys_OnNewAchievementReadedEvent }, { m_panelName[5], null }, { m_panelName[6], null /*GameEvents.RedPointEvents.Sys_OnNewFriendReadedEvent*/ }, }; #else m_remove_red_points = new Dictionary <string, SafeAction>() { { m_panelName[0], GameEvents.RedPointEvents.Sys_OnNewEmailReadedEvent }, { m_panelName[1], null }, { m_panelName[2], null }, { m_panelName[3], null }, { m_panelName[4], GameEvents.RedPointEvents.Sys_OnNewAchievementReadedEvent }, { m_panelName[5], null }, { m_panelName[6], null }, }; #endif this.m_panelDown = this.Transform.Find("Panel_down"); m_push_gift_btn = this.Make <GameButton>("ActivityAnimator:Button_activitiesgift"); m_push_gift_count_root = m_push_gift_btn.Make <GameLabel>("ImgWarn"); m_push_gift_count_txt = m_push_gift_btn.Make <GameLabel>("ImgWarn:Text"); m_push_gift_left_time_txt = m_push_gift_btn.Make <GameLabel>("time"); m_push_gift_view = this.Make <GiftView>("Panel_activitiesgift"); m_push_gift_btn_effect = this.Make <GameUIEffect>("ActivityAnimator:Button_activitiesgift:UI_huodong_03"); m_push_gift_btn_effect.EffectPrefabName = "UI_huodong_03.prefab"; m_combine_tips = Make <CombineTipsView>("Image"); }
public void Hide() { isShowing = false; TweenAlpha.Begin(gameObject, 0.1f, 0); TweenAlpha.Begin(DetailsRoot, 0.1f, 0); }
private void FadeIn() { TweenAlpha tween = TweenAlpha.Begin(gameObject, 0.5f, 1); EventDelegate.Add(tween.onFinished, FadeInCallback, true); }
protected override bool Init() { this.isAnimationStarted = false; this.mDisplaySwipeRegion.SetEventCatchCamera(this.mCamera); this.mDisplaySwipeRegion.SetOnSwipeActionJudgeCallBack(new UIDisplaySwipeEventRegion.SwipeJudgeDelegate(this.OnSwipeAction)); this.mStageSelectRoot.set_localPosition(new Vector3(this.mCamera.get_transform().get_localPosition().x, this.mCamera.get_transform().get_localPosition().y)); this.mAreaId = StrategyTopTaskManager.Instance.TileManager.FocusTile.areaID; this.mStrategyTopTaskManager = StrategyTaskManager.GetStrategyTop(); this.mIsFinishedAnimation = false; this.mMapModels = StrategyTopTaskManager.GetLogicManager().SelectArea(this.mAreaId).Maps; this.mSortieManager = StrategyTopTaskManager.GetLogicManager().SelectArea(this.mAreaId); this.mKeyController = new KeyControl(0, 0, 0.4f, 0.1f); this.mKeyController.isLoopIndex = true; this.mKeyController.IsRun = false; TweenAlpha.Begin(GameObject.Find("Information Root"), 0.3f, 0f); TweenAlpha.Begin(GameObject.Find("Map_BG"), 0.3f, 0f); GameObject gameObject = StrategyTopTaskManager.Instance.TileManager.Tiles[this.mAreaId].getSprite().get_gameObject(); this.mTransform_AnimationTile = Util.Instantiate(gameObject, GameObject.Find("Map Root").get_gameObject(), true, false).get_transform(); this.mAnimation_MapObjects = this.mTransform_StageCovers.GetComponent <Animation>(); base.StartCoroutine(this.StartSeaAnimationCoroutine()); IEnumerator enumerator = this.StartSeaAnimationCoroutine(); base.StartCoroutine(enumerator); this.mTransform_StageCovers.SetActive(true); this.mTransform_StageCovers.Find("UIStageCovers").GetComponent <UIWidget>().alpha = 0.001f; this.SelectedHexAnimation(delegate { base.StartCoroutine(this.InititalizeStageCovers(delegate { this.mTransform_StageCovers.GetComponent <Animation>().Play("SortieAnimation"); this.ShowMaps(this.mMapModels); })); }); if (this.mAreaId == 2 || this.mAreaId == 4 || this.mAreaId == 5 || this.mAreaId == 6 || this.mAreaId == 7 || this.mAreaId == 10 || this.mAreaId == 14) { this.mTexture_sallyBGsky.mainTexture = (Resources.Load("Textures/Strategy/sea2_Sunny_sky") as Texture); this.mTexture_sallyBGclouds.mainTexture = (Resources.Load("Textures/Strategy/sea2_Sunny_clouds") as Texture); this.mTexture_sallyBGcloudRefl.mainTexture = (Resources.Load("Textures/Strategy/sea2_Sunny_clouds") as Texture); this.mTexture_sallyBGcloudRefl.height = 91; this.mTexture_sallyBGcloudRefl.alpha = 0.25f; this.mTexture_bgSea.mainTexture = (Resources.Load("Textures/Strategy/sea2_Sunny_sea") as Texture); this.mTexture_snow.mainTexture = null; } else if (this.mAreaId == 3 || this.mAreaId == 13) { this.mTexture_sallyBGsky.mainTexture = (Resources.Load("Textures/Strategy/sea3_Sunny_sky") as Texture); this.mTexture_sallyBGclouds.mainTexture = (Resources.Load("Textures/Strategy/sea3_Sunny_clouds") as Texture); this.mTexture_sallyBGcloudRefl.mainTexture = (Resources.Load("Textures/Strategy/sea3_Sunny_clouds") as Texture); this.mTexture_sallyBGcloudRefl.height = 90; this.mTexture_sallyBGcloudRefl.alpha = 0.75f; this.mTexture_bgSea.mainTexture = (Resources.Load("Textures/Strategy/sea3_Sunny_sea") as Texture); this.mTexture_snow.mainTexture = (Resources.Load("Textures/Strategy/sea3_snow") as Texture); } else if (this.mAreaId == 15 || this.mAreaId == 16 || this.mAreaId == 17) { this.mTexture_sallyBGsky.mainTexture = (Resources.Load("Textures/Strategy/sea4_Sunny_sky2") as Texture); this.mTexture_sallyBGclouds.mainTexture = (Resources.Load("Textures/Strategy/sea4_Sunny_clouds") as Texture); this.mTexture_sallyBGcloudRefl.mainTexture = (Resources.Load("Textures/Strategy/sea4_Sunny_clouds") as Texture); this.mTexture_sallyBGcloudRefl.height = 120; this.mTexture_sallyBGcloudRefl.alpha = 0.25f; this.mTexture_bgSea.mainTexture = (Resources.Load("Textures/Strategy/sea4_Sunny_sea") as Texture); this.mTexture_snow.mainTexture = null; } else { this.mTexture_sallyBGsky.mainTexture = (Resources.Load("Textures/Strategy/sea1_Sunny_sky") as Texture); this.mTexture_sallyBGclouds.mainTexture = (Resources.Load("Textures/Strategy/sea1_Sunny_clouds") as Texture); this.mTexture_sallyBGcloudRefl.mainTexture = (Resources.Load("Textures/Strategy/sea1_Sunny_clouds") as Texture); this.mTexture_sallyBGcloudRefl.height = 140; this.mTexture_sallyBGcloudRefl.alpha = 0.25f; this.mTexture_bgSea.mainTexture = (Resources.Load("Textures/Strategy/sea1_Sunny_sea") as Texture); this.mTexture_snow.mainTexture = null; } return(true); }
void applyTweenEvents(UILabel label, int difference, TweenPosition positionTween, TweenAlpha alphaTween, UILabel destinationLabel, Color positveColor, Color negativeColor, float duration = 2.5f) { if (difference > 0) { label.text = "+ " + difference.ToString(); } else { label.text = difference.ToString(); } positionTween = label.GetComponent <TweenPosition>(); alphaTween = label.GetComponent <TweenAlpha>(); if (positionTween == null) { positionTween = label.gameObject.AddMissingComponent <TweenPosition>(); positionTween.from = new Vector3(label.transform.localPosition.x, label.transform.localPosition.y, 0); positionTween.to = new Vector3(label.transform.localPosition.x, (root.activeHeight / 2) - (destinationLabel.height / 2), 0); positionTween.duration = duration; positionTween.style = UITweener.Style.Once; positionTween.Play(); } else { positionTween.ResetToBeginning(); positionTween.Play(); } //tweenPosition.onFinished.Add(EventDelegate(this.OnTweenFinished)); if (difference > 0) { label.color = positveColor; } else { label.color = negativeColor; } if (alphaTween == null) { alphaTween = label.gameObject.AddMissingComponent <TweenAlpha>(); alphaTween.from = 1f; alphaTween.to = 0f; alphaTween.duration = duration; alphaTween.style = UITweener.Style.Once; alphaTween.Play(); } else { alphaTween.ResetToBeginning(); alphaTween.Play(); } }
private void OnPopStatePracticeTypeSelect() { mPracticeMenu.SetKeyController(null); TweenAlpha.Begin(base.gameObject, 0.2f, 0f); StrategyTaskManager.SceneCallBack(); }
public override void Awake() { base.Awake(); TweenAlpha = mDMono.transform.GetComponentEx <TweenAlpha>(); }
//进入小游戏 IEnumerator SmallGameEffect(int index) { if (int.Parse(smallGameTimesLabel.text) > 0) { //挥舞锤子效果 GameObject Amin_Hammer = Instantiate(hammmerObj) as GameObject; Amin_Hammer.transform.parent = sycee.transform.parent; Amin_Hammer.transform.localScale = Vector3.one; Amin_Hammer.transform.eulerAngles = Vector3.zero; Amin_Hammer.transform.localPosition = new Vector3(31f, 105f, 0); Animator ham_anim = Amin_Hammer.GetComponent <Animator>(); ham_anim.SetBool("HammerStart", true); yield return(new WaitForSeconds(1f)); aso.PlayOneShot(tapClip); yield return(new WaitForSeconds(0.5f)); ham_anim.SetBool("HammerStart", false); Destroy(Amin_Hammer); //中奖 if (tag_small == 1) { aso.PlayOneShot(bigPrizeClip); manAnim.SetTrigger("laugh"); TweenAlpha.Begin(sycee.transform.FindChild("light").gameObject, 0.3f, 1); smallPrizeLabel.text = (double.Parse(smallPrizeLabel.text) + money_small).ToString(); AddMoney(money_small); yield return(new WaitForSeconds(2f)); count++; } //nothing else if (tag_small == 2) { //可用次数降低,金额增加 smallGameTimesLabel.text = (int.Parse(smallGameTimesLabel.text) - 1).ToString(); smallGameTimesLabel.GetComponentInParent <Animator>().SetTrigger("timeLose"); smallGameTimesLabel.GetComponentInParent <UIPlaySound>().Play(); smallPrizeLabel.text = (double.Parse(smallPrizeLabel.text) + money_small).ToString(); aso.PlayOneShot(smallPrizeClip); GameObject amin_Broken = sycee; UISpriteAnimation ua = amin_Broken.GetComponent <UISpriteAnimation>(); ua.enabled = true; ua.ResetToBeginning(); yield return(new WaitForSeconds(2f)); if (int.Parse(smallGameTimesLabel.text) != 0) { ua.enabled = false; amin_Broken.GetComponent <UISprite>().spriteName = "sycee"; count = 0; for (int i = 0; i < fiveSycees.Length; i++) { Destroy(fiveSycees [i]); } InstaniateSycees(); } } if (count >= 5) { GameObject bigPrizeEffect = Instantiate(bigPrizeEffectObj) as GameObject; bigPrizeEffect.transform.parent = this.transform; bigPrizeEffect.transform.localScale = Vector3.one; bigPrizeEffect.transform.localEulerAngles = Vector3.zero; bigPrizeEffect.transform.localPosition = new Vector3(-327, 833, 0); count = 0; //可用次数降低,金额增加 smallGameTimesLabel.text = (int.Parse(smallGameTimesLabel.text) - 1).ToString(); smallGameTimesLabel.GetComponentInParent <Animator>().SetTrigger("timeLose"); smallGameTimesLabel.GetComponentInParent <UIPlaySound>().Play(); if (int.Parse(smallGameTimesLabel.text) != 0) { for (int i = 0; i < fiveSycees.Length; i++) { Destroy(fiveSycees [i]); } InstaniateSycees(); } } } if (int.Parse(smallGameTimesLabel.text) == 0) { yield return(new WaitForSeconds(1.5f)); StartCoroutine(Small_Over(double.Parse(smallPrizeLabel.text))); } else { SmallGame.canSelect = true; } }
void PlayEnterAnimation() { if (playingQueue.Count > 0) { readyPlaying.Enqueue(PlayEnterAnimation); return; } playingQueue.Clear(); if (EnterPosAnimation != null && EnterPosAnimation.Length > 0 && enterPosDuration != null && enterPosDuration.Length >= EnterPosAnimation.Length && enterPosTo != null && enterPosTo.Length >= EnterPosAnimation.Length) { for (int i = 0; i < EnterPosAnimation.Length; ++i) { if (EnterPosAnimation[i] != null) { TweenPosition tween = TweenPosition.Begin(EnterPosAnimation[i].gameObject, enterPosDuration[i], enterPosTo[i]); tween.from = enterPosFrom[i]; tween.animationCurve = enterPosCurve[i]; tween.onFinished.Clear(); tween.AddOnFinished(FinishEnterAnimation); playingQueue.Enqueue(tween); } } } if (EnterScaleAnimation != null && EnterScaleAnimation.Length > 0 && enterScaleDuration != null && enterScaleDuration.Length >= EnterScaleAnimation.Length && enterScaleTo != null && enterScaleTo.Length >= EnterScaleAnimation.Length) { for (int i = 0; i < EnterScaleAnimation.Length; ++i) { if (EnterScaleAnimation[i] != null) { TweenScale tween = TweenScale.Begin(EnterScaleAnimation[i].gameObject, enterScaleDuration[i], enterScaleTo[i]); tween.from = enterScaleFrom[i]; tween.animationCurve = enterScaleCurve[i]; tween.onFinished.Clear(); tween.AddOnFinished(FinishEnterAnimation); playingQueue.Enqueue(tween); } } } if (EnterAlphaAnimation != null && EnterAlphaAnimation.Length > 0 && enterAlphaDuration != null && enterAlphaDuration.Length >= EnterAlphaAnimation.Length && enterAlphaTo != null && enterAlphaTo.Length >= EnterAlphaAnimation.Length) { for (int i = 0; i < EnterAlphaAnimation.Length; ++i) { if (EnterAlphaAnimation[i] != null) { TweenAlpha tween = TweenAlpha.Begin(EnterAlphaAnimation[i].gameObject, enterAlphaDuration[i], enterAlphaTo[i]); tween.from = enterAlphaFrom[i]; tween.animationCurve = enterAlphaCurve[i]; tween.onFinished.Clear(); tween.AddOnFinished(FinishEnterAnimation); playingQueue.Enqueue(tween); } } } if (EnterRotAnimation != null && EnterRotAnimation.Length > 0 && enterRotDuration != null && enterRotDuration.Length >= EnterRotAnimation.Length && enterRotTo != null && enterRotTo.Length >= EnterRotAnimation.Length) { for (int i = 0; i < EnterRotAnimation.Length; ++i) { if (EnterRotAnimation[i] != null) { TweenRotation tween = TweenRotation.Begin(EnterRotAnimation[i].gameObject, enterRotDuration[i], Quaternion.Euler(enterRotTo[i])); tween.from = enterRotFrom[i]; tween.animationCurve = enterRotCurve[i]; tween.onFinished.Clear(); tween.AddOnFinished(FinishEnterAnimation); playingQueue.Enqueue(tween); } } } //当PlayingQueue为0时,表示没有Tween动画,需要直接退出,以保证之前的 UICamera.ProhibitUI = true 造成的UI锁屏 if (playingQueue.Count <= 0) { FinishEnterAnimation(); } }
/// <summary> /// Fade out or fade in the active sprite and notify the OnChange event listener. /// </summary> public void Set(bool state) { if (validator != null && !validator(state)) { return; } if (!mStarted) { mIsActive = state; startsActive = state; if (activeSprite != null) { activeSprite.alpha = state ? 1f : 0f; } } else if (mIsActive != state) { // Uncheck all other toggles if (group != 0 && state) { for (int i = 0, imax = list.size; i < imax;) { UIToggle cb = list[i]; if (cb != this && cb.group == group) { cb.Set(false); } if (list.size != imax) { imax = list.size; i = 0; } else { ++i; } } } // Remember the state mIsActive = state; // Tween the color of the active sprite if (activeSprite != null) { if (instantTween || !NGUITools.GetActive(this)) { activeSprite.alpha = mIsActive ? 1f : 0f; } else { TweenAlpha.Begin(activeSprite.gameObject, 0.15f, mIsActive ? 1f : 0f); } } if (current == null) { UIToggle tog = current; current = this; if (EventDelegate.IsValid(onChange)) { EventDelegate.Execute(onChange); } else if (eventReceiver != null && !string.IsNullOrEmpty(functionName)) { // Legacy functionality support (for backwards compatibility) eventReceiver.SendMessage(functionName, mIsActive, SendMessageOptions.DontRequireReceiver); } current = tog; } // Play the checkmark animation if (activeAnimation != null) { ActiveAnimation aa = ActiveAnimation.Play(activeAnimation, null, state ? Direction.Forward : Direction.Reverse, EnableCondition.IgnoreDisabledState, DisableCondition.DoNotDisable); if (aa != null && (instantTween || !NGUITools.GetActive(this))) { aa.Finish(); } } } }
/*void Update() * { * if (Input.GetKeyUp(KeyCode.A)) * { * CreateSugar(1); * CreateSugar(3); * CreateSugar(4); * CreateSugar(5); * CreateSugar(7); * } * }*/ //public void Show(bool isShow) //{ //if (isShow) //{ //GameApp.Instance.FadeHelperInstance.FadeIn(0.05f, Color.black, () => //{ //gameObject.SetActive(true); //AppearEffect.transform.localScale = Vector3.one * 0.01f; //AppearEffect.Open(AppearType.Popup, AppearEffect.gameObject, 0, () => //{ //GameApp.Instance.FadeHelperInstance.FadeOut(0.05f); //}); //GameApp.Instance.UICurrency.transform.localPosition = new Vector3(-10,0,0); //GameApp.Instance.UICurrency.Show(true); //CourtyardRoot.SetActive(true); //RoomRoot.SetActive(false); //}); /*} * else * { * GameApp.Instance.UICurrency.transform.localPosition = Vector3.zero; * GameApp.Instance.UICurrency.Show(false); * * GameApp.Instance.FadeHelperInstance.FadeIn(0.05f, Color.black, () => * { * AppearEffect.Close(AppearType.Popup, () => * { * GameApp.Instance.FadeHelperInstance.FadeOut(0.05f); * * gameObject.SetActive(false); * }); * }); * }*/ //} public void ShowGetOutHint() { TweenAlpha.Begin(GetOutHint, 0.2f, 1); GameApp.Instance.NeedShowGetOutHint = false; }
private void ShowSelfDefinePop() { Transform gTransform = gameObject.transform; foreach (UITweener itemTweener in popTweeners) { if (itemTweener is TweenAlpha) { TweenAlpha itemAlpha = itemTweener as TweenAlpha;; TweenAlpha tweenAlpha = gameObject.AddMissingComponent <TweenAlpha>(); tweenAlpha.enabled = false; tweenAlpha.mTrans = gTransform; tweenAlpha = TweenAlpha.Begin(gameObject, itemAlpha.duration, itemAlpha.to); tweenAlpha.delay = itemAlpha.delay; tweenAlpha.duration = itemTweener.duration; tweenAlpha.animationCurve = itemTweener.animationCurve; tweenAlpha.from = itemAlpha.from; tweenAlpha.to = itemAlpha.to; tweenAlpha.onFinished.Clear(); tweenAlpha.AddOnFinished(FinishEnterAnimation); playingQueue.Enqueue(tweenAlpha); } else if (itemTweener is TweenPosition) { TweenPosition itemPosition = itemTweener as TweenPosition; TweenPosition tweenPosition = gameObject.AddMissingComponent <TweenPosition>(); tweenPosition.enabled = false; tweenPosition.mTrans = gTransform; tweenPosition = TweenPosition.Begin(gameObject, itemPosition.duration, itemPosition.to + gTransform.localPosition); tweenPosition.delay = itemPosition.delay; tweenPosition.duration = itemPosition.duration; tweenPosition.animationCurve = itemPosition.animationCurve; tweenPosition.from = itemPosition.from + gTransform.localPosition; tweenPosition.to = itemPosition.to + gTransform.localPosition; gTransform.localPosition = tweenPosition.from; tweenPosition.onFinished.Clear(); tweenPosition.AddOnFinished(FinishEnterAnimation); playingQueue.Enqueue(tweenPosition); } else if (itemTweener is TweenScale) { TweenScale itemScale = itemTweener as TweenScale; TweenScale tweenScale = gameObject.AddMissingComponent <TweenScale>(); tweenScale.enabled = false; tweenScale.mTrans = gTransform; tweenScale = TweenScale.Begin(gameObject, itemScale.duration, itemScale.to); tweenScale.delay = itemScale.delay; tweenScale.duration = itemScale.duration; tweenScale.animationCurve = itemScale.animationCurve; tweenScale.from = itemScale.from; tweenScale.to = itemScale.to; gTransform.localScale = tweenScale.from; // tweenScale.value = Vector3.zero; tweenScale.onFinished.Clear(); tweenScale.AddOnFinished(FinishEnterAnimation); playingQueue.Enqueue(tweenScale); } else { LogMgr.instance.Log(LogLevel.ERROR, LogTag.None, "devindzhang itemTweener is not case:" + itemTweener); } } }
void Awake() { _instance = this; ta = this.GetComponent <TweenAlpha> (); }
void PlayExitAnimation() { if (playingQueue.Count > 0) { readyPlaying.Enqueue(PlayExitAnimation); return; } if (ExitPosAnimation != null && ExitPosAnimation.Length > 0) { for (int i = 0; i < ExitPosAnimation.Length; ++i) { if (ExitPosAnimation[i] != null) { TweenPosition tween = TweenPosition.Begin(ExitPosAnimation[i].gameObject, exitPosDuration[i], exitPosTo[i]); tween.from = exitPosFrom[i]; tween.animationCurve = exitPosCurve[i]; tween.onFinished.Clear(); tween.AddOnFinished(FinishExitAnimation); playingQueue.Enqueue(tween); } } } if (ExitScaleAnimation != null && ExitScaleAnimation.Length > 0) { for (int i = 0; i < ExitScaleAnimation.Length; ++i) { if (ExitScaleAnimation[i] != null) { TweenScale tween = TweenScale.Begin(ExitScaleAnimation[i].gameObject, exitScaleDuration[i], exitScaleTo[i]); tween.from = exitScaleFrom[i]; tween.animationCurve = exitScaleCurve[i]; tween.onFinished.Clear(); tween.AddOnFinished(FinishExitAnimation); playingQueue.Enqueue(tween); } } } if (ExitAlphaAnimation != null && ExitAlphaAnimation.Length > 0) { for (int i = 0; i < ExitAlphaAnimation.Length; ++i) { if (ExitAlphaAnimation[i] != null) { TweenAlpha tween = TweenAlpha.Begin(ExitAlphaAnimation[i].gameObject, exitAlphaDuration[i], exitAlphaTo[i]); tween.from = exitAlphaFrom[i]; tween.animationCurve = exitAlphaCurve[i]; tween.onFinished.Clear(); tween.AddOnFinished(FinishExitAnimation); playingQueue.Enqueue(tween); } } } if (ExitRotAnimation != null && ExitRotAnimation.Length > 0 && exitRotDuration != null && exitRotDuration.Length >= ExitRotAnimation.Length && exitRotTo != null && exitRotTo.Length >= ExitRotAnimation.Length) { for (int i = 0; i < ExitRotAnimation.Length; ++i) { if (ExitRotAnimation[i] != null) { TweenRotation tween = TweenRotation.Begin(ExitRotAnimation[i].gameObject, exitRotDuration[i], Quaternion.Euler(exitRotTo[i])); tween.from = exitRotFrom[i]; tween.animationCurve = exitRotCurve[i]; tween.onFinished.Clear(); tween.AddOnFinished(FinishEnterAnimation); playingQueue.Enqueue(tween); } } } if (playingQueue.Count <= 0) { FinishExitAnimation(); } }
// Token: 0x06001763 RID: 5987 RVA: 0x00080020 File Offset: 0x0007E220 public IEnumerator AnimateAlpha(float to, float duration, params UIPanel[] buttons) { TweenAlpha[] tweens = Array.ConvertAll <UIPanel, TweenAlpha>(buttons, (UIPanel el) => TweenAlpha.Begin(el.gameObject, duration, to)); foreach (TweenAlpha el2 in tweens) { while (el2.enabled) { yield return(0); } } yield break; }
void Update() { bool bInit = false; if (m_eStepPre != m_eStep) { m_eStepPre = m_eStep; bInit = true; } switch (m_eStep) { case STEP.APPEAR: if (bInit) { TweenAlpha ta = TweenAlphaAll(m_sprite.gameObject, 1.0f, 1.0f); EventDelegate.Set(ta.onFinished, EndTween); m_btnSprite.TriggerClear(); } if (m_bEndTween) { m_eStep = STEP.WAIT; } else if (m_btnSprite.ButtonPushed) { m_eStep = STEP.CLOSE; } else { } break; case STEP.WAIT: if (bInit) { m_fTimer = 0.0f; } m_fTimer += Time.deltaTime; if (5.0f < m_fTimer) { m_eStep = STEP.IDLE; } else if (m_btnSprite.ButtonPushed) { m_eStep = STEP.CLOSE; } else { } break; case STEP.IDLE: if (bInit) { //TweenAlphaAll (m_btnClose.gameObject, 1.0f, 1.0f); m_btnClose.gameObject.SetActive(true); m_btnClose.TriggerClear(); } if (m_btnClose.ButtonPushed) { m_eStep = STEP.CLOSE; } else if (m_btnSprite.ButtonPushed) { m_eStep = STEP.CLOSE; } else { } break; case STEP.CLOSE: if (bInit) { TweenAlpha ta = TweenAlphaAll(gameObject, 0.5f, 0.0f); EventDelegate.Set(ta.onFinished, EndTween); } if (m_bEndTween) { m_eStep = STEP.END; } break; case STEP.END: if (bInit) { m_bIsEnd = true; } break; case STEP.MAX: default: break; } }
public void Show(TipsData data, float cw, float ch, Tips root) { tipsData = data; clipWidth = cw; clipHeight = ch; mRoot = root; tipsData.OnShow(); gameObject.SetActive(true); label.width = label.minWidth; label.height = label.minHeight; label.text = tipsData.mMessage; label.MakePixelPerfect(); label.gameObject.SetActive(true); //background.SetDimensions(label.width + 150, background.height); background.gameObject.SetActive(true); background.depth = labelBornDepth++; label.depth = labelBornDepth++; gameObject.transform.localPosition = bornPosition; TweenPosition tp = this.gameObject.GetComponent <TweenPosition>(); tp.ResetToBeginning(); TweenAlpha ta = this.gameObject.GetComponent <TweenAlpha>(); ta.ResetToBeginning(); if (tipsData.mType == Tips.TipsType.FlowLeft) { background.gameObject.SetActive(false); float offset = label.width / 2 + clipWidth / 2; Vector3 posStart = new Vector3(bornPosition.x + offset, bornPosition.y, bornPosition.z); Vector3 posEnd = new Vector3(bornPosition.x - offset, bornPosition.y, bornPosition.z); gameObject.transform.localPosition = posStart; tp.from = posStart; tp.to = posEnd; tp.duration = (posEnd.x - posStart.x) / (clipWidth / 3f); tp.enabled = true; ta.to = 0.0f; ta.duration = 0.6f; ta.enabled = false; } else if (tipsData.mType == Tips.TipsType.FlowUp) { tp.from = bornPosition; tp.to = new Vector3(bornPosition.x, clipHeight / 2, bornPosition.z); tp.duration = 2.5f; tp.enabled = true; ta.to = 0.0f; ta.duration = 1.5f; ta.enabled = true; } mRoot.OnShowUIToast(tipsData.mType); }
private void doClear(int type) { TweenAlpha.Begin(m_BlackScreen.gameObject, 1, 1); StartCoroutine(clearResCoroutine(type)); }
private void Set(bool state) { if (!this.mStarted) { this.mIsActive = state; this.startsActive = state; if (this.activeSprite != null) { this.activeSprite.alpha = ((!state) ? 0f : 1f); } if (this.activeSprite2 != null) { this.activeSprite2.alpha = ((!state) ? 0f : 1f); } } else if (this.mIsActive != state) { if (this.group != 0 && state) { int i = 0; int size = UIToggle.list.size; while (i < size) { UIToggle uIToggle = UIToggle.list[i]; if (uIToggle != this && uIToggle.group == this.group) { uIToggle.Set(false); } if (UIToggle.list.size != size) { size = UIToggle.list.size; i = 0; } else { i++; } } } this.mIsActive = state; if (this.activeSprite != null) { if (this.instantTween) { this.activeSprite.alpha = ((!this.mIsActive) ? 0f : 1f); } else { TweenAlpha.Begin(this.activeSprite.gameObject, 0.15f, (!this.mIsActive) ? 0f : 1f); } } if (this.activeSprite2 != null) { if (this.instantTween) { this.activeSprite2.alpha = ((!this.mIsActive) ? 0f : 1f); } else { TweenAlpha.Begin(this.activeSprite2.gameObject, 0.15f, (!this.mIsActive) ? 0f : 1f); } } if (UIToggle.current == null) { UIToggle.current = this; if (EventDelegate.IsValid(this.onChange)) { EventDelegate.Execute(this.onChange); } else if (this.eventReceiver != null && !string.IsNullOrEmpty(this.functionName)) { this.eventReceiver.SendMessage(this.functionName, this.mIsActive, SendMessageOptions.DontRequireReceiver); } UIToggle.current = null; } if (this.activeAnimation != null) { ActiveAnimation activeAnimation = ActiveAnimation.Play(this.activeAnimation, (!state) ? Direction.Reverse : Direction.Forward); if (this.instantTween) { activeAnimation.Finish(); } } } }
public void Set(bool state) { if (validator != null && !validator(state)) { return; } if (!mStarted) { mIsActive = state; startsActive = state; if (activeSprite != null) { activeSprite.alpha = ((!state) ? 0f : 1f); } } else { if (mIsActive == state) { return; } if (group != 0 && state) { int num = 0; int size = list.size; while (num < size) { UIToggle uIToggle = list[num]; if (uIToggle != this && uIToggle.group == group) { uIToggle.Set(state: false); } if (list.size != size) { size = list.size; num = 0; } else { num++; } } } mIsActive = state; if (activeSprite != null) { if (instantTween || !NGUITools.GetActive(this)) { activeSprite.alpha = ((!mIsActive) ? 0f : 1f); } else { TweenAlpha.Begin(activeSprite.gameObject, 0.15f, (!mIsActive) ? 0f : 1f); } } if (current == null) { UIToggle uIToggle2 = current; current = this; if (EventDelegate.IsValid(onChange)) { EventDelegate.Execute(onChange); } else if (eventReceiver != null && !string.IsNullOrEmpty(functionName)) { eventReceiver.SendMessage(functionName, mIsActive, SendMessageOptions.DontRequireReceiver); } if (value && EventDelegate.IsValid(onActive)) { EventDelegate.Execute(onActive); } current = uIToggle2; } if ((UnityEngine.Object)animator != null) { ActiveAnimation activeAnimation = ActiveAnimation.Play(animator, null, state ? Direction.Forward : Direction.Reverse, EnableCondition.IgnoreDisabledState, DisableCondition.DoNotDisable); if (activeAnimation != null && (instantTween || !NGUITools.GetActive(this))) { activeAnimation.Finish(); } } else if ((UnityEngine.Object) this.activeAnimation != null) { ActiveAnimation activeAnimation2 = ActiveAnimation.Play(this.activeAnimation, null, state ? Direction.Forward : Direction.Reverse, EnableCondition.IgnoreDisabledState, DisableCondition.DoNotDisable); if (activeAnimation2 != null && (instantTween || !NGUITools.GetActive(this))) { activeAnimation2.Finish(); } } } }
void Awake() { instance = this; tween = GetComponent <TweenAlpha>(); label = transform.Find("Sprite/Label").GetComponent <UILabel>(); }
/// <summary> /// Drop the dragged object. /// </summary> void Drop() { TweenAlpha.Begin(gameObject, 0.5f, 1); }
protected override void Init() { instance = this; go = GameObject.Find("UI Root").gameObject; tweens.AddRange(bagBtn.GetComponents <UITweener>()); tweens.AddRange(heroBtn.GetComponents <UITweener>()); tweens.AddRange(altarBtn.GetComponents <UITweener>()); tweens.AddRange(ectypeBtn.GetComponents <UITweener>()); tweens.AddRange(embattle.GetComponents <UITweener>()); tweens.AddRange(shopBtn.GetComponents <UITweener>()); tweens.AddRange(enchantBtn.GetComponents <UITweener>()); tweens.AddRange(rankListBtn.GetComponents <UITweener>()); tweens.AddRange(arenaABtn.GetComponents <UITweener>()); tweens.AddRange(systemBtn.GetComponents <UITweener>()); tweens.AddRange(societyBtn.GetComponents <UITweener>()); tweens.AddRange(shoucangBtn.GetComponents <UITweener>()); if (EquipBtn != null) { tweens.AddRange(EquipBtn.GetComponents <UITweener>()); } //顶层按钮 tweensTop.AddRange(taskBtn.GetComponents <UITweener>()); tweensTop.AddRange(friendBtn.GetComponents <UITweener>()); tweensTop.AddRange(welfareBtn.GetComponents <UITweener>()); tweensTop.AddRange(mailBtn.GetComponents <UITweener>()); sysTemTweenP = transform.Find("SystemSetting").GetComponent <TweenPosition>(); sysTemTweenA = transform.Find("SystemSetting").GetComponent <TweenAlpha>(); Shrink = transform.Find("ShrinkTopBtn").GetComponent <UISprite>(); mark = transform.Find("SystemSetting/Mark").GetComponent <UISprite>(); yinyueSwitch = transform.Find("SystemSetting/YinyueSwitch").GetComponent <GUISingleButton>(); yinxiaoSwitch = transform.Find("SystemSetting/YinxiaoSwitch").GetComponent <GUISingleButton>(); shrinkBtn.GetComponentInChildren <UIPlaySound>(); isShrink = false; shrinkBtn.onClick = OnShrinkClick; embattle.onClick = OnEmbattle; bagBtn.onClick = OnBagClick; heroBtn.onClick = OnHeroBtnClick; taskBtn.onClick = OnTaskBtn; altarBtn.onClick = OnAltarClick; //expBar.state = ProgressState.STRING; //expBar.InValue(800f, 1000f); //expBar.InValue(int.Parse(playerData.GetInstance().selfData.exprience.ToString()), int.Parse(playerData.GetInstance().selfData.maxExprience.ToString())); //expBar.onChange = OnExpChange; shopBtn.onClick = OnShopBtnClick; ectypeBtn.onClick = OnEctypeClick; enchantBtn.onClick = OnEnchantBtnClick; rankListBtn.onClick = OnRankListClick; friendBtn.onClick = OnFriendClick; arenaABtn.onClick = OnArenaABtnClick; welfareBtn.onClick = OnWelfareBtnClick; mailBtn.onClick = OnMailOnClick; societyBtn.onClick = OnSocietyClick; systemBtn.onClick = OnSysTemClick; shoucangBtn.onClick = OnShouCangClick; yinyueSwitch.onClick = YinyueSwitchOnClick; yinxiaoSwitch.onClick = YinxiaoSwitchOnClick; shrinkTopBtn.onClick = OnShrinkTopClick; if (EquipBtn != null) { EquipBtn.onClick = OnEquipBtn; } sysTemTweenP.gameObject.SetActive(false); isShrinkTop = false; Singleton <RedPointManager> .Instance.NotifyRedChangeEvent += SetMainSettingRed; }