private IEnumerator Start() { yield return(new WaitForEndOfFrame()); mKeyController = new KeyControl(); mKeyController.IsRun = false; mUIDisplaySwipeEventRegion.SetEventCatchCamera(mCamera_TouchEventCatch); mUIDisplaySwipeEventRegion.SetOnSwipeListener(OnSwipeDeckListener); mUIRemodeModernizationShipTargetListParentNew.SetCamera(mCamera_TouchEventCatch); mUIRemodelEquipListParent.SetSwipeEventCatchCamera(mCamera_TouchEventCatch); mUIRemodelOtherShipPickerParent.SetSwipeEventCamera(mCamera_TouchEventCatch); int areaId = SingletonMonoBehaviour <AppInformation> .Instance.CurrentAreaID; mRemodelManager = new RemodelManager(areaId); yield return(new WaitForEndOfFrame()); DeckModel[] decks = mRemodelManager.UserInfo.GetDecksFromArea(areaId); UpdateHeaderMaterial(); yield return(new WaitForEndOfFrame()); yield return(StartCoroutine(InitViewsCoroutine(decks))); yield return(new WaitForEndOfFrame()); AudioClip sceneBgm = SoundFile.LoadBGM(BGMFileInfos.PortTools); yield return(new WaitForEndOfFrame()); if (SingletonMonoBehaviour <PortObjectManager> .exist()) { SoundUtils.SwitchBGM(sceneBgm); SingletonMonoBehaviour <UIPortFrame> .Instance.setVisibleHeader(isVisible : false); SingletonMonoBehaviour <UIPortFrame> .Instance.CircleUpdateInfo(mRemodelManager); SingletonMonoBehaviour <PortObjectManager> .Instance.PortTransition.EndTransition(null); mKeyController.IsRun = true; } }
private void Awake() { _isMove = false; _dicButtons = new Dictionary <ButtonIndex, UIButton>(); foreach (int value in Enum.GetValues(typeof(ButtonIndex))) { _dicButtons.Add((ButtonIndex)value, ((Component)base.transform.FindChild("Button_" + ((ButtonIndex)value).ToString())).GetComponent <UIButton>()); _dicButtons[(ButtonIndex)value].onClick = Util.CreateEventDelegateList(this, "press_Button", (ButtonIndex)value); } _dicShipParts = new Dictionary <ShipPartsIndex, UITexture>(); foreach (int value2 in Enum.GetValues(typeof(ShipPartsIndex))) { _dicShipParts.Add((ShipPartsIndex)value2, ((Component)base.transform.FindChild("Ship_" + ((ShipPartsIndex)value2).ToString())).GetComponent <UITexture>()); } _iStarterType = CtrlStarterSelect.StarterType.Ex; _nSelectedId = 0; _clsSwipeEvent = GameObject.Find("EventArea").GetComponent <UIDisplaySwipeEventRegion>(); _clsSwipeEvent.SetOnSwipeActionJudgeCallBack(OnSwipe); _clsSwipeEvent.SetEventCatchCamera(StartupTaskManager.GetPSVitaMovie().GetComponent <Camera>()); _isDecide = false; panel.widgetsAreStatic = true; }
public void Initialize(Camera eventCamera, BattleFormationKinds1[] formations, bool manualUpdate) { mWidget_FormationSelecteNames.alpha = 1f; mManualUpdate = manualUpdate; mLabelCenter.text = App.GetFormationText(formations[0]); mLabelRight.text = App.GetFormationText(formations[1]); mLabelLeft.text = App.GetFormationText(formations[formations.Length - 1]); mLabelTemp.text = string.Empty; mUIBattleFormationKindSelector.SetActive(isActive: true); mUIBattleFormationKindSelector.SetOnUIBattleFormationKindSelectorAction(delegate(UIBattleFormationKindSelector.ActionType actionType, UIBattleFormationKind centerView) { UIBattleFormationKind[] views = mUIBattleFormationKindSelector.GetViews(); switch (actionType) { case UIBattleFormationKindSelector.ActionType.Select: { UIBattleFormationKind[] array = views; foreach (UIBattleFormationKind uIBattleFormationKind in array) { if (!(centerView == uIBattleFormationKind)) { uIBattleFormationKind.Hide(); } } mArrow_Left.mTexture_ArrowBack.alpha = 0f; mArrow_Left.mTexture_ArrowFront.alpha = 0f; mArrow_Right.mTexture_ArrowBack.alpha = 0f; mArrow_Right.mTexture_ArrowFront.alpha = 0f; mLabelRight.text = string.Empty; mLabelLeft.text = string.Empty; mLabelTemp.text = string.Empty; SetKeyController(null); mUIDisplaySwipeEventRegion_FormationChange.enabled = false; CallBack(ActionType.Select, this, centerView); break; } case UIBattleFormationKindSelector.ActionType.SelectAuto: CallBack(ActionType.SelectAuto, this, null); break; case UIBattleFormationKindSelector.ActionType.OnNextChanged: { UILabel uILabel = mLabelTemp; UILabel from = mLabelLeft; UILabel from2 = mLabelCenter; UILabel from3 = mLabelRight; int num = Array.IndexOf(formations, centerView.Category); int num2 = (int)Util.LoopValue(num + 1, 0f, formations.Length - 1); uILabel.text = App.GetFormationText(formations[num2]); if (DOTween.IsTweening(this)) { DOTween.Kill(this, complete: true); } Sequence sequence2 = DOTween.Sequence().SetId(this); Tween t5 = GenerateTweenMove(from2, mDefaultLeftAlpha, mVector3_DefaultPositionLeft, mVector3_DefaultScaleLeft, moveDuration); Tween t6 = GenerateTweenMove(from, mDefaultTempAlpha, mVector3_DefaultPositionTemp, mVector3_DefaultScaleTemp, moveDuration); Tween t7 = GenerateTweenMove(uILabel, mDefaultRightAlpha, mVector3_DefaultPositionRight, mVector3_DefaultScaleRight, moveDuration); Tween t8 = GenerateTweenMove(from3, mDefaultCenterAlpha, mVector3_DefaultPositionCenter, mVector3_DefaultScaleCenter, moveDuration); TweenCallback action2 = delegate { }; sequence2.Append(t5); sequence2.Join(t6); sequence2.Join(t7); sequence2.Join(t8); sequence2.OnComplete(action2); mLabelCenter = from3; mLabelLeft = from2; mLabelTemp = from; mLabelRight = uILabel; mLabelCenter.depth = 2; mLabelLeft.depth = 1; mLabelRight.depth = 1; mLabelTemp.depth = 0; GenerateTweenArrow(mArrow_Right, Direction.Reverse); break; } case UIBattleFormationKindSelector.ActionType.OnPrevChanged: { UILabel uILabel = mLabelTemp; UILabel from = mLabelLeft; UILabel from2 = mLabelCenter; UILabel from3 = mLabelRight; int num = Array.IndexOf(formations, centerView.Category); int num2 = (int)Util.LoopValue(num - 1, 0f, formations.Length - 1); uILabel.text = App.GetFormationText(formations[num2]); if (DOTween.IsTweening(this)) { DOTween.Kill(this, complete: true); } Sequence sequence = DOTween.Sequence().SetId(this); Tween t = GenerateTweenMove(from2, mDefaultRightAlpha, mVector3_DefaultPositionRight, mVector3_DefaultScaleRight, moveDuration); Tween t2 = GenerateTweenMove(from3, mDefaultTempAlpha, mVector3_DefaultPositionTemp, mVector3_DefaultScaleTemp, moveDuration); Tween t3 = GenerateTweenMove(uILabel, mDefaultLeftAlpha, mVector3_DefaultPositionLeft, mVector3_DefaultScaleLeft, moveDuration); Tween t4 = GenerateTweenMove(from, mDefaultCenterAlpha, mVector3_DefaultPositionCenter, mVector3_DefaultScaleCenter, moveDuration); TweenCallback action = delegate { }; sequence.Append(t); sequence.Join(t2); sequence.Join(t3); sequence.Join(t4); sequence.OnComplete(action); mLabelRight = from2; mLabelTemp = from3; mLabelLeft = uILabel; mLabelCenter = from; mLabelCenter.depth = 2; mLabelLeft.depth = 1; mLabelRight.depth = 1; mLabelTemp.depth = 0; GenerateTweenArrow(mArrow_Left, Direction.Forward); break; } } }); mUIBattleFormationKindSelector.Initialize(formations); mUIBattleFormationKindSelector.Show(); mUIDisplaySwipeEventRegion_FormationChange.SetEventCatchCamera(eventCamera); mUIDisplaySwipeEventRegion_FormationChange.SetOnSwipeActionJudgeCallBack(OnSwipeEvent); }
private void StartUp() { needUpdate = true; Camera component; if (Application.loadedLevelName == "Record" || Application.loadedLevelName == "Record_cam") { _isScene = true; component = GameObject.Find("MaskCamera").GetComponent <Camera>(); component.rect = new Rect(0.353f, 0.05f, 0.625f, 0.699f); } else { _isScene = false; component = GameObject.Find("OverViewCamera").GetComponent <Camera>(); GameObject.Find("MaskCamera").GetComponent <Camera>().rect = new Rect(0.353f, 0.16f, 0.625f, 0.699f); } mtouchEventArea.SetOnSwipeActionJudgeCallBack(SwipeJudgeDelegate); mtouchEventArea.SetEventCatchCamera(component); _ANIM_filebase = "boards_mvud"; _clsRecord = new RecordManager(); _gotMedal = _clsRecord.IsCleardOnce(); if (_gotMedal) { ItemSelectController = new KeyControl(0, 3); } else { ItemSelectController = new KeyControl(0, 2); } ItemSelectController.setChangeValue(-1f, 0f, 1f, 0f); _SelectableDiff = 3; if (_clsRecord.GetClearCount(DifficultKind.OTU) > 0) { _SelectableDiff = 4; } if (_clsRecord.GetClearCount(DifficultKind.KOU) > 0) { _SelectableDiff = 5; } if (SingletonMonoBehaviour <UIPortFrame> .exist()) { SingletonMonoBehaviour <UIPortFrame> .Instance.CircleUpdateInfo(_clsRecord); } _AM = GetComponent <Animation>(); if (_isScene) { _AM_l = ((Component)mMedalist).GetComponent <Animation>(); } _SM = SingletonMonoBehaviour <SoundManager> .Instance; _Button_L_B.transform.localPosition = Vector3.zero; _Button_R_B.transform.localPosition = Vector3.zero; UIButtonMessage component2 = _Button_L.GetComponent <UIButtonMessage>(); component2.target = base.gameObject; component2.functionName = "Pressed_Button_L"; component2.trigger = UIButtonMessage.Trigger.OnClick; UIButtonMessage component3 = _Button_R.GetComponent <UIButtonMessage>(); component3.target = base.gameObject; component3.functionName = "Pressed_Button_R"; component3.trigger = UIButtonMessage.Trigger.OnClick; _draw_labels(); _now_page = 1; mSecurityShipModel = ((SingletonMonoBehaviour <AppInformation> .Instance.FlagShipModel == null) ? new ShipModel(1) : SingletonMonoBehaviour <AppInformation> .Instance.FlagShipModel); DamageState damageStatus = mSecurityShipModel.DamageStatus; if (SingletonMonoBehaviour <PortObjectManager> .Instance != null) { SoundUtils.SwitchBGM(BGMFileInfos.PortTools); SingletonMonoBehaviour <PortObjectManager> .Instance.PortTransition.EndTransition(delegate { ShipUtils.PlayShipVoice(mSecurityShipModel, 8); }); } if (_isScene) { set_flagship_texture(mSecurityShipModel); iTween.MoveTo(mWindowParam.gameObject, iTween.Hash("islocal", true, "x", -307f, "y", -199f, "time", 1f, "delay", 0.5f)); iTween.MoveTo(mMedalist.gameObject, iTween.Hash("islocal", true, "x", 426f, "y", -203f, "time", 1f, "delay", 1.5f)); return; } SetColorBG(Color.white * 0.9f + Color.black); SetColorText(Color.white * 0.5f + Color.black); SetColorLine(Color.white * 0.5f + Color.black); SetColorIcon(Color.white + Color.black); SetTextShadow(shadow: false); SetCursorColor(Color.red * 0.75f + Color.black); }
protected override bool Init() { isAnimationStarted = false; mDisplaySwipeRegion.SetEventCatchCamera(mCamera); mDisplaySwipeRegion.SetOnSwipeActionJudgeCallBack(OnSwipeAction); Transform transform = mStageSelectRoot; Vector3 localPosition = mCamera.transform.localPosition; float x = localPosition.x; Vector3 localPosition2 = mCamera.transform.localPosition; transform.localPosition = new Vector3(x, localPosition2.y); mAreaId = StrategyTopTaskManager.Instance.TileManager.FocusTile.areaID; mStrategyTopTaskManager = StrategyTaskManager.GetStrategyTop(); mIsFinishedAnimation = false; mMapModels = StrategyTopTaskManager.GetLogicManager().SelectArea(mAreaId).Maps; mSortieManager = StrategyTopTaskManager.GetLogicManager().SelectArea(mAreaId); mKeyController = new KeyControl(); mKeyController.isLoopIndex = true; mKeyController.IsRun = false; TweenAlpha.Begin(GameObject.Find("Information Root"), 0.3f, 0f); TweenAlpha.Begin(GameObject.Find("Map_BG"), 0.3f, 0f); GameObject gameObject = StrategyTopTaskManager.Instance.TileManager.Tiles[mAreaId].getSprite().gameObject; mTransform_AnimationTile = Util.Instantiate(gameObject, GameObject.Find("Map Root").gameObject, addParentPos: true).transform; mAnimation_MapObjects = ((Component)mTransform_StageCovers).GetComponent <Animation>(); StartCoroutine(StartSeaAnimationCoroutine()); IEnumerator routine = StartSeaAnimationCoroutine(); StartCoroutine(routine); mTransform_StageCovers.SetActive(isActive: true); ((Component)mTransform_StageCovers.Find("UIStageCovers")).GetComponent <UIWidget>().alpha = 0.001f; SelectedHexAnimation(delegate { StartCoroutine(InititalizeStageCovers(delegate { ((Component)mTransform_StageCovers).GetComponent <Animation>().Play("SortieAnimation"); ShowMaps(mMapModels); })); }); if (mAreaId == 2 || mAreaId == 4 || mAreaId == 5 || mAreaId == 6 || mAreaId == 7 || mAreaId == 10 || mAreaId == 14) { mTexture_sallyBGsky.mainTexture = (Resources.Load("Textures/Strategy/sea2_Sunny_sky") as Texture); mTexture_sallyBGclouds.mainTexture = (Resources.Load("Textures/Strategy/sea2_Sunny_clouds") as Texture); mTexture_sallyBGcloudRefl.mainTexture = (Resources.Load("Textures/Strategy/sea2_Sunny_clouds") as Texture); mTexture_sallyBGcloudRefl.height = 91; mTexture_sallyBGcloudRefl.alpha = 0.25f; mTexture_bgSea.mainTexture = (Resources.Load("Textures/Strategy/sea2_Sunny_sea") as Texture); mTexture_snow.mainTexture = null; } else if (mAreaId == 3 || mAreaId == 13) { mTexture_sallyBGsky.mainTexture = (Resources.Load("Textures/Strategy/sea3_Sunny_sky") as Texture); mTexture_sallyBGclouds.mainTexture = (Resources.Load("Textures/Strategy/sea3_Sunny_clouds") as Texture); mTexture_sallyBGcloudRefl.mainTexture = (Resources.Load("Textures/Strategy/sea3_Sunny_clouds") as Texture); mTexture_sallyBGcloudRefl.height = 90; mTexture_sallyBGcloudRefl.alpha = 0.75f; mTexture_bgSea.mainTexture = (Resources.Load("Textures/Strategy/sea3_Sunny_sea") as Texture); mTexture_snow.mainTexture = (Resources.Load("Textures/Strategy/sea3_snow") as Texture); } else if (mAreaId == 15 || mAreaId == 16 || mAreaId == 17) { mTexture_sallyBGsky.mainTexture = (Resources.Load("Textures/Strategy/sea4_Sunny_sky2") as Texture); mTexture_sallyBGclouds.mainTexture = (Resources.Load("Textures/Strategy/sea4_Sunny_clouds") as Texture); mTexture_sallyBGcloudRefl.mainTexture = (Resources.Load("Textures/Strategy/sea4_Sunny_clouds") as Texture); mTexture_sallyBGcloudRefl.height = 120; mTexture_sallyBGcloudRefl.alpha = 0.25f; mTexture_bgSea.mainTexture = (Resources.Load("Textures/Strategy/sea4_Sunny_sea") as Texture); mTexture_snow.mainTexture = null; } else { mTexture_sallyBGsky.mainTexture = (Resources.Load("Textures/Strategy/sea1_Sunny_sky") as Texture); mTexture_sallyBGclouds.mainTexture = (Resources.Load("Textures/Strategy/sea1_Sunny_clouds") as Texture); mTexture_sallyBGcloudRefl.mainTexture = (Resources.Load("Textures/Strategy/sea1_Sunny_clouds") as Texture); mTexture_sallyBGcloudRefl.height = 140; mTexture_sallyBGcloudRefl.alpha = 0.25f; mTexture_bgSea.mainTexture = (Resources.Load("Textures/Strategy/sea1_Sunny_sea") as Texture); mTexture_snow.mainTexture = null; } return(true); }
public void SetCamera(Camera cam) { mUIDisplaySwipeEventRegion.SetEventCatchCamera(cam); }
public void SetCamera(Camera camera) { swipeEventRegion.SetEventCatchCamera(camera); }
private void StartUp() { _StartUp = true; if (_DEBUG_MODE_NOW_) { _dbg_class = 1; _DBG_Button_L = ((Component)base.transform.FindChild("Debug_ship/DBG_Button_L")).GetComponent <UIButton>(); _DBG_Button_R = ((Component)base.transform.FindChild("Debug_ship/DBG_Button_R")).GetComponent <UIButton>(); UIButtonMessage component = _DBG_Button_L.GetComponent <UIButtonMessage>(); component.target = base.gameObject; component.functionName = "Pressed_DBG_Button_L"; component.trigger = UIButtonMessage.Trigger.OnClick; UIButtonMessage component2 = _DBG_Button_R.GetComponent <UIButtonMessage>(); component2.target = base.gameObject; component2.functionName = "Pressed_DBG_Button_R"; component2.trigger = UIButtonMessage.Trigger.OnClick; } UIDisplaySwipeEventRegion component3 = GameObject.Find("TouchEventArea").GetComponent <UIDisplaySwipeEventRegion>(); Camera component4; if (Application.loadedLevelName == "Record") { _isRecordScene = true; component4 = GameObject.Find("Camera").GetComponent <Camera>(); SingletonMonoBehaviour <PortObjectManager> .Instance.PortTransition.EndTransition(delegate { ShipUtils.PlayShipVoice(SingletonMonoBehaviour <AppInformation> .Instance.CurrentDeck.GetFlagShip(), 8); }); } else { _isRecordScene = false; component4 = GameObject.Find("OverViewCamera").GetComponent <Camera>(); } component3.SetOnSwipeActionJudgeCallBack(SwipeJudgeDelegate); component3.SetEventCatchCamera(component4); _ANIM_filebase = "boards_mvud"; _AM = GameObject.Find("RecordScene").GetComponent <Animation>(); if (_isRecordScene) { _AM_l = GameObject.Find("medalist").GetComponent <Animation>(); } _AM_b = GameObject.Find("btn").GetComponent <Animation>(); _SM = SingletonMonoBehaviour <SoundManager> .Instance; _Button_L = ((Component)base.transform.FindChild("btn/Button_L")).GetComponent <UIButton>(); _Button_R = ((Component)base.transform.FindChild("btn/Button_R")).GetComponent <UIButton>(); _Button_L_B = ((Component)base.transform.FindChild("btn/Button_L/Background")).GetComponent <UITexture>(); _Button_R_B = ((Component)base.transform.FindChild("btn/Button_R/Background")).GetComponent <UITexture>(); _Button_L_B.transform.localScale = Vector3.zero; _Button_R_B.transform.localScale = Vector3.one; UIButtonMessage component5 = _Button_L.GetComponent <UIButtonMessage>(); component5.target = base.gameObject; component5.functionName = "Pressed_Button_L"; component5.trigger = UIButtonMessage.Trigger.OnClick; UIButtonMessage component6 = _Button_R.GetComponent <UIButtonMessage>(); component6.target = base.gameObject; component6.functionName = "Pressed_Button_R"; component6.trigger = UIButtonMessage.Trigger.OnClick; _board1 = GameObject.Find("board1"); ItemSelectController = new KeyControl(0, 2); ItemSelectController.setChangeValue(-1f, 0f, 1f, 0f); _draw_labels(); _now_page = 1; ShipModel shipModel = (SingletonMonoBehaviour <AppInformation> .Instance.FlagShipModel == null) ? new ShipModel(1) : SingletonMonoBehaviour <AppInformation> .Instance.FlagShipModel; _flag_ship = shipModel.GetGraphicsMstId(); DamageState damageStatus = shipModel.DamageStatus; if (damageStatus == DamageState.Normal || damageStatus == DamageState.Shouha) { _damaged = false; } else { _damaged = true; } }