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.Collections.Generic;
using DG.Tweening;
using UnityEngine;
using YGOSharp;
using YGOSharp.OCGWrapper.Enums;
......@@ -127,8 +128,8 @@ public class CardDescription : Servant
if (gameObject != null)
{
underSprite.height = Utils.UIHeight() + 4;
iTween.MoveTo(gameObject,
Program.I().camera_main_2d.ScreenToWorldPoint(new Vector3(-underSprite.width - 20,
gameObject.transform.DOMove(
Utils.UIToWorldPoint(new Vector3(-underSprite.width - 20,
(float) Utils.UIHeight() / 2, 0)),
1.2f);
setTitle("");
......@@ -141,9 +142,7 @@ public class CardDescription : Servant
if (gameObject != null)
{
underSprite.height = Utils.UIHeight() + 4;
iTween.MoveTo(gameObject,
Program.I().camera_main_2d.ScreenToWorldPoint(new Vector3(-2, (float) Utils.UIHeight() / 2, 0)),
1.2f);
gameObject.transform.DOMove(Utils.UIToWorldPoint(new Vector3(-2, (float) Utils.UIHeight() / 2, 0)), 1.2f);
resizer.gameObject.GetComponent<BoxCollider>().enabled = true;
}
}
......
......@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Text;
using DG.Tweening;
using UnityEngine;
using YGOSharp;
using YGOSharp.OCGWrapper.Enums;
......@@ -817,8 +818,9 @@ public class DeckManager : ServantWithCardDescription
{
base.applyHideArrangement();
Program.cameraFacing = false;
iTween.MoveTo(gameObjectSearch,
Program.I().camera_main_2d.ScreenToWorldPoint(new Vector3(Screen.width + 600, Screen.height / 2, 600)), 1.2f);
gameObjectSearch.transform.DOMove(
Utils.UIToWorldPoint(new Vector3(Utils.UIWidth() + 600, (float) Utils.UIHeight() / 2, 600)),
1.2f);
refreshDetail();
}
......@@ -827,9 +829,9 @@ public class DeckManager : ServantWithCardDescription
base.applyShowArrangement();
Program.cameraFacing = true;
var tex = UIHelper.getByName<UITexture>(gameObjectSearch, "under_");
tex.height = Screen.height;
iTween.MoveTo(gameObjectSearch,
Program.I().camera_main_2d.ScreenToWorldPoint(new Vector3(Screen.width - tex.width / 2, Screen.height / 2, 0)),
tex.height = Utils.UIHeight();
gameObjectSearch.transform.DOMove(
Utils.UIToWorldPoint(new Vector3(Utils.UIWidth() - tex.width / 2, (float) Utils.UIHeight() / 2, 600)),
1.2f);
refreshDetail();
}
......@@ -1040,49 +1042,49 @@ public class DeckManager : ServantWithCardDescription
{
if (isShowed)
{
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
{
// 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.GetComponent<UITexture>().height = Screen.height;
iTween.MoveTo(gameObjectDetailedSearch,
Program.I().camera_main_2d.ScreenToWorldPoint(new Vector3(Screen.width - 345f,
Screen.height * 0.5f, 0)), 0.6f);
gameObjectDetailedSearch.GetComponent<UITexture>().height = Utils.UIHeight();
gameObjectDetailedSearch.transform.DOMove(
Utils.UIToWorldPoint(new Vector3(Utils.UIWidth() - 345f,
Utils.UIHeight() * 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);
gameObjectDetailedSearch.GetComponent<UITexture>().height = Utils.UIHeight();
gameObjectDetailedSearch.transform.DOMove(
Utils.UIToWorldPoint(new Vector3(Utils.UIWidth() - 345f,
Utils.UIHeight() * 1.5f, 0)), 0.6f);
reShowBar(0, 230);
}
}
// }
}
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