private IEnumerator GotoNextScene(Generics.Scene NextScene) { if (OnSceneChangeCoroutine != null) { yield return(StartCoroutine(OnSceneChangeCoroutine)); OnSceneChangeCoroutine = null; } AsyncOperation async = Application.LoadLevelAsync(NextScene.ToString()); while (async.progress < 0.9f) { yield return(new WaitForEndOfFrame()); } async.allowSceneActivation = true; setLive2D(NextScene); App.OnlyController = null; if (NextScene == Generics.Scene.Strategy) { yield return(new WaitForEndOfFrame()); if (SingletonMonoBehaviour <UIShortCutMenu> .exist()) { SingletonMonoBehaviour <UIShortCutMenu> .Instance.IsInputEnable = true; SingletonMonoBehaviour <UIShortCutMenu> .Instance.LockOffControl(); SingletonMonoBehaviour <UIShortCutMenu> .Instance.LockTouchControl(isEnable : false); } } }
private IEnumerator LoadTutorial(TutorialModel model, TutorialID ID, Action OnLoaded) { KeyControl key = null; if (SingletonMonoBehaviour <UIShortCutMenu> .exist()) { SingletonMonoBehaviour <UIShortCutMenu> .Instance.LockTouchControl(isEnable : true); key = App.OnlyController; App.OnlyController = new KeyControl(); } req = Resources.LoadAsync("Prefabs/TutorialGuide/TutorialDialog_" + ID.ToString()); yield return(req); tutorialDialog = null; tutorialDialog = Util.Instantiate(req.asset).GetComponent <TutorialDialog>(); tutorialDialog.SetTutorialId(ID); model.SetKeyTutorialFlg((int)ID); tutorialDialog.SetOnLoaded(OnLoaded); req = null; if (SingletonMonoBehaviour <UIShortCutMenu> .exist()) { SingletonMonoBehaviour <UIShortCutMenu> .Instance.LockTouchControl(isEnable : false); App.OnlyController = key; } }
private void Start() { if (SingletonMonoBehaviour <NowLoadingAnimation> .exist() && SingletonMonoBehaviour <NowLoadingAnimation> .Instance.isNowLoadingAnimation) { this.StartAyeAnimation(); } }
public void SceneLoad(Generics.Scene NextScene) { App.OnlyController = dummyKey; App.isFirstUpdate = true; if (SingletonMonoBehaviour <UIShortCutMenu> .Instance.IsOpen) { SingletonMonoBehaviour <UIShortCutMenu> .Instance.CloseMenu(); } if (SingletonMonoBehaviour <UIPortFrame> .exist()) { SingletonMonoBehaviour <UIPortFrame> .Instance.isColliderEnabled = false; } if (SingletonMonoBehaviour <UIShortCutMenu> .exist()) { SingletonMonoBehaviour <UIShortCutMenu> .Instance.LockTouchControl(isEnable : true); SingletonMonoBehaviour <UIShortCutMenu> .Instance.IsInputEnable = false; } SingletonMonoBehaviour <FadeCamera> .Instance.FadeOut(0.2f, delegate { SceneAdjustNow(NextScene); if (SceneChangeAct != null) { SceneChangeAct(); SceneChangeAct = null; } StartCoroutine(GotoNextScene(NextScene)); }); }
void Awake() { if (!SingletonMonoBehaviour <FPSUI> .DestroyExtraObjects(this)) { frameCounter = 0; } }
private IEnumerator Start() { Stopwatch stopWatch = new Stopwatch(); stopWatch.Reset(); stopWatch.Start(); yield return(new WaitForEndOfFrame()); mStateManager = new StateManager <State>(State.NONE); mStateManager.OnPop = OnPopState; mStateManager.OnPush = OnPushState; mStateManager.OnResume = OnResumeState; mStateManager.OnSwitch = OnSwitchState; mUserInterfaceInteriorChangeManager.SetOnRequestMoveToFurnitureStoreListener(OnRequestMoveFurnitureStore); if (SingletonMonoBehaviour <UIPortFrame> .exist()) { SingletonMonoBehaviour <UIPortFrame> .Instance.gameObject.SetActive(false); } mKeyController = new KeyControl(); AudioClip sceneBGM = SoundFile.LoadBGM((BGMFileInfos)104); stopWatch.Stop(); for (int frame = 0; frame < stopWatch.Elapsed.Milliseconds / 60; frame++) { yield return(new WaitForEndOfFrame()); } SoundUtils.SwitchBGM(sceneBGM); SingletonMonoBehaviour <PortObjectManager> .Instance.PortTransition.EndTransition(null); mStateManager.PushState(State.InteriorChange); }
private void OnDestroy() { if (UpdateCharacterCor != null) { StopCoroutine(UpdateCharacterCor); UpdateCharacterCor = null; } if (UpdateSideChangeCor != null) { StopCoroutine(UpdateSideChangeCor); UpdateSideChangeCor = null; } ShipView = null; StaffRoll = null; if (ShipModels != null) { ShipModels.Clear(); } UpdateCharacterCor = null; UpdateSideChangeCor = null; key = null; foreverLabel = null; if (SingletonMonoBehaviour <Live2DModel> .exist()) { SingletonMonoBehaviour <Live2DModel> .Instance.isDontRelease = false; } }
void Awake() { if (!SingletonMonoBehaviour <ObjectPool> .DestroyExtraObjects(gameObject)) { Init(); } }
private void OnDraggingStart(DragInfo dragInfo) { if (SingletonMonoBehaviour <UIShortCutMenu> .exist() && SingletonMonoBehaviour <UIShortCutMenu> .Instance.IsFocus) { return; } if (this.mCamera != null) { Ray ray = this.mCamera.ScreenPointToRay(dragInfo.pos); RaycastHit raycastHit; if (Physics.Raycast(ray, ref raycastHit, float.PositiveInfinity)) { if (!raycastHit.get_collider().get_gameObject().get_transform().Equals(base.get_transform())) { return; } if (raycastHit.get_collider().get_transform() == this.mTransformCache) { this.mVector3SwipeMoved.Set(0f, 0f, 0f); this.mStopWatch.Reset(); this.mStopWatch.Start(); this.isDraging = true; this.OnSwipeEventAction(UIDisplaySwipeEventRegion.ActionType.Start, dragInfo.delta.x, dragInfo.delta.y, 0f, 0f, 0f); this.mLastSwipeStartWorldPosition.Set(dragInfo.pos.x, dragInfo.pos.y, 0f); this.mCurrentDragIndex = dragInfo.index; } } } }
public override void OnUseItem(PlayerController player) { base.OnUseItem(player); SingletonMonoBehaviour.GetInstance() .StartCoroutine(UseCoroutine(player)); }
public void StartTransition(Generics.Scene NextScene, bool isPortFramePos, Action act) { this.SetActiveChildren(true); this.setCameraDepth(NextScene); if (isPortFramePos) { this.setOnPortCirclePosition(); } else { this.setDefaultPosition(); } if (SingletonMonoBehaviour <UIPortFrame> .exist()) { SingletonMonoBehaviour <UIPortFrame> .Instance.fadeOutCircleButtonLabel(); } this.Reset(); this.setBG(NextScene); iTween.ValueTo(base.get_gameObject(), iTween.Hash(new object[] { "from", 0.1, "to", 2500, "time", 0.4f, "onupdate", "UpdateHandler", "oncomplete", "OnFinished" })); this.onfinished = act; this.isOver = true; }
public void ProcessChangeSlotItem(int slotIndex, SlotitemModel slotItem, int voiceType, bool isExSlot) { if (status != ScreenStatus.MODE_SOUBI_HENKOU_PREVIEW) { return; } mRemodelManager.GetSlotitemInfoToChange(focusedShipModel.MemId, slotItem.MemId, slotIndex); SlotSetChkResult_Slot slotSetChkResult_Slot = isExSlot ? mRemodelManager.IsValidChangeSlotitemEx(focusedShipModel.MemId, slotItem.MemId) : mRemodelManager.IsValidChangeSlotitem(focusedShipModel.MemId, slotItem.MemId, slotIndex); bool flag = false; switch (slotSetChkResult_Slot) { case SlotSetChkResult_Slot.Ok: case SlotSetChkResult_Slot.OkBauxiteUse: case SlotSetChkResult_Slot.OkBauxiteUseHighCost: flag = true; break; case SlotSetChkResult_Slot.NgBauxiteShort: AnimateBauxite(ngBauxiteShortMessage); break; case SlotSetChkResult_Slot.NgBausiteShortHighCost: AnimateBauxite(ngBausiteShortHighCostMessage); break; } SlotSetChkResult_Slot slotSetChkResult_Slot2 = isExSlot ? mRemodelManager.ChangeSlotitemEx(focusedShipModel.MemId, slotItem.MemId) : mRemodelManager.ChangeSlotitem(focusedShipModel.MemId, slotItem.MemId, slotIndex); if (flag) { bool flag2 = true; switch (slotSetChkResult_Slot2) { case SlotSetChkResult_Slot.OkBauxiteUse: AnimateBauxite(okBauxiteUseMessage); break; case SlotSetChkResult_Slot.OkBauxiteUseHighCost: AnimateBauxite(okBauxiteUseHighCostMessage); break; default: flag2 = false; break; case SlotSetChkResult_Slot.Ok: break; } if (flag2) { ShipUtils.PlayShipVoice(focusedShipModel, voiceType); } if (SingletonMonoBehaviour <UIPortFrame> .exist()) { SingletonMonoBehaviour <UIPortFrame> .Instance.UpdateHeaderInfo(mRemodelManager); } } Back2SoubiHenkou(); }
private void UpdateInfo(ManagerBase manager) { if (SingletonMonoBehaviour <UIPortFrame> .exist()) { SingletonMonoBehaviour <UIPortFrame> .Instance.CircleUpdateInfo(manager); } mRevampMaterialsInfo.UpdateInfo(manager); }
private void OnStartSuccessRevampAnimation(RevampContext context) { _isTop = true; UIRevampIcon revampIcon = Util.Instantiate(mPrefab_RevampIcon.gameObject, base.gameObject).GetComponent <UIRevampIcon>(); revampIcon.Initialize(context.GetBeforeSlotItemInfo().MstId, context.GetBeforeSlotItemInfo().Level, mCameraProduction); revampIcon.StartRevamp(context.GetAfterSlotItemInfo().MstId, context.GetAfterSlotItemInfo().Level, context.GetAfterSlotItemInfo().Name, delegate { SingletonMonoBehaviour <UIShortCutMenu> .Instance.IsInputEnable = true; mRevampAkashi.ChangeBodyTo(UIRevampAkashi.BodyType.Normal); _isAnimation = false; string empty = string.Empty; PlayAkashiVoice(mAudioClip_308); empty += "[000000]改修成功しました。"; empty += "\n"; empty += $"[329ad6]{mRevampContext.GetAfterSlotItemInfo().Name}[-]"; mParticleSystem_SuccessStars.Play(false); if (SingletonMonoBehaviour <UIPortFrame> .exist()) { SingletonMonoBehaviour <UIPortFrame> .Instance.isColliderEnabled = true; } TrophyUtil.Unlock_AlbumSlotNum(); if (mRevampContext.IsModelChange()) { SoundUtils.PlaySE(mAudioClip_SE_023); } else { SoundUtils.PlaySE(mAudioClip_SE_021); } KeyControl keyController = mRevampInfoBalloon.SayMessage(empty, delegate { if (mRevampContext.ConsortShip != null) { mTransform_AssistantShipParent.DOLocalMove(mVector3_AssistantShipHideLocalPosition, 0.6f); } mRevampInfoBalloon.alpha = 1f; UnityEngine.Object.Destroy(revampIcon.gameObject); mRevampInfoBalloon.SayMessage("[000000]どの装備の改修を試みますか?"); mRevampManager.GetDetail(mRevampContext.RevampRecipe.RecipeId, mRevampContext.GetBeforeSlotItemInfo().MemId); RevampRecipeModel[] recipes = mRevampManager.GetRecipes(); int num = 0; RevampRecipeModel[] array = recipes; foreach (RevampRecipeModel revampRecipeModel in array) { if (revampRecipeModel.RecipeId == mRevampContext.RevampRecipe.RecipeId) { break; } num++; } KeyControl keyController2 = (num > recipes.Length) ? ShowUIRevampRecipeList(0) : ShowUIRevampRecipeList(num); ChangeFocusKeyController(keyController2); }); ChangeFocusKeyController(keyController); mTransform_AssistantShipParent.DOLocalMove(mVector3_AssistantShipHideLocalPosition, 0.6f); }); }
private IEnumerator _HeadButtonEnable(float time = 4.5f) { yield return(new WaitForSeconds(time)); if (SingletonMonoBehaviour <UIPortFrame> .exist()) { SingletonMonoBehaviour <UIPortFrame> .Instance.isColliderEnabled = true; } }
private void OnPushEndOfPracticeState() { if (SingletonMonoBehaviour <Live2DModel> .exist()) { SingletonMonoBehaviour <Live2DModel> .Instance.Disable(); } mUIDeckPracticeShutter.SetOnFinishedCloseShutterAnimationListener(OnClosedShutterEventForEndOfPractice); mUIDeckPracticeShutter.CloseShutter(); }
void OnDestroy() { // ※破棄時に、登録した実体の解除を行なっている // 自身がインスタンスなら登録を解除 if (this == instance) { _instance = null; } }
//-------------------------------------- // Methods //-------------------------------------- private void Instantiate() { Type type = _singletonMonoBehaviour.GetType(); var instance = GameObject.FindObjectOfType(type); if (instance == null) { SingletonMonoBehaviour singletonMonoBehaviour = Instantiate(_singletonMonoBehaviour, _parentTransform); } }
private void Update() { if (SingletonMonoBehaviour <Live2DModel> .exist() && !SingletonMonoBehaviour <Live2DModel> .Instance.isLive2DModel) { _uiShipTex.transform.localScale = Smoothing(); } if (isEnableBackTouch && !SingletonMonoBehaviour <Live2DModel> .Instance.IsStop) { InputBackTouch(); } }
public void EndTransition(Action act, bool isLockTouchOff = true, bool isPortFrameColliderEnable = true) { if (!this.isOver) { SingletonMonoBehaviour <FadeCamera> .Instance.FadeIn(0.2f, delegate { if (SingletonMonoBehaviour <UIShortCutMenu> .exist()) { SingletonMonoBehaviour <UIShortCutMenu> .Instance.IsInputEnable = true; SingletonMonoBehaviour <UIShortCutMenu> .Instance.LockOffControl(); SingletonMonoBehaviour <UIShortCutMenu> .Instance.LockTouchControl(!isLockTouchOff); } if (act != null) { act.Invoke(); act = null; this.SetActiveChildren(false); } if (SingletonMonoBehaviour <UIPortFrame> .exist() && isPortFrameColliderEnable) { SingletonMonoBehaviour <UIPortFrame> .Instance.isColliderEnabled = true; } this.isTransitionNow = false; }); return; } TweenAlpha tweenAlpha = TweenAlpha.Begin(this.TransitionPanel.get_gameObject(), 0.4f, 0f); tweenAlpha.onFinished.Clear(); tweenAlpha.SetOnFinished(delegate { if (SingletonMonoBehaviour <UIShortCutMenu> .exist()) { SingletonMonoBehaviour <UIShortCutMenu> .Instance.IsInputEnable = true; Debug.Log("transitionEnd"); SingletonMonoBehaviour <UIShortCutMenu> .Instance.LockOffControl(); SingletonMonoBehaviour <UIShortCutMenu> .Instance.LockTouchControl(!isLockTouchOff); } this.TransitionPanel.SetRect(0f, 0f, 0.1f, 0.1f); if (act != null) { act.Invoke(); act = null; this.SetActiveChildren(false); } if (SingletonMonoBehaviour <UIPortFrame> .exist()) { SingletonMonoBehaviour <UIPortFrame> .Instance.isColliderEnabled = true; } this.isOver = false; this.isTransitionNow = false; }); }
private void OnPushStateBattlePracticeProd() { if (SingletonMonoBehaviour <Live2DModel> .exist()) { SingletonMonoBehaviour <Live2DModel> .Instance.Disable(); } mUIPracticeBattleStartProduction.SetActive(isActive: true); mUIPracticeBattleStartProduction.Initialize(mBattlePracticeContext.FriendDeck, mBattlePracticeContext.TargetDeck); mUIPracticeBattleStartProduction.SetKeyController(mKeyController); mUIPracticeBattleStartProduction.Play(); }
private void Update() { if (SingletonMonoBehaviour <Live2DModel> .exist() && !SingletonMonoBehaviour <Live2DModel> .Instance.isLive2DModel) { this._uiShipTex.get_transform().set_localScale(this.Smoothing()); } if (this.isEnableBackTouch && !SingletonMonoBehaviour <Live2DModel> .Instance.IsStop) { this.InputBackTouch(); } }
private void SafePlaySEOneShot(AudioClip audioClip) { if (SingletonMonoBehaviour <SoundManager> .exist() && SingletonMonoBehaviour <SoundManager> .Instance.seSourceObserver != null) { int index = SingletonMonoBehaviour <SoundManager> .Instance.seSourceObserver.Count - 1; if (SingletonMonoBehaviour <SoundManager> .Instance.seSourceObserver[index] != null && (UnityEngine.Object)SingletonMonoBehaviour <SoundManager> .Instance.seSourceObserver[index].source != null) { SingletonMonoBehaviour <SoundManager> .Instance.seSourceObserver[index].source.PlayOneShot(audioClip, SingletonMonoBehaviour <SoundManager> .Instance.soundVolume.SE); } } }
public void Show() { if (SingletonMonoBehaviour <TutorialGuideManager> .exist() && SingletonMonoBehaviour <TutorialGuideManager> .Instance.model != null && tutorialID != -1 && SingletonMonoBehaviour <TutorialGuideManager> .Instance.model.GetStepTutorialFlg(tutorialID)) { Object.Destroy(base.gameObject); } else if (!(StrategyTopTaskManager.Instance != null) || StrategyTopTaskManager.GetSailSelect().isRun) { TweenAlpha.Begin(base.gameObject, 0.5f, 1f); } }
protected void Awake() { // Check if an Instance already exists if (_Instance != null) { throw new MultipleInstanceException(); } else { _Instance = this; } }
private void SafePlaySEOneShot(AudioClip audioClip) { if (SingletonMonoBehaviour <SoundManager> .exist() && SingletonMonoBehaviour <SoundManager> .Instance.seSourceObserver != null) { int num = SingletonMonoBehaviour <SoundManager> .Instance.seSourceObserver.get_Count() - 1; if (SingletonMonoBehaviour <SoundManager> .Instance.seSourceObserver.get_Item(num) != null && SingletonMonoBehaviour <SoundManager> .Instance.seSourceObserver.get_Item(num).source != null) { SingletonMonoBehaviour <SoundManager> .Instance.seSourceObserver.get_Item(num).source.PlayOneShot(audioClip, SingletonMonoBehaviour <SoundManager> .Instance.soundVolume.SE); } } }
static int Init(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); SingletonMonoBehaviour <ResourcesManager> obj = (SingletonMonoBehaviour <ResourcesManager>)ToLua.CheckObject <SingletonMonoBehaviour <ResourcesManager> >(L, 1); obj.Init(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
// // 玩家配置 // protected UserPreferenceProxy userPreferenceProxy; // protected virtual UserPreferenceProxy TheUserPreferenceProxy // { // get{ // if(userPreferenceProxy==null) // { // userPreferenceProxy = ApplicationFacade.RetrieveProxy (UserPreferenceProxy.defaultProxyName) as UserPreferenceProxy; // } // return userPreferenceProxy; // } // } // Use this for initialization void Awake() { SingletonMonoBehaviour <AudioController> .DestroyExtraObjects(gameObject); // 启动时 创建背景音乐的声源 if (BGMSource == null) { var bgmObj = Instantiate(PredefinedAudioObject); bgmObj.transform.parent = transform; BGMSource = bgmObj.GetComponent <TDAudioSource> (); } }
private IEnumerator LoadStart() { Debug.Log("☆☆☆☆☆☆☆☆☆☆LoadStart☆☆☆☆☆☆☆☆☆☆"); while (mAsyncOperation.progress < 0.9f) { yield return(null); } mAsyncOperation.allowSceneActivation = true; mAsyncOperation = null; if (SingletonMonoBehaviour <NowLoadingAnimation> .exist()) { SingletonMonoBehaviour <NowLoadingAnimation> .Instance.EndAnimation(); } }
private void checkAllFirstUpdate() { if (App.isFirstUpdate) { this.firstUpdate = true; if (SingletonMonoBehaviour <AppInformation> .exist()) { SingletonMonoBehaviour <AppInformation> .Instance.FirstUpdateEnd(); } else { App.isFirstUpdate = false; } } }