private void Start() { tween = GetComponent <DOTweenAnimation>(); }
private void UIAnimChange(DOTweenAnimation tweenComponent) { tweenComponent.DORestartById("Shake"); tweenComponent.DOPlayById("Shake"); }
void Awake() { anim = gameObject.GetOrAddComponent <DOTweenAnimation>(); anim.isFrom = !anim.isFrom; }
private void Awake() { _instance = this; doAnim = this.GetComponent <DOTweenAnimation>(); npcTalkText = transform.Find("Text").GetComponent <Text>(); }
public TweenInfo(DOTweenAnimation animation, Tween tween, bool isFrom) { this.animation = animation; this.tween = tween; this.isFrom = isFrom; }
// Use this for initialization void Start() { animation = Box.GetComponent <DOTweenAnimation>(); }
protected override void OnStart(Transform root) { MyEventCenter.AddListener(E_GameEvent.OnClickMouseRightDown, E_OnMouseLeftClick); // 鼠标右键点击 MyEventCenter.AddListener <EGameType, ushort, List <ResultBean>, bool>(E_GameEvent.DaoRuTuFromResult, E_OnDuoTuDaoRu); // 确定导入图片 MyEventCenter.AddListener(E_GameEvent.GoToNextFolderDaoRu, E_GoToNextFolderDaoRu); // 导入后 到一个文件夹 MyEventCenter.AddListener(E_GameEvent.OnClickCtrlAndA, E_OnClickCtrlAndA); // 按下 Ctrl + A MyEventCenter.AddListener(E_GameEvent.OnClickCtrlAndC, E_OnClickCtrlAndC); // 按下 Ctrl + C // 总 rt_Right = Get <RectTransform>("Right/Contant"); l_AddressPaths[0] = Ctrl_UserInfo.Instance.ShowFirstPath; l_AddressPaths[1] = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); l_AddressPaths[2] = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); l_AddressPaths[3] = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); l_AddressPaths[4] = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); mFileBrowser = string.IsNullOrEmpty(l_AddressPaths[0]) ? new FileBrowser() : new FileBrowser(l_AddressPaths[0]); #region 书签 go_ShuQian = GetGameObject("Right/Contant/GO_ShuQian"); moBan_Favorites = GetGameObject("Right/Contant/GO_ShuQian/ScrollView/Contant/MoBan_ItemFav"); AddToggleOnValueChanged("Right/Contant/Toggle_ShuQian", OnToggle_ShuQian); rt_ShuQianContant = Get <RectTransform>("Right/Contant/GO_ShuQian/ScrollView/Contant"); #endregion #region 大小 go_ModeSize = GetGameObject("Right/Contant/Size2_Mode"); tx_Size1 = Get <Text>("Right/Contant/Size1_Btn/Text"); tx_SizeBig = Get <Text>("Right/Contant/Size2_Mode/Contant/ItemBig/Text"); tx_SizeMiddle = Get <Text>("Right/Contant/Size2_Mode/Contant/ItemMiddle/Text"); tx_SizeSmall = Get <Text>("Right/Contant/Size2_Mode/Contant/ItemSmall/Text"); tg_ModeSize = Get <UGUI_ToggleGroup>("Right/Contant/Size2_Mode/Contant"); anim_SizeIcon = Get <DOTweenAnimation>("Right/Contant/Size1_Btn/Left"); tg_ModeSize.OnChangeValue += OnToggle_ChangeSizeMode; tg_ModeSize.OnEachClick += Btn_CloseSize; AddButtOnClick("Right/Contant/Size1_Btn", Btn_OpenSize); #endregion #region 过滤 go_ModeFilter = GetGameObject("Right/Contant/Filter2_Mode"); tx_Filter1 = Get <Text>("Right/Contant/Filter1_Btn/Text"); tx_FilterAll = Get <Text>("Right/Contant/Filter2_Mode/Contant/ItemAll/Text"); tx_FilterTexture = Get <Text>("Right/Contant/Filter2_Mode/Contant/ItemTexture/Text"); tx_FilterFolder = Get <Text>("Right/Contant/Filter2_Mode/Contant/ItemFolder/Text"); tg_FilterMode = Get <UGUI_ToggleGroup>("Right/Contant/Filter2_Mode/Contant"); anim_FilterIcon = Get <DOTweenAnimation>("Right/Contant/Filter1_Btn/Left"); tg_FilterMode.OnChangeValue += OnToggle_ChangeFilterMode; tg_FilterMode.OnEachClick += Btn_CloseFilter; AddButtOnClick("Right/Contant/Filter1_Btn", Btn_OpenFilter); #endregion #region 排序 go_ModeSorting = GetGameObject("Right/Contant/Sorting2_Mode"); tx_Sort1 = Get <Text>("Right/Contant/Sorting1_Btn/Text"); tx_SortName = Get <Text>("Right/Contant/Sorting2_Mode/Contant/ItemName/Text"); tx_SortType = Get <Text>("Right/Contant/Sorting2_Mode/Contant/ItemType/Text"); tx_SortDate = Get <Text>("Right/Contant/Sorting2_Mode/Contant/ItemDate/Text"); tg_SortMode = Get <UGUI_ToggleGroup>("Right/Contant/Sorting2_Mode/Contant"); anim_SortIcon = Get <DOTweenAnimation>("Right/Contant/Sorting1_Btn/Left"); tg_SortMode.OnChangeValue += OnToggle_ChangeSortMode; tg_SortMode.OnEachClick += Btn_CloseSorting; AddButtOnClick("Right/Contant/Sorting1_Btn", Btn_OpenSorting); #endregion #region 头部栏 // 上方的头部菜单 go_ItemPath2 = GetGameObject("Top/Top/ItemPath2"); go_ItemPath3 = GetGameObject("Top/Top/ItemPath3"); go_ItemPath4 = GetGameObject("Top/Top/ItemPath4"); go_ItemPath5 = GetGameObject("Top/Top/ItemPath5"); go_Add = GetGameObject("Top/Top/Add"); rt_Top = Get <RectTransform>("Top/Top"); tg_ItemPath = Get <UGUI_ToggleGroup>("Top/Top"); tg_ItemPath.OnChangeValue += E_OnTopPathChange; AddButtOnClick("Top/Top/Add/Btn", Btn_AddItem); AddButtOnClick("Top/Top/ItemPath2/Close", () => { CloseItemPath(go_ItemPath2); }); AddButtOnClick("Top/Top/ItemPath3/Close", () => { CloseItemPath(go_ItemPath3); }); AddButtOnClick("Top/Top/ItemPath4/Close", () => { CloseItemPath(go_ItemPath4); }); AddButtOnClick("Top/Top/ItemPath5/Close", () => { CloseItemPath(go_ItemPath5); }); tx_TopPath1 = Get <Text>("Top/Top/ItemPath1/Text"); tx_TopPath2 = Get <Text>("Top/Top/ItemPath2/Text"); tx_TopPath3 = Get <Text>("Top/Top/ItemPath3/Text"); tx_TopPath4 = Get <Text>("Top/Top/ItemPath4/Text"); tx_TopPath5 = Get <Text>("Top/Top/ItemPath5/Text"); AddButtOnClick("Top/BtnSuaiXin", Btn_ShuaiXin); // 下方的 历史、地址栏 tx_Path = Get <Text>("Top/Bottom/Middle/AddressPath/Text"); // 收藏的星星 toggle_Star = Get <Toggle>("Top/Bottom/Middle/ToggleStar"); AddToggleOnValueChanged(toggle_Star, Toggle_ChangeIsStar); // 历史的左右按钮 btn_HistoryPre = Get <Button>("Top/Bottom/Left/BtnLeft"); btn_HistoryNext = Get <Button>("Top/Bottom/Left/BtnRight"); AddButtOnClick(btn_HistoryPre, Btn_OnHistoryPre); AddButtOnClick(btn_HistoryNext, Btn_OnHistoryNext); // 中间的地址栏 AddButtOnClick("Top/Bottom/Middle/AddressPath/Btn", Btn_OnClickAddressPath); // 右边上层 AddButtOnClick("Top/Bottom/Right/BtnUp", Btn_OnGoToParent); AddButtOnClick("Top/Bottom/Right/BtnOpenFolder", Btn_OpenFolder); #endregion #region 导入 && 改名 // 导入 tx_TipZhang = Get <Text>("Right/BtnDaoRu/Tip/Num"); btnDaoRu = Get <Button>("Right/BtnDaoRu"); AddButtOnClick(btnDaoRu, Btn_OnDaoRuClick); // 改名 go_IsGaiMing = GetGameObject("IsGaiMing"); rt_GeiMing = Get <RectTransform>("IsGaiMing/Contant/Middle/Cotant"); go_MoBanGeiMing = GetGameObject("IsGaiMing/Contant/Middle/MoBan"); input_GeiMing = Get <InputField>("Right/Contant/GeiMing/InputField"); go_BottomBtn = GetGameObject("IsGaiMing/Contant/BottomBtn"); go_BottomWait = GetGameObject("IsGaiMing/Contant/BottomWait"); btnGeiMing = Get <Button>("Right/Contant/GeiMing/BtnSure"); input_GeiMing222 = Get <InputField>("IsGaiMing/Contant/Top/InputField"); AddInputOnEndEdit(input_GeiMing222, InputEnd_GeiMing222); AddButtOnClick(btnGeiMing, Btn_GeiMing); AddButtOnClick("IsGaiMing/Contant/Top/BtnChange", Btn_GeiMing222); AddButtOnClick("IsGaiMing/Contant/BottomBtn/BtnSure", Btn_OnSureGaiMing); AddButtOnClick("IsGaiMing/Contant/BottomBtn/BtnFalse", Btn_OnFalseGeiMing); #endregion #region 中间 t_MiddleGrid = GetTransform("Bottom/ScrollView/Contant"); grid_Contant = t_MiddleGrid.GetComponent <UGUI_Grid>(); moBan_File = GetGameObject("Bottom/ScrollView/MoBan_File"); moBan_Folder = GetGameObject("Bottom/ScrollView/MoBan_Folder"); moBan_YinPan = GetGameObject("Bottom/ScrollView/MoBan_YinPan"); moBan_Computer = GetGameObject("Bottom/ScrollView/MoBan_Computer"); moBan_ZhuoMain = GetGameObject("Bottom/ScrollView/MoBan_ZhuoMain"); moBan_Music = GetGameObject("Bottom/ScrollView/MoBan_Music"); MyEventCenter.AddListener(E_GameEvent.OnClickDown_Shift, E_OnShiftClick); MyEventCenter.AddListener(E_GameEvent.OnClickUp_Shift, E_OnShiftUp); MyEventCenter.AddListener(E_GameEvent.OnClickDown_Ctrl, E_OnCtrlClick); MyEventCenter.AddListener(E_GameEvent.OnClickUp_Ctrl, E_OnCtrlUp); AddScrollbarValueChange("Bottom/Scrollbar", (position) => { if (isShowLeftTip) { go_MouseLeftClick.SetActive(false); } }); #endregion #region 框选 rt_Kuang = Get <RectTransform>("Bottom/ScrollView/KuangXuan"); mKuangXuan = rt_Kuang.GetComponent <KuangXuan>(); mKuangXuan.Init(chooseGOK_BgV); UGUI_KuangXuan kuangXuan = Get <UGUI_KuangXuan>("Bottom/ScrollView"); kuangXuan.E_OnClickDown += E_OnClickKuangDown; kuangXuan.E_OnDarg += E_OnKuangDarg; kuangXuan.E_OnClickUp += E_OnClickKuangUp; #endregion #region 标右键 go_MouseLeftClick = GetGameObject("MouseLeftClick"); AddButtOnClick("MouseLeftClick/BtnBlue", () => { Btn_ChooseColor(MyEnumColor.Blue); }); AddButtOnClick("MouseLeftClick/BtnYellow", () => { Btn_ChooseColor(MyEnumColor.Yellow); }); AddButtOnClick("MouseLeftClick/BtnWhite", () => { Btn_ChooseColor(MyEnumColor.White); }); AddButtOnClick("MouseLeftClick/BtnGreen", () => { Btn_ChooseColor(MyEnumColor.Green); }); AddButtOnClick("MouseLeftClick/BtnNull", () => { Btn_ChooseColor(MyEnumColor.Hui, true); }); #endregion }
private void Awake() { _doTweenAnimation = this.gameObject.GetComponent <DOTweenAnimation>(); }
public GameObject door; //获取门对象 void Start() { doanimation = door.GetComponent <DOTweenAnimation>(); }
void Reset() { Animation = GetComponent <DOTweenAnimation>(); }
void Awake() { toggle = GetComponent <Toggle>(); toggle.onValueChanged.AddListener(Toggle); ani = target.GetComponent <DOTweenAnimation>(); }
// Start is called before the first frame update void Start() { image = GetComponent <Image>(); anim = GetComponent <DOTweenAnimation>(); }
void Awake() { Instance = this; doTween = this.GetComponent <DOTweenAnimation>(); }
// Use this for initialization void Start() { original_health = health; shakeAnim = this.gameObject.GetComponent <DOTweenAnimation>(); audioS = GameObject.Find("SFX").GetComponent <AudioSource>(); }
// Use this for initialization void Start() { myTransform = this.transform; myTweenAnimation = GetComponent <DOTweenAnimation>(); }
// Use this for initialization void Start() { playerstatusDOTweenAnimation = this.GetComponent <DOTweenAnimation>(); }
// Use this for initialization void Start() { _tweenAnimation = GetComponent <DOTweenAnimation>(); }
/// <summary> /// Returns TRUE if its actually previewing animations /// </summary> public static bool PreviewGUI(DOTweenAnimation src) { if (EditorApplication.isPlaying) { return(false); } Styles.Init(); bool isPreviewing = _AnimationToTween.Count > 0; bool isPreviewingThis = isPreviewing && _AnimationToTween.ContainsKey(src); // Preview in editor GUI.backgroundColor = isPreviewing ? new DeSkinColor(new Color(0.49f, 0.8f, 0.86f), new Color(0.15f, 0.26f, 0.35f)) : new DeSkinColor(Color.white, new Color(0.13f, 0.13f, 0.13f)); GUILayout.BeginVertical(Styles.previewBox); DeGUI.ResetGUIColors(); GUILayout.BeginHorizontal(); GUILayout.Label("Preview Mode - Experimental", Styles.previewLabel); _previewOnlyIfSetToAutoPlay = DeGUILayout.ToggleButton( _previewOnlyIfSetToAutoPlay, new GUIContent("AutoPlay only", "If toggled only previews animations that have AutoPlay turned ON"), Styles.btOption ); GUILayout.EndHorizontal(); GUILayout.Space(1); // Preview - Play GUILayout.BeginHorizontal(); EditorGUI.BeginDisabledGroup( isPreviewingThis || src.animationType == DOTweenAnimationType.None || !src.isActive || _previewOnlyIfSetToAutoPlay && !src.autoPlay ); if (GUILayout.Button("► Play", Styles.btPreview)) { if (!isPreviewing) { StartupGlobalPreview(); } AddAnimationToGlobalPreview(src); } EditorGUI.EndDisabledGroup(); EditorGUI.BeginDisabledGroup(isPreviewing); if (GUILayout.Button("► Play All <i>on GameObject</i>", Styles.btPreview)) { if (!isPreviewing) { StartupGlobalPreview(); } DOTweenAnimation[] anims = src.gameObject.GetComponents <DOTweenAnimation>(); foreach (DOTweenAnimation anim in anims) { AddAnimationToGlobalPreview(anim); } } if (GUILayout.Button("► Play All <i>in Scene</i>", Styles.btPreview)) { if (!isPreviewing) { StartupGlobalPreview(); } DOTweenAnimation[] anims = Object.FindObjectsOfType <DOTweenAnimation>(); foreach (DOTweenAnimation anim in anims) { AddAnimationToGlobalPreview(anim); } } EditorGUI.EndDisabledGroup(); GUILayout.EndHorizontal(); // Preview - Stop GUILayout.BeginHorizontal(); EditorGUI.BeginDisabledGroup(!isPreviewingThis); if (GUILayout.Button("■ Stop", Styles.btPreview)) { if (_AnimationToTween.ContainsKey(src)) { StopPreview(_AnimationToTween[src].tween); } } EditorGUI.EndDisabledGroup(); EditorGUI.BeginDisabledGroup(!isPreviewing); if (GUILayout.Button("■ Stop All <i>on GameObject</i>", Styles.btPreview)) { StopPreview(src.gameObject); } if (GUILayout.Button("■ Stop All <i>in Scene</i>", Styles.btPreview)) { StopAllPreviews(); } EditorGUI.EndDisabledGroup(); GUILayout.EndHorizontal(); if (isPreviewing) { int playingTweens = 0; int completedTweens = 0; int pausedTweens = 0; foreach (KeyValuePair <DOTweenAnimation, TweenInfo> kvp in _AnimationToTween) { Tween t = kvp.Value.tween; if (t.IsPlaying()) { playingTweens++; } else if (t.IsComplete()) { completedTweens++; } else { pausedTweens++; } } GUILayout.Label("Playing Tweens: " + playingTweens, Styles.previewStatusLabel); GUILayout.Label("Completed Tweens: " + completedTweens, Styles.previewStatusLabel); // GUILayout.Label("Paused Tweens: " + playingTweens); } GUILayout.EndVertical(); return(isPreviewing); }
private void Awake() { _instance = this; doTween = this.GetComponent <DOTweenAnimation>(); progressBar = transform.Find("LoadBarSlider").GetComponent <Slider>(); }
// Use this for initialization void Start() { VictoryDeal = transform.FindChild("VictoryLayout").GetComponent <DOTweenAnimation>(); DefeatDeal = transform.FindChild("DefeatLayout").GetComponent <DOTweenAnimation>(); }
private void Start() { _animation = this.GetComponent <DOTweenAnimation>(); _plarticlePlayer = this.GetComponentInChildren <ParticlePlayer>(); }
public static void Postfix(CombatHUDPortrait __instance, ref TextMeshProUGUI ___ioText, ref DOTweenAnimation ___initiativeOverlay) { //SkillBasedInit.Logger.Log($"CombatHUDPortrait:Init:post - Init"); ___ioText.enableWordWrapping = false; ___initiativeOverlay.isActive = false; }
void AddFlyFont(IEntity entity, EntityType type, DamageType damType, FlyFont font, float damage = 0) { Transform posRoot = null; DamageType dt = damType; if (testType != DamageType.None) { dt = testType; } bool bSelf = false; if (type == EntityType.EntityType_Player) { if (ClientGlobal.Instance().MainPlayer.GetUID() == entity.GetUID()) { bSelf = true; } } if (damage == 0 && damType == DamageType.Normal) { // Log.Error("damage == 0 && damType == DamageType.Normal parent is flyroot"); ReturnFlyFont(dt, font); return; } SetFontText(font, (int)damage, dt, bSelf); font.SetActive(true); GameObject rootGo = m_posRootPool.Alloc(); posRoot = rootGo.transform; posRoot.parent = this.transform; Vector3 enpos = entity.GetPos(); Vector3 pos = Vector3.zero; entity.GetLocatorPos(m_strLocatorName, Vector3.zero, Quaternion.identity, ref pos, true); float r = 0;// entity.GetRadius() * 2; posRoot.position = new Vector3(enpos.x, pos.y + r, enpos.z); posRoot.transform.rotation = GetLookRotation(); Transform fontTrans = font.GetFontTransform(); posRoot.name = entity.GetName(); if (fontTrans != null && posRoot != null) { fontTrans.parent = posRoot; fontTrans.localPosition = Vector3.zero; fontTrans.localRotation = Quaternion.identity; MeshText mt = font.GetMt(); if (mt != null) { DOTweenAnimation[] tweenArray = font.GetTweens(); DOTweenPath pathTween = font.GetPathTween(); Tween maxAni = null; float during = 0; for (int i = 0; i < tweenArray.Length; i++) { DOTweenAnimation tweenAni = tweenArray[i]; float totalTime = tweenAni.duration + tweenAni.delay; if (totalTime > during) { maxAni = tweenAni.tween; during = totalTime; } if (pathTween != null) { if (pathTween.duration + pathTween.delay > during) { maxAni = pathTween.tween; during = pathTween.duration + pathTween.delay; } } if (tweenAni.animationType == DOTweenAnimationType.Color) { int a = 10; } tweenAni.tween.Restart(); tweenAni.tween.Play(); // tweenAni.DOPlay(); //if (tweenAni.animationType == DOTweenAnimationType.Color) //{ // tweenAni.tween.Restart(); // tweenAni.tween.Kill(); // tweenAni.CreateTween(); // //tweenAni.DOPlay(); //} //else //{ // tweenAni.tween.Kill(); // tweenAni.CreateTween(); // // tweenAni.tween.Restart(); //} } if (pathTween != null) { pathTween.DORestart(); pathTween.DOPlay(); } maxAni.OnComplete(() => { ReturnFlyFont(dt, font); }); } } else { ReturnFlyFont(dt, font); } }
void Start() { tweenAimation = GetComponent <DOTweenAnimation> (); //tweenAimation.DOPlayForward (); }
// Use this for initialization void Start() { instance = this; doTween = this.GetComponent <DOTweenAnimation>(); jiangText = transform.Find("JiangText").GetComponent <Text>(); }