コード例 #1
0
        private void setShipTexture()
        {
            int num = (_shipModelMst == null) ? 1 : _shipModelMst.GetGraphicsMstId();

            _uiShip.mainTexture = ShipUtils.LoadTexture(num, 9);
            _uiShip.MakePixelPerfect();
            _uiShip.transform.localPosition = Util.Poi2Vec(new ShipOffset(num).GetFace(damaged: false));
        }
コード例 #2
0
        private void ShipSlide()
        {
            Vector3 vector = Util.Poi2Vec(new ShipOffset(mTargetShipModelMst.GetGraphicsMstId()).GetSlotItemCategory(_isDamaged));

            mTexture_Ship.transform.localPosition = new Vector3(vector.x - 270f + 44f, vector.y + 29f, 0f);
            mTexture_Ship.alpha += Mathf.Min(3f * Time.deltaTime, 1f - mTexture_Ship.alpha);
        }
コード例 #3
0
        private void UpdateShipTexture()
        {
            int texNum = (!isDamaged) ? 9 : 10;

            uiBattleShip.object3D.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(_clsCurrentShipMst.GetGraphicsMstId(), texNum);

            uiBattleShip.object3D.MakePixelPerfect();
        }
コード例 #4
0
 public void Initialize(ShipModelMst targetShipModel, KeyControl kCtrl, OnFinish func = null)
 {
     on                  = true;
     startTime           = Time.time;
     Callback            = func;
     mTargetShipModelMst = targetShipModel;
     ch.mainTexture      = ShipUtils.LoadTexture(mTargetShipModelMst.GetGraphicsMstId(), 9 + Convert.ToInt32(value: false));
     ch.MakePixelPerfect();
     mKeyController = kCtrl;
 }
コード例 #5
0
 public void ChangeCharacter(ShipModelMst model, int DeckID, bool isDamaged)
 {
     if (CheckMstIDEnable(model))
     {
         if (tweenPosition != null)
         {
             tweenPosition.enabled = false;
         }
         int graphicsMstId = model.GetGraphicsMstId();
         if (DeckID == -1)
         {
             Render.mainTexture = SingletonMonoBehaviour <Live2DModel> .Instance.ChangeCharacter(graphicsMstId, isDamaged);
         }
         else
         {
             Render.mainTexture = SingletonMonoBehaviour <Live2DModel> .Instance.ChangeCharacter(graphicsMstId, isDamaged, DeckID);
         }
         Point live2dBias  = model.Offsets.GetLive2dBias();
         float x           = live2dBias.x;
         Point live2dBias2 = model.Offsets.GetLive2dBias();
         L2dBias = new Vector3(x, live2dBias2.y, 0f);
         Point boko  = model.Offsets.GetBoko(isDamaged);
         float x2    = boko.x;
         Point boko2 = model.Offsets.GetBoko(isDamaged);
         ShipIn = new Vector3(x2, boko2.y, 0f);
         Point cutinSp1_InBattle = model.Offsets.GetCutinSp1_InBattle(isDamaged);
         float x3 = cutinSp1_InBattle.x;
         Point cutinSp1_InBattle2 = model.Offsets.GetCutinSp1_InBattle(isDamaged);
         ShipIn2 = new Vector3(x3, cutinSp1_InBattle2.y, 0f);
         Point boko3 = model.Offsets.GetBoko(isDamaged);
         ShipOut = new Vector3(1300f, boko3.y, 0f);
         if (SingletonMonoBehaviour <Live2DModel> .Instance.isLive2DModel)
         {
             UITexture render     = Render;
             Point     live2dSize = model.Offsets.GetLive2dSize();
             render.width = (int)((float)live2dSize.x * 1380f / 1024f);
             UITexture render2     = Render;
             Point     live2dSize2 = model.Offsets.GetLive2dSize();
             render2.height = live2dSize2.y;
             Transform transform   = base.transform;
             Point     boko4       = model.Offsets.GetBoko(isDamaged);
             int       y           = boko4.y;
             Point     live2dBias3 = model.Offsets.GetLive2dBias();
             transform.localPositionY(y + live2dBias3.y);
         }
         else
         {
             L2dBias = Vector3.zero;
             Transform transform2 = base.transform;
             Point     boko5      = model.Offsets.GetBoko(isDamaged);
             transform2.localPositionY(boko5.y);
             Render.MakePixelPerfect();
         }
     }
 }
