public Texture GetShipBanner(ShipModel shipModel) { if (shipModel.IsDamaged()) { return(GetDamagedBanner(shipModel.GetGraphicsMstId())); } return(GetNormalBanner(shipModel.GetGraphicsMstId())); }
public void Initialize(ShipModel flagShip) { this.mFlagShip = flagShip; this.mTexture_FlagShip.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(flagShip.GetGraphicsMstId(), (!flagShip.IsDamaged())? 9 : 10); this.ShipLocate = Util.Poi2Vec(new ShipOffset(flagShip.GetGraphicsMstId()).GetShipDisplayCenter(flagShip.IsDamaged())) + Vector3.get_up() * 115f; }
public void Init(ShipModel ship) { this.ship = ship; if (shipTexture.mainTexture != null) { Resources.UnloadAsset(shipTexture.mainTexture); shipTexture.mainTexture = null; UIDrawCall.ReleaseInactive(); } shipTexture.mainTexture = null; shipTexture.mainTexture = ShipUtils.LoadTexture(ship); shipTexture.MakePixelPerfect(); shipTexture.ResizeCollider(); shipTexture.transform.localPosition = Util.Poi2Vec(new ShipOffset(ship.GetGraphicsMstId()).GetSlotItemCategory(ship.IsDamaged())) + Vector3.down * 20f; shipTexture.transform.localScale = Vector3.one * 1.1f; Show(); }
public static Texture2D LoadTexture(ShipModel model, bool isDamaged) { return(LoadTexture(model.GetGraphicsMstId(), (!isDamaged) ? 9 : 10)); }
public static Texture2D LoadTexture(ShipModel model, int texNum) { return(LoadTexture(model.GetGraphicsMstId(), texNum)); }
public void set_flagship_texture(ShipModel shipModel) { mTexture_SecurityShip = ((Component)mShipTexture).GetComponent <UITexture>(); int texNum = (!shipModel.IsDamaged()) ? 9 : 10; mTexture_SecurityShip.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(shipModel.GetGraphicsMstId(), texNum); mTexture_SecurityShip.MakePixelPerfect(); mTexture_SecurityShip.transform.localPosition = Util.Poi2Vec(shipModel.Offsets.GetShipDisplayCenter(shipModel.IsDamaged())); }
public void Initialize(StrategyMapManager manager, MissionResultModel missionResultModel, KeyControl keyController, Action onSelectNextAction) { mMissionResultModel = missionResultModel; mTransform_TouchControlArea.SetActive(isActive: false); mStrategyMapManager = manager; mMissionJudgeCutIn.Initialize(mMissionResultModel.result); mMissionResultBonus.Inititalize(mMissionResultModel); mMissionResultStatus.Inititalize(mMissionResultModel); ShipModel shipModel = mMissionResultModel.Ships[0]; mTexture_FlagShipGraphic.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(shipModel.GetGraphicsMstId(), (!shipModel.IsDamaged())? 9 : 10); mTexture_FlagShipGraphic.MakePixelPerfect(); mTexture_FlagShipGraphic.transform.localPosition = Util.Poi2Vec(shipModel.Offsets.GetShipDisplayCenter(shipModel.IsDamaged())); mLabel_AdmiralLevel.text = mStrategyMapManager.UserInfo.Level.ToString(); mLabel_AdmiralName.text = mStrategyMapManager.UserInfo.Name; mLabel_AdmiralName.supportEncoding = false; mLabel_DeckName.text = mStrategyMapManager.UserInfo.GetDeck(mMissionResultModel.DeckID).Name; mLabel_DeckName.supportEncoding = false; mLabel_MissionName.text = mMissionResultModel.MissionName; mKeyController = keyController; mOnSelectNextAction = onSelectNextAction; }
private IEnumerator OnStartRevampCoroutine(UIRevampSetting calledObject) { if (SingletonMonoBehaviour <UIPortFrame> .exist()) { SingletonMonoBehaviour <UIPortFrame> .Instance.isColliderEnabled = false; } _isAnimation = true; SingletonMonoBehaviour <UIShortCutMenu> .Instance.IsInputEnable = false; SoundUtils.PlaySE(mAudioClip_SE_020); RevampRecipeDetailModel revampRecipeDetail = mRevampManager.GetDetail(mRevampContext.RevampRecipe.RecipeId, mRevampContext.GetBeforeSlotItemInfo().MemId); revampRecipeDetail.Determined = calledObject.IsDetermined(); SlotitemModel revampedSlotItemModel = mRevampManager.Revamp(revampRecipeDetail); List <int> ids = new List <int>(); ids.AddRange(TrophyUtil.Unlock_At_Revamp()); ids.AddRange(TrophyUtil.Unlock_AlbumSlotNum()); SingletonMonoBehaviour <TrophyManager> .Instance.UnlockTrophies(ids); if (SingletonMonoBehaviour <UIPortFrame> .exist()) { SingletonMonoBehaviour <UIPortFrame> .Instance.UpdateHeaderInfo(mRevampManager); } if (revampedSlotItemModel != null) { mRevampContext.SetSuccess(success: true); mRevampContext.SetAfterSlotItemInfo(revampedSlotItemModel); } else { mRevampContext.SetSuccess(success: false); } UpdateInfo(mRevampManager); int consortShipResourceId = -1; int consortShipVoiceId = -1; ShipModel consortShipModel = mRevampManager.GetConsortShip(revampRecipeDetail, out consortShipResourceId, out consortShipVoiceId); if (consortShipModel != null) { int mstId = mRevampManager.UserInfo.GetDeck(mDeckId).GetShip(1).MstId; mTexture_AssistantShip.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(consortShipModel.GetGraphicsMstId(), (!consortShipModel.IsDamaged())? 9 : 10); mTexture_AssistantShip.MakePixelPerfect(); } yield return(new WaitForEndOfFrame()); calledObject.Hide(delegate { throw new NotImplementedException("なにこれ"); //if (base._003CexistConsortShip_003E__6) //{ // this.mTransform_AssistantShipParent.DOLocalMove(this.mVector3_AssistantShipShowLocalPosition, 0.3f).OnComplete(delegate // { // ShipUtils.PlayShipVoice(consortShipModel, consortShipVoiceId); // }); //} this.ChangeFocusKeyController(null); UnityEngine.Object.Destroy(calledObject.gameObject); this.mRevampAkashi.ChangeBodyTo(UIRevampAkashi.BodyType.Making); this.mRevampInfoBalloon.SayMessage("[000000]改修中・・・[-]"); this.OnStartRevampAnimation(this.mRevampContext); }); }
public void Init(ShipModel ship) { this.ship = ship; if (this.shipTexture.mainTexture != null) { Resources.UnloadAsset(this.shipTexture.mainTexture); this.shipTexture.mainTexture = null; UIDrawCall.ReleaseInactive(); } this.shipTexture.mainTexture = null; this.shipTexture.mainTexture = ShipUtils.LoadTexture(ship); this.shipTexture.MakePixelPerfect(); this.shipTexture.ResizeCollider(); this.shipTexture.get_transform().set_localPosition(Util.Poi2Vec(new ShipOffset(ship.GetGraphicsMstId()).GetSlotItemCategory(ship.IsDamaged())) + Vector3.get_down() * 20f); this.shipTexture.get_transform().set_localScale(Vector3.get_one() * 1.1f); this.Show(); }
public void Initialize(ShipModel shipModel) { mTexture_FlagShip.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(shipModel.GetGraphicsMstId(), (!shipModel.IsDamaged())? 9 : 10); mTexture_FlagShip.transform.localPosition = Util.Poi2Vec(shipModel.Offsets.GetFace(shipModel.IsDamaged())); mTexture_FlagShip.MakePixelPerfect(); }
public void ChangeCharacter(DeckModel deck) { ShipModel shipModel = deck.GetFlagShip(); if (deck != null && deck.MissionState != MissionStates.NONE) { shipModel = null; } if (SingletonMonoBehaviour <Live2DModel> .Instance != null && !SingletonMonoBehaviour <Live2DModel> .Instance.isLive2DModel && StrategyShipCharacter.nowShipModel != null && shipModel != null && (StrategyShipCharacter.nowShipModel.GetGraphicsMstId() != shipModel.GetGraphicsMstId() || !shipModel.IsDamaged()) && this.Render != null && this.Render.mainTexture != null) { Resources.UnloadAsset(this.Render.mainTexture); this.Render.mainTexture = null; } base.ChangeCharacter(shipModel, deck.Id); StrategyShipCharacter.nowShipModel = shipModel; if (this.collision != null) { this.collision.ResetTouchCount(); if (this.Render != null) { this.collision.SetCollisionHight(this.Render.height); } } }
private IEnumerator InitializeCoroutine(ShipModel shipModel, PowUpInfo powUpInfo) { Texture prevTexture = mTexture_Ship.mainTexture; bool aleadyKaryokuMax = shipModel.IsMaxKaryoku() && powUpInfo.Karyoku == 0; mUIDeckPracticeUpParameters[0].Initialize(shipModel.Karyoku - powUpInfo.Karyoku, shipModel.Karyoku, aleadyKaryokuMax); bool aleadyRaisouMax = shipModel.IsMaxRaisou() && powUpInfo.Raisou == 0; mUIDeckPracticeUpParameters[1].Initialize(shipModel.Raisou - powUpInfo.Raisou, shipModel.Raisou, aleadyRaisouMax); bool aleadyTaikuMax = shipModel.IsMaxTaiku() && powUpInfo.Taiku == 0; mUIDeckPracticeUpParameters[2].Initialize(shipModel.Taiku - powUpInfo.Taiku, shipModel.Taiku, aleadyTaikuMax); bool aleadyKaihiMax = shipModel.IsMaxKaihi() && powUpInfo.Kaihi == 0; mUIDeckPracticeUpParameters[3].Initialize(shipModel.Kaihi - powUpInfo.Kaihi, shipModel.Kaihi, aleadyKaihiMax); bool aleadyLuckyMax = shipModel.IsMaxLucky() && powUpInfo.Lucky == 0; mUIDeckPracticeUpParameters[4].Initialize(shipModel.Lucky - powUpInfo.Lucky, shipModel.Lucky, aleadyLuckyMax); bool aleadyTaisenMax = shipModel.IsMaxTaisen() && powUpInfo.Taisen == 0; mUIDeckPracticeUpParameters[5].Initialize(shipModel.Taisen - powUpInfo.Taisen, shipModel.Taisen, aleadyTaisenMax); yield return(new WaitForEndOfFrame()); ResetPositionParameterSlot(); mUIDeckPracticeShipInfo.Reposition(); ResetPositionShip(); mTexture_Ship.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(shipModel.GetGraphicsMstId(), 9); mTexture_Ship.MakePixelPerfect(); mTexture_Ship.transform.localPosition = Util.Poi2Vec(shipModel.Offsets.GetShipDisplayCenter(shipModel.IsDamaged())); if (prevTexture != null) { yield return(new WaitForEndOfFrame()); Resources.UnloadAsset(prevTexture); } }
private IEnumerator PlayCoroutine() { Stopwatch stopWatch = new Stopwatch(); stopWatch.Reset(); stopWatch.Start(); ShipModel friendFlagShipModel = mFriendDeck.GetFlagShip(); mTexture_FriendFlagShip.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(friendFlagShipModel.GetGraphicsMstId(), (!friendFlagShipModel.IsDamaged())? 9 : 10); mTexture_FriendFlagShip.MakePixelPerfect(); mTexture_FriendFlagShip.transform.localPosition = Util.Poi2Vec(friendFlagShipModel.Offsets.GetFace(friendFlagShipModel.IsDamaged())); ShipModel targetFlagShipModel = mTargetDeck.GetFlagShip(); mTexture_TargetFlagShip.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(targetFlagShipModel.GetGraphicsMstId(), (!targetFlagShipModel.IsDamaged())? 9 : 10); mTexture_TargetFlagShip.MakePixelPerfect(); mTexture_TargetFlagShip.transform.localPosition = Util.Poi2Vec(targetFlagShipModel.Offsets.GetFace(targetFlagShipModel.IsDamaged())); InitializeFriendDeckInShips(mFriendDeck); InitializeTargetDeckInShips(mTargetDeck); yield return(new WaitForEndOfFrame()); stopWatch.Stop(); for (int frame = 0; frame < stopWatch.Elapsed.Milliseconds / 60; frame++) { yield return(new WaitForEndOfFrame()); } yield return(new WaitForEndOfFrame()); mPanelThis.alpha = 1f; mTransform_FriendFlagShipFrame.localPositionY(-1024f); mTransform_TargetFlagShipFrame.localPositionY(1024f); Sequence tweenDeckInShipViewsSequence = DOTween.Sequence().SetId(this); tweenDeckInShipViewsSequence.Join(mTransform_FriendFlagShipFrame.DOLocalMove(mVector3_FriendShipShowPosition, 0.3f).SetId(this)); tweenDeckInShipViewsSequence.Join(mTransform_TargetFlagShipFrame.DOLocalMove(mVector3_TargetShipShowPosition, 0.3f).SetId(this)); int shipCount = (mTargetDeck.Count > mFriendDeck.Count) ? mTargetDeck.Count : mFriendDeck.Count; for (int index = 0; index < shipCount; index++) { Sequence tweenObject = DOTween.Sequence().SetId(this); if (index < mFriendDeck.Count) { mUIPracticeBattleDeckInShips_Friend[index].transform.localPositionX(-500f); tweenObject.Join(mUIPracticeBattleDeckInShips_Friend[index].transform.DOLocalMoveX(0f, 0.5f).SetId(this)); } if (index < mTargetDeck.Count) { mUIPracticeBattleDeckInShips_Enemy[index].transform.localPositionX(500f); tweenObject.Join(mUIPracticeBattleDeckInShips_Enemy[index].transform.DOLocalMoveX(0f, 0.5f).SetId(this)); } tweenObject.SetDelay(0.25f); tweenDeckInShipViewsSequence.Join(tweenObject); } Sequence tweenCrashFlagShipsTween = DOTween.Sequence().SetId(this); Sequence s = tweenCrashFlagShipsTween; Transform target = mTransform_FriendFlagShipFrame; Vector3 localPosition = mTransform_FriendFlagShipFrame.localPosition; s.Join(target.DOLocalMoveX(localPosition.x + 100f, 0.15f).SetLoops(2, LoopType.Yoyo).SetId(this)); Sequence s2 = tweenCrashFlagShipsTween; Transform target2 = mTransform_TargetFlagShipFrame; Vector3 localPosition2 = mTransform_TargetFlagShipFrame.localPosition; s2.Join(target2.DOLocalMoveX(localPosition2.x - 100f, 0.15f).SetLoops(2, LoopType.Yoyo).SetId(this)); float friendHideLocalPositionX = -960 - mTexture_FriendFlagShip.width / 2; float targetHideLocalPositionX = 960 + mTexture_TargetFlagShip.width / 2; Sequence tweenCrashFlagShipOutTween = DOTween.Sequence().SetId(this); tweenCrashFlagShipOutTween.Join(mTransform_FriendFlagShipFrame.DOLocalMoveX(friendHideLocalPositionX, 1f).SetId(this)).SetEase(Ease.InQuart); tweenCrashFlagShipOutTween.Join(mTransform_TargetFlagShipFrame.DOLocalMoveX(targetHideLocalPositionX, 1f).SetId(this)).SetEase(Ease.InQuart); Sequence playAllSequence = DOTween.Sequence().SetId(this); playAllSequence.Append(tweenDeckInShipViewsSequence); playAllSequence.AppendInterval(1f); playAllSequence.Append(tweenCrashFlagShipsTween); playAllSequence.Append(tweenCrashFlagShipOutTween); playAllSequence.OnComplete(delegate { this.OnAnimationFinished(); }); yield return(playAllSequence.WaitForCompletion()); UnityEngine.Debug.Log("ProductionFinished:" + stopWatch.Elapsed.Milliseconds.ToString()); }
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; } }