Commit b15c84b7 authored by 神楽坂玲奈's avatar 神楽坂玲奈

deck

parent 62b29ea9
using UnityEngine;
public static class Utils
{
public static int UIHeight()
{
return Program.I().ui_back_ground_2d.GetComponent<UIRoot>().activeHeight;
}
public static int UIWidth()
{
return UIHeight() * Screen.width / Screen.height;
}
public static Vector3 UIToWorldPoint(Vector3 point)
{
return Program.I().camera_back_ground_2d
.ViewportToWorldPoint(new Vector3(point.x / UIWidth(), point.y / UIHeight(), point.z));
}
// public static float UIScale()
// {
// return Program.I().ui_back_ground_2d.GetComponent<UIRoot>().activeScaling;
// }
}
\ No newline at end of file
fileFormatVersion: 2
guid: b73ea0399398c89459a9821cbfc4ffc7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using DG.Tweening;
using UnityEngine; using UnityEngine;
using YGOSharp; using YGOSharp;
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
...@@ -127,8 +128,8 @@ public class CardDescription : Servant ...@@ -127,8 +128,8 @@ public class CardDescription : Servant
if (gameObject != null) if (gameObject != null)
{ {
underSprite.height = Utils.UIHeight() + 4; underSprite.height = Utils.UIHeight() + 4;
iTween.MoveTo(gameObject, gameObject.transform.DOMove(
Program.I().camera_main_2d.ScreenToWorldPoint(new Vector3(-underSprite.width - 20, Utils.UIToWorldPoint(new Vector3(-underSprite.width - 20,
(float) Utils.UIHeight() / 2, 0)), (float) Utils.UIHeight() / 2, 0)),
1.2f); 1.2f);
setTitle(""); setTitle("");
...@@ -141,9 +142,7 @@ public class CardDescription : Servant ...@@ -141,9 +142,7 @@ public class CardDescription : Servant
if (gameObject != null) if (gameObject != null)
{ {
underSprite.height = Utils.UIHeight() + 4; underSprite.height = Utils.UIHeight() + 4;
iTween.MoveTo(gameObject, gameObject.transform.DOMove(Utils.UIToWorldPoint(new Vector3(-2, (float) Utils.UIHeight() / 2, 0)), 1.2f);
Program.I().camera_main_2d.ScreenToWorldPoint(new Vector3(-2, (float) Utils.UIHeight() / 2, 0)),
1.2f);
resizer.gameObject.GetComponent<BoxCollider>().enabled = true; resizer.gameObject.GetComponent<BoxCollider>().enabled = true;
} }
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text; using System.Text;
using DG.Tweening;
using UnityEngine; using UnityEngine;
using YGOSharp; using YGOSharp;
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
...@@ -817,8 +818,9 @@ public class DeckManager : ServantWithCardDescription ...@@ -817,8 +818,9 @@ public class DeckManager : ServantWithCardDescription
{ {
base.applyHideArrangement(); base.applyHideArrangement();
Program.cameraFacing = false; Program.cameraFacing = false;
iTween.MoveTo(gameObjectSearch, gameObjectSearch.transform.DOMove(
Program.I().camera_main_2d.ScreenToWorldPoint(new Vector3(Screen.width + 600, Screen.height / 2, 600)), 1.2f); Utils.UIToWorldPoint(new Vector3(Utils.UIWidth() + 600, (float) Utils.UIHeight() / 2, 600)),
1.2f);
refreshDetail(); refreshDetail();
} }
...@@ -827,9 +829,9 @@ public class DeckManager : ServantWithCardDescription ...@@ -827,9 +829,9 @@ public class DeckManager : ServantWithCardDescription
base.applyShowArrangement(); base.applyShowArrangement();
Program.cameraFacing = true; Program.cameraFacing = true;
var tex = UIHelper.getByName<UITexture>(gameObjectSearch, "under_"); var tex = UIHelper.getByName<UITexture>(gameObjectSearch, "under_");
tex.height = Screen.height; tex.height = Utils.UIHeight();
iTween.MoveTo(gameObjectSearch, gameObjectSearch.transform.DOMove(
Program.I().camera_main_2d.ScreenToWorldPoint(new Vector3(Screen.width - tex.width / 2, Screen.height / 2, 0)), Utils.UIToWorldPoint(new Vector3(Utils.UIWidth() - tex.width / 2, (float) Utils.UIHeight() / 2, 600)),
1.2f); 1.2f);
refreshDetail(); refreshDetail();
} }
...@@ -1040,49 +1042,49 @@ public class DeckManager : ServantWithCardDescription ...@@ -1040,49 +1042,49 @@ public class DeckManager : ServantWithCardDescription
{ {
if (isShowed) if (isShowed)
{ {
if (Screen.height < 700) // if (Screen.height < 700)
// {
// gameObjectDetailedSearch.transform.localScale = new Vector3(Screen.height / 700f,
// Screen.height / 700f, Screen.height / 700f);
// if (detailShowed)
// {
// gameObjectDetailedSearch.GetComponent<UITexture>().height = 700;
// iTween.MoveTo(gameObjectDetailedSearch,
// Program.I().camera_main_2d.ScreenToWorldPoint(
// new Vector3(Screen.width - 230 - 115f * Screen.height / 700f, Screen.height * 0.5f, 0)),
// 0.6f);
// reShowBar(0, 230 + 230 * Screen.height / 700f);
// }
// else
// {
// gameObjectDetailedSearch.GetComponent<UITexture>().height = 700;
// iTween.MoveTo(gameObjectDetailedSearch,
// Program.I().camera_main_2d.ScreenToWorldPoint(
// new Vector3(Screen.width - 230 - 115f * Screen.height / 700f, Screen.height * 1.5f, 0)),
// 0.6f);
// reShowBar(0, 230);
// }
// }
// else
// {
gameObjectDetailedSearch.transform.localScale = Vector3.one;
if (detailShowed)
{ {
gameObjectDetailedSearch.transform.localScale = new Vector3(Screen.height / 700f, gameObjectDetailedSearch.GetComponent<UITexture>().height = Utils.UIHeight();
Screen.height / 700f, Screen.height / 700f); gameObjectDetailedSearch.transform.DOMove(
if (detailShowed) Utils.UIToWorldPoint(new Vector3(Utils.UIWidth() - 345f,
{ Utils.UIHeight() * 0.5f, 0)), 0.6f);
gameObjectDetailedSearch.GetComponent<UITexture>().height = 700; reShowBar(0, 460);
iTween.MoveTo(gameObjectDetailedSearch,
Program.I().camera_main_2d.ScreenToWorldPoint(
new Vector3(Screen.width - 230 - 115f * Screen.height / 700f, Screen.height * 0.5f, 0)),
0.6f);
reShowBar(0, 230 + 230 * Screen.height / 700f);
}
else
{
gameObjectDetailedSearch.GetComponent<UITexture>().height = 700;
iTween.MoveTo(gameObjectDetailedSearch,
Program.I().camera_main_2d.ScreenToWorldPoint(
new Vector3(Screen.width - 230 - 115f * Screen.height / 700f, Screen.height * 1.5f, 0)),
0.6f);
reShowBar(0, 230);
}
} }
else else
{ {
gameObjectDetailedSearch.transform.localScale = Vector3.one; gameObjectDetailedSearch.GetComponent<UITexture>().height = Utils.UIHeight();
if (detailShowed) gameObjectDetailedSearch.transform.DOMove(
{ Utils.UIToWorldPoint(new Vector3(Utils.UIWidth() - 345f,
gameObjectDetailedSearch.GetComponent<UITexture>().height = Screen.height; Utils.UIHeight() * 1.5f, 0)), 0.6f);
iTween.MoveTo(gameObjectDetailedSearch, reShowBar(0, 230);
Program.I().camera_main_2d.ScreenToWorldPoint(new Vector3(Screen.width - 345f,
Screen.height * 0.5f, 0)), 0.6f);
reShowBar(0, 460);
}
else
{
gameObjectDetailedSearch.GetComponent<UITexture>().height = Screen.height;
iTween.MoveTo(gameObjectDetailedSearch,
Program.I().camera_main_2d.ScreenToWorldPoint(new Vector3(Screen.width - 345f,
Screen.height * 1.5f, 0)), 0.6f);
reShowBar(0, 230);
}
} }
// }
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment