public async void OnButtonEnterFriendManor(long idFriend) { if (StaticData.idPreEnterManor == idFriend) { StaticData.CreateToastTips($"正在当前好友的庄园中!"); return; } StaticData.idPreEnterManor = idFriend; UIComponent.HideUI(UIType.UIManor); await SceneManagerComponent._instance.ChangeSceneAsync(EnumScene.Manor, true); await UIComponent.CreateUIAsync(UIType.UIManor); UIManorComponent uiManorComponent = UIComponent.GetComponentHaveExist <UIManorComponent>(UIType.UIManor); uiManorComponent.OpenManorRoot(false); if (Root2dSceneManager._instance != null) { await Root2dSceneManager._instance.EnterManor(idFriend); } StaticData.SetSceneState(StaticData.SceneState.ManorFriend); //移动到特定视角时间 await UniTask.Delay(1000); UIComponent.HideUI(UIType.UISceneLoading); await StaticData.PlayManorEnterAnim(); }
private async void OnButtonReturnMyManorClick() { //播放庄园退出动画 UIManorComponent uiManorCom = UIComponent.GetComponentHaveExist <UIManorComponent>(UIType.UIManor); if (uiManorCom != null) { await uiManorCom.uiManorAnim.PlayAnimQuitManor(); } //加载场景 UIComponent.HideUI(UIType.UIManor); await SceneManagerComponent._instance.ChangeSceneAsync(EnumScene.Manor, true); await UIComponent.CreateUIAsync(UIType.UIManor); UIManorComponent uiManorComponent = UIComponent.GetComponentHaveExist <UIManorComponent>(UIType.UIManor); uiManorComponent.OpenManorRoot(true); if (Root2dSceneManager._instance != null) { await Root2dSceneManager._instance.EnterManor(-1); } //移动到特定视角时间 await UniTask.Delay(1000); UIComponent.HideUI(UIType.UISceneLoading); await StaticData.PlayManorEnterAnim(); }