/// <summary> /// 处理养成UI点击交互 /// </summary> /// <param name="gameObject">点击对象</param> void DisposeUIInteractive(GameObject gameObject) { nameID = gameObject.name; //LogWarp.LogError("AAAAAAAAAAAAAAAAAAAAAAAAAA "+nameID); Action action = null; if (clickCallbacks.TryGetValue(gameObject.name, out action)) { sceneUIButtonPos = gameObject.transform; action?.Invoke(); var anim = gameObject.GetComponentInChildren <Animation>(); if (anim != null) { buildingClickSa.Init(anim); buildingClickSa.Play(Config.globalConfig.getInstace().BuildClickAnim); } ZooCamera.GetInstance().PointAtScreenUpCenter(gameObject.transform.position); } //if (gameObject.name == needShowID) //{ // ZooCamera.GetInstance().PointAtScreenUpCenter(gameObject.transform.position); // MessageString.Send((int)GameMessageDefine.UIMessage_OnClickButHidePart, "UIMainPage"); //} }
public void InitAnim() { anim.Init(mainGameObject); animWeight.Clear(); //for (int i = 0; i < Config.npcactionConfig.getInstace().RowNum; i++) //{ // var cell = Config.npcactionConfig.getInstace().getCell(i); // if (anim.animation[cell.actionname] != null) // { // animWeight.Add(cell.weight); // } // else // { // animWeight.Add(0); // } //} foreach (var kv in Config.npcactionConfig.getInstace().AllData) { if (anim.animation[kv.Value.actionname] != null) { animWeight.Add(kv.Value.weight); } else { animWeight.Add(0); } } }
/// <summary> /// 是否是新手引导需要的转圈 /// </summary> /// <param name="goLittleZoo"></param> /// <param name="littleZooID"></param> private static void IsGuidOpenUIBuildShowPage(GameObject goLittleZoo, int littleZooID) { if (!GlobalDataManager.GetInstance().playerData.playerZoo.isGuide) { return; } GlobalDataManager.GetInstance().playerData.playerZoo.BuildShowTransform = goLittleZoo.transform; float timeCount = 0.1f; DOTween.To(() => timeCount, a => timeCount = a, 0.1f, 0.1f).OnComplete(new TweenCallback(delegate { PageMgr.ShowPage <UIBuildShowPage>(littleZooID); //旋转视角UI })); System.Action action = null; action?.Invoke(); var anim = goLittleZoo.GetComponentInChildren <Animation>(); if (anim != null) { SimpleAnimation buildingClickSa = new SimpleAnimation(); buildingClickSa.Init(anim); buildingClickSa.Play(Config.globalConfig.getInstace().BuildClickAnim); } }