public void ShowAnim(bool isStrength) { ChangeStrenType(isStrength); m_tweenPosComponent.Play(true); this.CurrrEquipDetails.ShowAnim(); this.PackRightBtnManager.ShowAnim(); }
void OnSelect(object o) { bool isSelected = _input.selected; _tween.enabled = true; _tween.Play(isSelected); }
private void OnSysTemClick() { isShrinkSystemBtn = !isShrinkSystemBtn; sysTemTweenP.Play(isShrinkSystemBtn); sysTemTweenA.Play(isShrinkSystemBtn); sysTemTweenP.gameObject.SetActive(true); bool p = serverMgr.GetInstance().GetGameMusic(); if (p) { yinyueSwitch.spriteName = "yinyueguan"; } else { yinyueSwitch.spriteName = "yinyue"; } bool s = serverMgr.GetInstance().GetGameSoundEffect(); if (s) { yinxiaoSwitch.spriteName = "yingxiaoguan"; } else { yinxiaoSwitch.spriteName = "yingxiao"; } //mark.gameObject.SetActive(true); }
// Use this for initialization void Start() { uiscript = (UIScript)GameObject.FindGameObjectWithTag("MainCamera").GetComponent("UIScript"); falconSpawnPoint = new Transform[falconSpawns.childCount]; int i = 0; foreach (Transform theSpawnPoint in falconSpawns) { falconSpawnPoint [i] = theSpawnPoint; i++; } i = 0; tankSpawnPoint = new Transform[tankSpawns.childCount]; foreach (Transform theSpawnPoint in tankSpawns) { tankSpawnPoint[i] = theSpawnPoint; i++; } SetNextWave(); StartNewWave(); Time.timeScale = 1; Screen.sleepTimeout = (int)SleepTimeout.NeverSleep; winnerPanel.Play(false); /*Debug.Log("Animation.count="+ waveCompletedSprite.GetClipCount()); * i =1; * foreach (AnimationState clip in waveCompletedSprite) * {Debug.Log ("!!!!"+i.ToString()+" "+clip.name); * i++; * }*/ //waveCompletedSprite.Play (); }
void ToggleButtonPanel() { //Debug.Log ("Toggle panel"+isBuildPanel); if (!isBuildPanel) { foreach (Transform thePlane in placementPlanesGroup) { thePlane.gameObject.renderer.enabled = true; } // Debug.Log ("open"); BuildPanelTween.Play(false); ToggleButtonTween.Play(false); } else { foreach (Transform thePlane in placementPlanesGroup) { thePlane.gameObject.renderer.enabled = false; } //Debug.Log ("close"); BuildPanelTween.Play(true); ToggleButtonTween.Play(true); } isBuildPanel = !isBuildPanel; }
// Use this for initialization void Start() { for (int i = 0; i < AlarmLight.Length; i++) { // AlarmLight[i].animation.Stop (); } menuTweener.Play(false); }
public virtual void ShowAnim() { if (!IsShowing) { tween.Reset(); tween.Play(true); IsShowing = 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(); } }
// Use this for initialization void Start() { structureIndex = 0; UpdateGUI(); upgradePanelTweener.Play(true); upgradePanelTweener.enabled = false; exitPanelTweener.Play(true); exitPanelTweener.enabled = false; }
void CardOn() { _cardTween.callWhenFinished = ""; _cardTween.from.y = 175; _cardTween.to.y = 314; _cardTweenAlpha.from = 0; _cardTweenAlpha.to = 1; _cardTween.Reset(); _cardTween.Play(true); _cardTweenAlpha.Reset(); _cardTweenAlpha.Play(true); }
public void Exit() { CalculatePosition(); tweenE.from = transform.position; tweenE.to = GameObjectTracker.instance.World.CurrentCamera.transform.position; tweenE.Reset(); tweenE.Play(true); opened = false; }
private void SetlableInfo(RectTransform rt, PWeflareInfo info) { if (moduleWelfare.chooseInfo == null || info == null) { return; } var lable = rt.Find("label_Txt").GetComponent <Text>(); var tip = rt.Find("tip"); Util.SetText(lable, info.title); tip.gameObject.SetActive(false); if (info.title.Contains("&")) { var t = info.title.Split('&')[0]; var txt = info.title.Split('&')[1]; tip.gameObject.SetActive(true); Util.SetText(lable, txt); var index = Util.Parse <int>(t); if (index < 0 || index >= recommend.Length) { index = 0; } AtlasHelper.SetShared(tip, recommend[index], null, true); } if (info.type == (int)WelfareType.ActiveNewPuzzle) { Util.SetText(lable, info.introduce); } if (info.id == moduleWelfare.chooseInfo.id || (moduleWelfare.chooseInfo.type == (int)WelfareType.ActiveNewPuzzle && info.type == (int)WelfareType.ActiveNewPuzzle)) { var tog = rt.parent.GetComponentDefault <Toggle>(); tog.isOn = false; m_checkImg.duration = 0.15f; m_checkImg.from = m_checkImg.transform.localPosition; var pos = rt.parent.localPosition; pos.y -= 4; m_checkImg.to = pos; m_checkImg.Play(); tog.isOn = true; } else if (lable.color != Color.white) { var teween = lable.transform.GetComponent <TweenColor>(); teween.PlayReverse(); } var hint = rt.Find("hint"); hint.SafeSetActive(moduleWelfare.GeLableHint(info)); }
public void TweenFromTarget(GameObject target) { gameObject.SetActive(true); transform.localPosition = new Vector3(0f, 0f, 0f); Vector3 pos = transform.InverseTransformPoint(target.transform.position); twPos.from = new Vector3(pos.x - 88f, pos.y + 109.5f, pos.z); twPos.Play(true); twH.Play(true); twW.Play(true); }
protected void Start() { //tween if (tweenPos) { tweenPos.eventReceiver = gameObject; tweenPos.callWhenFinished = "OnFinished"; tweenPos.Play(false); } if (tweenEffect) { tweenEffect.Play(false); } }
public void changeGameState(GameState change) { if (change == activeGameState) { if (applyToTweenAlpha && alpha != null) { alpha.Play(true); } if (applyToTweenColor && color != null) { color.Play(true); } if (applyToTweenPosition && position != null) { position.Play(true); } if (applyToTweenRotate && rotate != null) { rotate.Play(true); } if (applyToTweenScale && scale != null) { scale.Play(true); } } else { if (applyToTweenAlpha && alpha != null) { alpha.Play(false); } if (applyToTweenColor && color != null) { color.Play(false); } if (applyToTweenPosition && position != null) { position.Play(false); } if (applyToTweenRotate && rotate != null) { rotate.Play(false); } if (applyToTweenScale && scale != null) { scale.Play(false); } } }
public void changeStateMenu() { if (isOpen) { isOpen = false; Close.Play(true); Open.Play(false); } else { isOpen = true; Open.Play(true); Close.Play(false); } }
public void Show(string text) { m_tweenAlpha.enabled = true; m_tweenPosition.enabled = true; m_lblText.text = text; m_tweenAlpha.Reset(); m_tweenPosition.Reset(); m_tweenPosition.Play(true); m_tweenPosition.Play(true); //m_tweenPosition.eventReceiver = gameObject; //m_tweenPosition.callWhenFinished = "OnFinished"; }
// Update is called once per frame void Update() { if (m_tweenPosition.enabled == false) { // フレームをデルタタイムで取得 m_frame += Time.deltaTime; if (m_frame >= 0.75f && m_isTween == true) { GameObject.Destroy(this.gameObject); } // 0.25秒経ったら if (m_frame >= 0.25f && m_isTween == false) { m_tweenAlpha.delay = 0.0f; m_tweenAlpha.Play(false); m_isTween = true; CGameManager.m_soundPlayer.ChangeSEVolume(0.1f); CGameManager.m_soundPlayer.PlaySE("game/time_count"); //this.transform.Find("Player1").transform.GetChild("player").transform.GetComponent<CPlayer1>().m_playerSE.PlaySE("game/time_count"); m_tweenPosition.from = new Vector3(this.transform.localPosition.x, -30.0f, 0.0f); m_tweenPosition.to = new Vector3(this.transform.localPosition.x, 30.0f, 0.0f); m_tweenPosition.delay = 0.0f; m_tweenPosition.Play(false); } } }
//移动到指定世界点 private void MoveToTargetCity(uint targetMapId) { Log.info(this, "移动到下一个地图点:" + targetMapId); Transform targetWorld = worlds.FindChild("btn_world_" + targetMapId); Vector3 targetPos = new Vector3(targetWorld.localPosition.x, targetWorld.localPosition.y - model.transform.localScale.y / 2, targetWorld.localPosition.z); if (model.GetComponent <TweenPosition>() == null) { model.AddComponent <TweenPosition>(); model.GetComponent <TweenPosition>().onFinished.Add(new EventDelegate(MoveEnd)); model.GetComponent <TweenPosition>().style = UITweener.Style.Once; } TweenPosition modelTween = model.GetComponent <TweenPosition>(); modelTween.from = model.transform.localPosition; modelTween.to = targetPos; float distance = (float)Math.Sqrt(Math.Pow(modelTween.to.x - modelTween.from.x, 2) + Math.Pow(modelTween.to.y - modelTween.from.y, 2)); modelTween.duration = distance * MOVE_SPEED; model.transform.localRotation = new Quaternion(0, modelTween.to.x > modelTween.from.x ? 0 : 180, 0, 0); modelTween.ResetToBeginning(); modelTween.Play(); model.transform.GetComponentInChildren <Animator> ().SetInteger(Status.STATU, Status.RUN); }
public static TweenPosition MoveTo(GameObject go, UITweener.Method method, UITweener.Style style, float duration, float delay, Vector3 posFrom, Vector3 posTo) { if (go == null) { return(null); } //go.RemoveComponent<TweenPosition>(); TweenPosition comp = UITweenerUtil.Begin <TweenPosition>(go, method, style, duration, delay); //comp.ResetToBeginning(); comp.from = posFrom; comp.to = posTo; comp.duration = duration; comp.delay = delay; if (duration <= 0f) { comp.Sample(1f, true); comp.enabled = false; } comp = ResetTween(comp); comp.Play(true); return(comp); }
public void ShowDownButton(bool show, bool immediately = false) { ShowUpButton(show, immediately); OpenDownMenuBtn.SetActive(!show); CloseDownMenuBtn.SetActive(show); SkillTween.Play(show); JoyStickTween.Play(show); DownMenuTween.Play(show); MiddleMenuTween.Play(show); //if (GetSceneType() == (int)eSceneType.Fuben) //{ // Debug.LogError(GetSceneType()); // MainUpUITween.Play(!show); // FubenCloseUITween.Play(!show); // FunctionUITween.Play(show); //} if (IsSceneType() == true) { MainUpUITween.Play(!show); FubenCloseUITween.Play(!show); FunctionUITween.Play(show); } }
//显示飞的小星星 void ShowFlyStars() { for (int nIndex = 0; nIndex < m_StarFLySpriteArray.Length; nIndex++) { m_StarFLySpriteArray[nIndex].gameObject.SetActive(true); TweenPosition StarFlyTweenPosition = m_StarFlyTweenPosition[nIndex]; if (StarFlyTweenPosition) { if (nIndex == 0) { //只增加一个结束处理函数 EventDelegate.Add(StarFlyTweenPosition.onFinished, StarFlyTweenFinish); } StarFlyTweenPosition.Reset(); StarFlyTweenPosition.Play(true); } TweenScale StarFlyTweenScale = m_StarFlyTweenScale[nIndex]; if (StarFlyTweenScale) { StarFlyTweenScale.Reset(); StarFlyTweenScale.Play(true); } TweenAlpha StarFlyTweenAlhpa = m_StarFlyTweenAlpha[nIndex]; if (StarFlyTweenAlhpa) { StarFlyTweenAlhpa.Reset(); StarFlyTweenAlhpa.Play(true); } } }
public void ButtonBack() { tweenPos.enabled = false; tweenPosHelp.enabled = true; tweenPosHelp.Play(); Debug.Log("?"); }
public void Init(Bullet bullet){ State = bullet; TweenPost = ActionTarget.AddComponent<TweenPosition> (); TweenPost.duration = bullet.DurationTime; TweenPost.from = bullet.StartPoint; TweenPost.to = bullet.TargetPoint; EventDelegate.Add( TweenPost.onFinished, DeleteSelf); if(bullet.StartSize != Vector3.one){ TweenScal = ActionTarget.AddComponent<TweenScale> (); TweenScal.duration = bullet.DurationTime; TweenScal.from = bullet.StartSize; TweenScal.to = bullet.TargetSize; TweenScal.Play (true); } TweenRota = ActionTarget.AddComponent<TweenRotation>(); TweenRota.to = new Vector3(0.0f, 0.0f, 360.0f); TweenRota.duration = bullet.DurationTime; TweenRota.style = UITweener.Style.Once; EventDelegate.Add(TweenRota.onFinished, _RotationCount); TweenPost.Play (true); TweenRota.Play (true); //Invoke ("DeleteSelf", bullet.DurationTime + 1.0f); }
void FlashTrainStarAction(int newStar) { Ji_1.text = Ji_0.text; Ji_0.text = newStar.ToString(); TweenPosition tween_p0 = Ji_0.gameObject.GetComponent <TweenPosition>(); TweenColor tween_c0 = Ji_0.gameObject.GetComponent <TweenColor>(); tween_p0.ResetToBeginning(); tween_p0.enabled = true; tween_p0.Play(true); tween_c0.ResetToBeginning(); tween_c0.enabled = true; tween_c0.Play(true); TweenPosition tween_p1 = Ji_1.gameObject.GetComponent <TweenPosition>(); TweenColor tween_c1 = Ji_1.gameObject.GetComponent <TweenColor>(); tween_p1.ResetToBeginning(); tween_p1.enabled = true; tween_p1.Play(true); tween_c1.ResetToBeginning(); tween_c1.enabled = true; tween_c1.Play(true); }
void FlashTrainCountAction(int newCount) { Duan_1.text = Duan_0.text; Duan_0.text = newCount.ToString(); TweenPosition tween_p0 = Duan_0.gameObject.GetComponent <TweenPosition>(); TweenColor tween_c0 = Duan_0.gameObject.GetComponent <TweenColor>(); tween_p0.ResetToBeginning(); tween_p0.enabled = true; tween_p0.Play(true); tween_c0.ResetToBeginning(); tween_c0.enabled = true; tween_c0.Play(true); TweenPosition tween_p1 = Duan_1.gameObject.GetComponent <TweenPosition>(); TweenColor tween_c1 = Duan_1.gameObject.GetComponent <TweenColor>(); tween_p1.ResetToBeginning(); tween_p1.enabled = true; tween_p1.Play(true); tween_c1.ResetToBeginning(); tween_c1.enabled = true; tween_c1.Play(true); }
void OnPPS() { //Set active stats and pop screen. //ActivityManager.Instance.SelectedStats = GameObjectTracker.instance.RunStatistics; //ActivityManager.Instance.PushActivity(ActivityManager.ManagerActivities.Stats); //Toggle viewPPS = !viewPPS; if (viewPPS) { //Set the text. PPSLabel.text = PPSText; } else { //Set the text. PPSLabel.text = ScoreText; } //Play the animation. PPSButtonTween.Reset(); PPSButtonTween.Play(true); // ScoreButtonIntro.Reset(); // ScoreButtonIntro.Play(true); //TODO: Play sound. AudioPlayer.GetPlayer().PlayMenuSFX(AudioPlayer.MenuSFX.Select); }
private void SetSignInfo() { m_tChick.Clear(); if (moduleUnion.CardSignInfo == null) { return; } string signKey = "unionSign" + modulePlayer.id_.ToString() + modulePlayer.roleInfo?.leagueID.ToString(); m_cardBgGroup.SafeSetActive(false); var first = moduleWelfare.FrirstOpen(signKey); if (first) { m_cardBgGroup.SafeSetActive(true); for (int i = 0; i < m_itemBg.Count; i++) { if (m_itemBg[i] == null) { continue; } TweenRotation rotation = m_itemBg[i].GetComponent <TweenRotation>(); TweenAlpha alpha = m_itemBg[i].GetComponent <TweenAlpha>(); TweenPosition position = m_itemBg[i].GetComponent <TweenPosition>(); rotation?.Play(); alpha?.Play(); position?.Play(); } } SetTimesTxt(); }
/// <summary> 上下往中 </summary> private void TopAndDownToSlide(PanelBase go, bool isTop, bool isOpen) { TweenPosition tp = go.gameObject.GetComponent <TweenPosition>(); if (tp == null) { tp = go.gameObject.AddComponent <TweenPosition>(); } if (isOpen) { tp.Reset(); } tp.from = isTop == true ? new Vector3(0, 1000, 0) : new Vector3(0, -1000, 0); tp.to = Vector3.zero; tp.duration = go.OpenDuration; tp.ease = Ease.InOutSine; tp.onFinished = () => { if (isOpen) { go.OnShowed(); } else { DestroyPanel(go.type); } }; go.gameObject.SetActive(true); tp.Play(isOpen); }
void FixedUpdate() { if (m_nCurPicIndex == 0) { if (m_PicList[m_nCurPicIndex] && m_fCurTimeCount >= m_fIntervalTime) { TweenPosition tweenPos = m_PicList[m_nCurPicIndex].GetComponent <TweenPosition>(); if (tweenPos) { tweenPos.Play(true); } m_fCurTimeCount = 0; } else { m_fCurTimeCount += Time.deltaTime; } } else if (m_nCurPicIndex >= nMaxPicNum) { if (m_fCurTimeCount >= m_fIntervalTime) { UIManager.CloseUI(UIInfo.JianPuRoot); return; } else { m_fCurTimeCount += Time.deltaTime; } } }
void detachFocus() { Transform tm = focus.transform; Transform mj = tm.parent; TweenPosition tp = tm.GetComponent <TweenPosition>(); TweenRotation tr = tm.GetComponent <TweenRotation>(); tp.enabled = false; tr.enabled = false; tm.localPosition = new Vector3(0, 0.25f, 0.25f); Transform table = GameObject.Find("mjtable").transform; tm.SetParent(table); tp.from = tm.localPosition; tp.to = tm.localPosition + new Vector3(0, 0.02f, 0); tp.style = UITweener.Style.PingPong; tp.duration = 1.0f; tp.Play(); /* * string path = "Prefab/Meishu/bomb"; * Transform ob = Instantiate(Resources.Load (path) as GameObject).transform; * ob.SetParent(mj); * ob.localPosition = new Vector3 (0, 0.25f, 0); * ob.SetParent(table); * ob.localRotation = Quaternion.Euler (-90, 0, 0); * ob.GetComponent<ParticleSystem>().Play(); */ }
private void MoveDragonRandom(TweenPosition tp) { if (tp != null) { Vector3 fromPos = tp.transform.localPosition; tp.Reset(); tp.style = UITweener.Style.PingPong; tp.method = UITweener.Method.EaseInOut; tp.duration = DragonMoveDuration; tp.eventReceiver = gameObject; tp.callWhenFinished = "MoveDragonRandom"; tp.animationCurve = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(0.5f, 0.8f), new Keyframe(0.8f, 0.98f), new Keyframe(1f, 1f)); DragonMatchUIDragonButton dragonButton = tp.transform.GetComponentsInChildren<DragonMatchUIDragonButton>(true)[0]; if (dragonButton.Index < m_listDragonOrigPos.Count && dragonButton.Index < m_listDragonParent.Count) { Vector3 toPos = m_listDragonOrigPos[dragonButton.Index]; float random_x = UnityEngine.Random.Range(-0.5f, 0.5f); float random_y = UnityEngine.Random.Range(-0.3f, 0.4f); toPos = toPos + new Vector3(random_x, random_y, 0); tp.from = fromPos; tp.to = toPos; tp.enabled = true; tp.Play(true); } } }
private void PlayWidgetAnimation(TweenPosition tweener) { if(!tweener.gameObject.active) NGUITools.SetActive(tweener.gameObject, true); //animation will play automatically tweener.Play(true); }