コード例 #6
0
        public void DebugChange(int direction)
        {
            ShipModelMst shipModelMst = null;
            int          i            = 0;

            while (i < 200)
            {
                this.DebugMstID = (int)Util.RangeValue(this.DebugMstID + direction, 1f, 500f);
                try
                {
                    shipModelMst = new ShipModelMst(this.DebugMstID);
                    int buildStep = shipModelMst.BuildStep;
                }
                catch (KeyNotFoundException var_3_44)
                {
                    goto IL_65;
                }
                goto IL_4F;
IL_65:
                i++;
                continue;
IL_4F:
                if (shipModelMst != null && shipModelMst.MstId != 0)
                {
                    break;
                }
                goto IL_65;
            }
            this.GraphicID = shipModelMst.GetGraphicsMstId();
            base.ChangeCharacter(shipModelMst, -1, false);
            base.get_transform().localPositionX(this.ShipIn.x + this.L2dBias.x);
            if (shipModelMst == null)
            {
                this.DebugMstID = 0;
            }
            if (this.HeadArea != null && this.shipModel != null)
            {
                this.HeadArea.get_transform().localPositionX((float)this.shipModel.Offsets.GetFace(false).x - this.L2dBias.x);
                this.HeadArea.get_transform().localPositionY((float)(-(float)this.shipModel.Offsets.GetFace(false).y) - this.L2dBias.y);
                this.HeadArea.depth = 15;
            }
        }
コード例 #7
0
        public void DebugChange(int direction)
        {
            ShipModelMst shipModelMst = null;

            for (int i = 0; i < 200; i++)
            {
                DebugMstID = (int)Util.RangeValue(DebugMstID + direction, 1f, 500f);
                try
                {
                    shipModelMst = new ShipModelMst(DebugMstID);
                    int buildStep = shipModelMst.BuildStep;
                }
                catch (KeyNotFoundException)
                {
                    continue;
                }
                if (shipModelMst != null && shipModelMst.MstId != 0)
                {
                    break;
                }
            }
            GraphicID = shipModelMst.GetGraphicsMstId();
            ChangeCharacter(shipModelMst, -1, isDamaged: false);
            base.transform.localPositionX(ShipIn.x + L2dBias.x);
            if (shipModelMst == null)
            {
                DebugMstID = 0;
            }
            if (HeadArea != null && shipModel != null)
            {
                Transform transform = HeadArea.transform;
                Point     face      = shipModel.Offsets.GetFace(damaged: false);
                transform.localPositionX((float)face.x - L2dBias.x);
                Transform transform2 = HeadArea.transform;
                Point     face2      = shipModel.Offsets.GetFace(damaged: false);
                transform2.localPositionY((float)(-face2.y) - L2dBias.y);
                HeadArea.depth = 15;
            }
        }
コード例 #8
0
        public void ChangeCharacter(ShipModelMst model, int DeckID, bool isDamaged)
        {
            if (!this.CheckMstIDEnable(model))
            {
                return;
            }
            if (this.tweenPosition != null)
            {
                this.tweenPosition.set_enabled(false);
            }
            int graphicsMstId = model.GetGraphicsMstId();

            if (DeckID == -1)
            {
                this.Render.mainTexture = SingletonMonoBehaviour <Live2DModel> .Instance.ChangeCharacter(graphicsMstId, isDamaged);
            }
            else
            {
                this.Render.mainTexture = SingletonMonoBehaviour <Live2DModel> .Instance.ChangeCharacter(graphicsMstId, isDamaged, DeckID);
            }
            this.L2dBias = new Vector3((float)model.Offsets.GetLive2dBias().x, (float)model.Offsets.GetLive2dBias().y, 0f);
            this.ShipIn  = new Vector3((float)model.Offsets.GetBoko(isDamaged).x, (float)model.Offsets.GetBoko(isDamaged).y, 0f);
            this.ShipIn2 = new Vector3((float)model.Offsets.GetCutinSp1_InBattle(isDamaged).x, (float)model.Offsets.GetCutinSp1_InBattle(isDamaged).y, 0f);
            this.ShipOut = new Vector3(1300f, (float)model.Offsets.GetBoko(isDamaged).y, 0f);
            if (SingletonMonoBehaviour <Live2DModel> .Instance.isLive2DModel)
            {
                this.Render.width  = (int)((float)model.Offsets.GetLive2dSize().x * 1380f / 1024f);
                this.Render.height = model.Offsets.GetLive2dSize().y;
                base.get_transform().localPositionY((float)(model.Offsets.GetBoko(isDamaged).y + model.Offsets.GetLive2dBias().y));
            }
            else
            {
                this.L2dBias = Vector3.get_zero();
                base.get_transform().localPositionY((float)model.Offsets.GetBoko(isDamaged).y);
                this.Render.MakePixelPerfect();
            }
        }
