private void OnRefresh(int rollCount, int focusPosition) { int logicViewingLength = GetLogicViewingLength(); int num = rollCount % logicViewingLength; for (int i = 0; i < logicViewingLength; i++) { View child = Views[i]; int num2 = rollCount + i - num; if (i < num) { num2 += logicViewingLength; } OnUpdateChild(num2, child, (num2 >= Models.Length) ? ((Model)null) : Models[num2]); } float childHeight = GetChildHeight(); mVector3Top = new Vector3(0f, 0f, 0f); mVector3TopDestroyLine = new Vector3(0f, mVector3Top.y + childHeight, 0f); mVector3Bottom = new Vector3(0f, (0f - childHeight) * (float)GetLogicViewingLength(), 0f); mVector3BottomDestroyLine = new Vector3(0f, (0f - childHeight) * (float)(GetLogicViewingLength() - 1), 0f); mGridContaints.Reposition(); RefreshPosition(0f, 0f); mUIDisplaySwipeEventRegion.SetOnSwipeActionJudgeCallBack(UIDisplaySwipeEventRegionDelegate); int modelSize = GetModelSize(); if (rollCount + focusPosition < modelSize) { int num3 = (rollCount + focusPosition) % GetLogicViewingLength(); ChangeFocusView(Views[num3], isFirstFocus: false); if (mUseBottomUpReposition) { if (GetUserViewingLength() / 2 < focusPosition) { BottomUp(); } else { BottomDown(); } } } else if (0 < modelSize) { Debug.Log("HeadIndex:" + num + " focusPos:" + focusPosition + " modSize:" + modelSize); ChangeFocusView(Views[num], isFirstFocus: false); BottomDown(); } View[] views = Views; for (int j = 0; j < views.Length; j++) { View val = views[j]; val.cachedTransform.localPosition = ViewsDefaultLocalPosition[val.SortIndex - RollCount]; } OnFinishedInitialize(); }
protected override bool Init() { if (!isKeyControlDisable) { keyController.IsRun = true; } IndexChange = 0; swipeWait = false; SwipeEvent = ((Component)CommandMenu.transform.FindChild("AreaInfoBG")).GetComponent <UIDisplaySwipeEventRegion>(); SwipeEvent.SetOnSwipeActionJudgeCallBack(CheckSwipe); LogicMng = StrategyTopTaskManager.GetLogicManager(); CommandMenu.SetActive(isActive: true); Util.FindParentToChild(ref CommandMenu.Menus, CommandMenu.transform, "Menus"); sttm = StrategyTaskManager.GetStrategyTop(); areaID = SingletonMonoBehaviour <AppInformation> .Instance.CurrentAreaID; areaModel = StrategyTopTaskManager.GetLogicManager().Area[areaID]; sceneChange = true; DeckEnableCheck(); CommandMenu.MenuEnter((int)currentMenu); keyController.Index = (int)currentMenu; KeyControlManager.Instance.KeyController = keyController; isInfoOpenEnable = true; if (SingletonMonoBehaviour <PortObjectManager> .Instance.GetTutorialGuide() != null) { SingletonMonoBehaviour <PortObjectManager> .Instance.GetTutorialGuide().Hide(); } return(true); }
private void Awake() { UISlotItemAlbumListItem[] array = mUISlotItemAlbumListItems; foreach (UISlotItemAlbumListItem uISlotItemAlbumListItem in array) { uISlotItemAlbumListItem.SetOnSelectedListener(OnSelectedListItemListener); } mUIDisplaySwipeEventRegion.SetOnSwipeActionJudgeCallBack(SwipeJudgeDelegate); }
private new void Start() { _displaySwipeEventRegion.SetOnSwipeActionJudgeCallBack(OnSwipeEvent); StateControllerDic = new Dictionary <string, StateController>(); StateControllerDic.Add("banner", StateKeyControl_Banner); StateControllerDic.Add("system", StateKeyControl_System); StateControllerDic.Add("tender", StateKeyControl_Tender); Main.Initialise(); }
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; }
private IEnumerator InitCoroutine(int startModelIdx) { DestroyChildren(); int tmpIdx = startModelIdx % maxViewCount; for (int index = 0; index < maxViewCount; index++) { View child = Util.Instantiate(childPrefab.gameObject, container.gameObject).GetComponent <View>(); child.group = getListGroupNo(); int modelIdx = startModelIdx + index - tmpIdx; if (index < tmpIdx) { modelIdx += maxViewCount; } updateChild(modelIdx, child, GetModel(modelIdx)); } container.Reposition(); views = container.GetComponentsInChildren <View>(); CalculateDefaultViewPos(); bottomDestroyY = (0f - (topDestroyY = GetChildHeight())) * (float)(maxViewCount - 1); container.Reposition(); RefreshPosition(0f); swipeEventRegion.SetOnSwipeActionJudgeCallBack(OnSwipeAction); if (models.Length > 0) { views[0].DoSelect(); cursorIndex = 0; } View[] array = views; for (int i = 0; i < array.Length; i++) { View child2 = array[i]; child2.transform.localPosition = defaultViewPos[child2.modelIndex - rollCount]; } yield return(null); }
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); }
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; } }