コード例 #9
0
        public void Initialize(ShipModelMst targetShipMst, int bgID, int bg2ID, int startDepth)
        {
            mTargetShipModelMst = targetShipMst;
            Vector3 localPosition = Util.Poi2Vec(mTargetShipModelMst.Offsets.GetShipDisplayCenter(damaged: false));

            ship.transform.localPosition = localPosition;
            on    = true;
            timer = Time.time;
            ship.GetComponent <UITexture>().mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(mTargetShipModelMst.GetGraphicsMstId(), 9);

            ship.GetComponent <UITexture>().MakePixelPerfect();
            card.GetComponent <UITexture>().mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(mTargetShipModelMst.MstId, 3);

            switch (bgID)
            {
            case 0:
                bg.mainTexture = (Resources.Load("Textures/ConvertShip/getBG_common_1") as Texture);
                break;

            case 1:
                bg.mainTexture = (Resources.Load("Textures/ConvertShip/getBG_common_2") as Texture);
                break;

            case 2:
                bg.mainTexture = (Resources.Load("Textures/ConvertShip/getBG_common_3") as Texture);
                break;

            case 3:
                bg.mainTexture = (Resources.Load("Textures/ConvertShip/getBG_rare_1") as Texture);
                break;

            case 4:
                bg.mainTexture = (Resources.Load("Textures/ConvertShip/getBG_rare_2") as Texture);
                break;

            case 5:
                bg.mainTexture = (Resources.Load("Textures/ConvertShip/getBG_horo_1") as Texture);
                break;
            }
            if (bg.mainTexture == null)
            {
                Debug.Log("Failed to load texture for ./BG/BG");
            }
            switch (bg2ID)
            {
            case 0:
                bg2.mainTexture = (Resources.Load("Textures/ConvertShip/getBG_common_1") as Texture);
                break;

            case 1:
                bg2.mainTexture = (Resources.Load("Textures/ConvertShip/getBG_common_2") as Texture);
                break;

            case 2:
                bg2.mainTexture = (Resources.Load("Textures/ConvertShip/getBG_common_3") as Texture);
                break;

            case 3:
                bg2.mainTexture = (Resources.Load("Textures/ConvertShip/getBG_rare_1") as Texture);
                break;

            case 4:
                bg2.mainTexture = (Resources.Load("Textures/ConvertShip/getBG_rare_2") as Texture);
                break;

            case 5:
                bg2.mainTexture = (Resources.Load("Textures/ConvertShip/getBG_horo_1") as Texture);
                break;
            }
            StartCoroutine(EnableAlphas());
            StartCoroutine(StripeDisable());
            StartCoroutine(SnowflakeExplosion());
            StartCoroutine(CardToFront());
            StartCoroutine(EnableButton());
            ((Component)base.transform.Find("BG")).GetComponent <UIPanel>().depth   = startDepth;
            ((Component)base.transform.Find("BG2")).GetComponent <UIPanel>().depth  = startDepth + 1;
            ((Component)base.transform.Find("Main")).GetComponent <UIPanel>().depth = startDepth + 2;
        }
コード例 #10
0
 public void Initialize(ShipModelMst targetShipModelMst, int bgID, bool fail, bool SuperSuccessed, int sozai_count, bool isDamaged)
 {
     this.fail           = fail;
     mTargetShipModelMst = targetShipModelMst;
     _isDamaged          = isDamaged;
     _isSuperSucessed    = SuperSuccessed;
     on    = true;
     timer = Time.time;
     if (isDamaged)
     {
         mTexture_Ship.GetComponent <UITexture>().mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(mTargetShipModelMst.GetGraphicsMstId(), 10);
     }
     else
     {
         mTexture_Ship.GetComponent <UITexture>().mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.ShipTexture.Load(mTargetShipModelMst.GetGraphicsMstId(), 9);
     }
     mTexture_Ship.GetComponent <UITexture>().MakePixelPerfect();
     elmts = new bool[5, 4]
     {
         {
             true,
             true,
             true,
             true
         },
         {
             true,
             true,
             true,
             true
         },
         {
             true,
             true,
             true,
             true
         },
         {
             true,
             true,
             true,
             true
         },
         {
             true,
             true,
             true,
             true
         }
     };
     cnt = sozai_count;
     StartCoroutine(EnableAlphas());
     StartCoroutine(SpawnSpirits());
     if (fail)
     {
         StartCoroutine(EnableButton());
         StartCoroutine(SwapActive());
         StartCoroutine(LeafBlow());
         StartCoroutine(Text());
     }
     else
     {
         StartCoroutine(SpawnSparkle());
         StartCoroutine(EnableButton());
     }
 }
コード例 #11
0
 private void DrawCurrentInfo()
 {
     try
     {
         _clsCurrentShipMst = new ShipModelMst(shipID);
         GUILayout.Label($"[{_clsCurrentShipMst.Name}({_clsCurrentShipMst.Yomi})]艦ID:{_clsCurrentShipMst.MstId} GraphicID:{_clsCurrentShipMst.GetGraphicsMstId()}", new GUILayoutOption[0]);
     }
     catch
     {
     }
 }