Commit 8632f1b2 authored by nanahira's avatar nanahira

Merge branch 'master' of git.mycard.moe:mycard/YGOProUnity_V2

parents 0b3824f0 58053191
Pipeline #5283 failed with stages
in 10 minutes and 31 seconds
...@@ -320,31 +320,31 @@ public class UIScrollView : MonoBehaviour ...@@ -320,31 +320,31 @@ public class UIScrollView : MonoBehaviour
mPanel.clipping = UIDrawCall.Clipping.ConstrainButDontClip; mPanel.clipping = UIDrawCall.Clipping.ConstrainButDontClip;
// Auto-upgrade // Auto-upgrade
if (movement != Movement.Custom && scale.sqrMagnitude > 0.001f) // if (movement != Movement.Custom && scale.sqrMagnitude > 0.001f)
{ // {
if (scale.x == 1f && scale.y == 0f) // if (scale.x == 1f && scale.y == 0f)
{ // {
movement = Movement.Horizontal; // movement = Movement.Horizontal;
} // }
else if (scale.x == 0f && scale.y == 1f) // else if (scale.x == 0f && scale.y == 1f)
{ // {
movement = Movement.Vertical; // movement = Movement.Vertical;
} // }
else if (scale.x == 1f && scale.y == 1f) // else if (scale.x == 1f && scale.y == 1f)
{ // {
movement = Movement.Unrestricted; // movement = Movement.Unrestricted;
} // }
else // else
{ // {
movement = Movement.Custom; // movement = Movement.Custom;
customMovement.x = scale.x; // customMovement.x = scale.x;
customMovement.y = scale.y; // customMovement.y = scale.y;
} // }
scale = Vector3.zero; // scale = Vector3.zero;
#if UNITY_EDITOR // #if UNITY_EDITOR
NGUITools.SetDirty(this); // NGUITools.SetDirty(this);
#endif // #endif
} // }
// Auto-upgrade // Auto-upgrade
if (contentPivot == UIWidget.Pivot.TopLeft && relativePositionOnReset != Vector2.zero) if (contentPivot == UIWidget.Pivot.TopLeft && relativePositionOnReset != Vector2.zero)
......
...@@ -6,6 +6,12 @@ public class BackgroundLoader : MonoBehaviour ...@@ -6,6 +6,12 @@ public class BackgroundLoader : MonoBehaviour
{ {
private void Awake() private void Awake()
{ {
if (File.Exists("texture/common/desk.jpg"))
{
gameObject.SetActive(false);
return;
}
var player = GetComponent<VideoPlayer>(); var player = GetComponent<VideoPlayer>();
player.url = Path.Combine(Directory.GetCurrentDirectory(), player.url); player.url = Path.Combine(Directory.GetCurrentDirectory(), player.url);
player.Play(); player.Play();
......
fileFormatVersion: 2
guid: 02562de1ff370374c848316954f52829
folderAsset: yes
timeCreated: 1471827270
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
using System.IO;
using UnityEngine;
public class BackGroundPic : Servant
{
private GameObject backGround;
public override void initialize()
{
backGround = Program.I().mod_simple_ngui_background_texture;
if (!File.Exists("texture/common/desk.jpg"))
{
backGround.SetActive(false);
return;
}
var file = new FileStream("texture/common/desk.jpg", FileMode.Open, FileAccess.Read);
file.Seek(0, SeekOrigin.Begin);
var data = new byte[file.Length];
file.Read(data, 0, (int) file.Length);
file.Close();
file.Dispose();
file = null;
var pic = new Texture2D(1920, 1080);
pic.LoadImage(data);
backGround.GetComponent<UITexture>().mainTexture = pic;
backGround.GetComponent<UITexture>().depth = -100;
}
public override void applyShowArrangement()
{
if (!backGround.activeInHierarchy) return;
var component = backGround.GetComponent<UITexture>();
var texture = component.mainTexture;
if (texture.width <= texture.height * Screen.width / Screen.height)
{
// 图窄屏幕宽,用宽度
component.width = Utils.UIWidth() + 2;
component.height = component.width * texture.height / texture.width;
}
else
{
// 图宽屏幕窄,用高度
component.height = Utils.UIHeight() + 2;
component.width = component.height * texture.width / texture.height;
}
}
public override void applyHideArrangement()
{
applyShowArrangement();
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 514965db09cb19c4d90f70d82be4ec00
timeCreated: 1471827484
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
...@@ -30,6 +30,7 @@ public class Program : MonoBehaviour ...@@ -30,6 +30,7 @@ public class Program : MonoBehaviour
[Header("ui_back_ground_2d")] [Header("ui_back_ground_2d")]
public Camera camera_back_ground_2d; public Camera camera_back_ground_2d;
public GameObject mod_simple_ngui_background_texture;
public GameObject new_ui_cardDescription; public GameObject new_ui_cardDescription;
public GameObject new_ui_search; public GameObject new_ui_search;
public gameInfo new_ui_gameInfo; public gameInfo new_ui_gameInfo;
...@@ -290,6 +291,9 @@ public class Program : MonoBehaviour ...@@ -290,6 +291,9 @@ public class Program : MonoBehaviour
UIHelper.iniFaces(); UIHelper.iniFaces();
initializeALLcameras(); initializeALLcameras();
fixALLcamerasPreFrame(); fixALLcamerasPreFrame();
backGroundPic = new BackGroundPic();
servants.Add(backGroundPic);
backGroundPic.fixScreenProblem();
// }); // });
// go(300, () => // go(300, () =>
// { // {
...@@ -715,6 +719,7 @@ public class Program : MonoBehaviour ...@@ -715,6 +719,7 @@ public class Program : MonoBehaviour
private readonly List<Servant> servants = new List<Servant>(); private readonly List<Servant> servants = new List<Servant>();
public Servant backGroundPic;
public Menu menu; public Menu menu;
public Setting setting; public Setting setting;
public selectDeck selectDeck; public selectDeck selectDeck;
...@@ -757,6 +762,7 @@ public class Program : MonoBehaviour ...@@ -757,6 +762,7 @@ public class Program : MonoBehaviour
public void shiftToServant(Servant to) public void shiftToServant(Servant to)
{ {
if (to != backGroundPic && backGroundPic.isShowed) backGroundPic.hide();
if (to != menu && menu.isShowed) menu.hide(); if (to != menu && menu.isShowed) menu.hide();
if (to != setting && setting.isShowed) setting.hide(); if (to != setting && setting.isShowed) setting.hide();
if (to != selectDeck && selectDeck.isShowed) selectDeck.hide(); if (to != selectDeck && selectDeck.isShowed) selectDeck.hide();
...@@ -768,6 +774,7 @@ public class Program : MonoBehaviour ...@@ -768,6 +774,7 @@ public class Program : MonoBehaviour
if (to != puzzleMode && puzzleMode.isShowed) puzzleMode.hide(); if (to != puzzleMode && puzzleMode.isShowed) puzzleMode.hide();
if (to != aiRoom && aiRoom.isShowed) aiRoom.hide(); if (to != aiRoom && aiRoom.isShowed) aiRoom.hide();
if (to == backGroundPic && backGroundPic.isShowed == false) backGroundPic.show();
if (to == menu && menu.isShowed == false) menu.show(); if (to == menu && menu.isShowed == false) menu.show();
if (to == setting && setting.isShowed == false) setting.show(); if (to == setting && setting.isShowed == false) setting.show();
if (to == selectDeck && selectDeck.isShowed == false) selectDeck.show(); if (to == selectDeck && selectDeck.isShowed == false) selectDeck.show();
...@@ -904,6 +911,7 @@ public class Program : MonoBehaviour ...@@ -904,6 +911,7 @@ public class Program : MonoBehaviour
private void gameStart() private void gameStart()
{ {
if (UIHelper.shouldMaximize()) UIHelper.MaximizeWindow(); if (UIHelper.shouldMaximize()) UIHelper.MaximizeWindow();
backGroundPic.show();
shiftToServant(menu); shiftToServant(menu);
} }
......
...@@ -217,7 +217,7 @@ PrefabInstance: ...@@ -217,7 +217,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 407516, guid: 0f5784805788a664da2c92f42ec39685, type: 3} - target: {fileID: 407516, guid: 0f5784805788a664da2c92f42ec39685, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 3 value: 4
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 407516, guid: 0f5784805788a664da2c92f42ec39685, type: 3} - target: {fileID: 407516, guid: 0f5784805788a664da2c92f42ec39685, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
...@@ -849,7 +849,7 @@ PrefabInstance: ...@@ -849,7 +849,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 433886, guid: dd57848b7cec7c441b1e5e16bfaf237f, type: 3} - target: {fileID: 433886, guid: dd57848b7cec7c441b1e5e16bfaf237f, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 1 value: 2
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 433886, guid: dd57848b7cec7c441b1e5e16bfaf237f, type: 3} - target: {fileID: 433886, guid: dd57848b7cec7c441b1e5e16bfaf237f, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
...@@ -944,7 +944,7 @@ PrefabInstance: ...@@ -944,7 +944,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 468652, guid: 589b9f7f12556814fb7cc2371ef35649, type: 3} - target: {fileID: 468652, guid: 589b9f7f12556814fb7cc2371ef35649, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 2 value: 3
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 468652, guid: 589b9f7f12556814fb7cc2371ef35649, type: 3} - target: {fileID: 468652, guid: 589b9f7f12556814fb7cc2371ef35649, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
...@@ -1194,6 +1194,12 @@ Camera: ...@@ -1194,6 +1194,12 @@ Camera:
type: 3} type: 3}
m_PrefabInstance: {fileID: 863808012} m_PrefabInstance: {fileID: 863808012}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &865207707 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 197510, guid: 4bcf544bc00b6e84daf5bf79d2238069,
type: 3}
m_PrefabInstance: {fileID: 1852062175}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &923674925 --- !u!1001 &923674925
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -1611,7 +1617,7 @@ PrefabInstance: ...@@ -1611,7 +1617,7 @@ PrefabInstance:
- target: {fileID: 11419100, guid: 995e2fa1a1156d248955c5fb98502585, type: 3} - target: {fileID: 11419100, guid: 995e2fa1a1156d248955c5fb98502585, type: 3}
propertyPath: mod_simple_ngui_background_texture propertyPath: mod_simple_ngui_background_texture
value: value:
objectReference: {fileID: 0} objectReference: {fileID: 865207707}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 995e2fa1a1156d248955c5fb98502585, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 995e2fa1a1156d248955c5fb98502585, type: 3}
--- !u!1 &1283106570 stripped --- !u!1 &1283106570 stripped
...@@ -1903,6 +1909,67 @@ PrefabInstance: ...@@ -1903,6 +1909,67 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0ba65c521a7de0d46a9e31380654c3b4, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 0ba65c521a7de0d46a9e31380654c3b4, type: 3}
--- !u!1001 &1852062175
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 737802523}
m_Modifications:
- target: {fileID: 197510, guid: 4bcf544bc00b6e84daf5bf79d2238069, type: 3}
propertyPath: m_Name
value: mod_background_texture
objectReference: {fileID: 0}
- target: {fileID: 197510, guid: 4bcf544bc00b6e84daf5bf79d2238069, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 410492, guid: 4bcf544bc00b6e84daf5bf79d2238069, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 410492, guid: 4bcf544bc00b6e84daf5bf79d2238069, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 410492, guid: 4bcf544bc00b6e84daf5bf79d2238069, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 410492, guid: 4bcf544bc00b6e84daf5bf79d2238069, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 410492, guid: 4bcf544bc00b6e84daf5bf79d2238069, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 410492, guid: 4bcf544bc00b6e84daf5bf79d2238069, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 410492, guid: 4bcf544bc00b6e84daf5bf79d2238069, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 410492, guid: 4bcf544bc00b6e84daf5bf79d2238069, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 410492, guid: 4bcf544bc00b6e84daf5bf79d2238069, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 410492, guid: 4bcf544bc00b6e84daf5bf79d2238069, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 410492, guid: 4bcf544bc00b6e84daf5bf79d2238069, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 4bcf544bc00b6e84daf5bf79d2238069, type: 3}
--- !u!1001 &1891339901 --- !u!1001 &1891339901
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -2060,15 +2127,15 @@ PrefabInstance: ...@@ -2060,15 +2127,15 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 455926, guid: 110e0a191727d5f4f8860ae0957652dd, type: 3} - target: {fileID: 455926, guid: 110e0a191727d5f4f8860ae0957652dd, type: 3}
propertyPath: m_LocalScale.x propertyPath: m_LocalScale.x
value: 0.0028571428 value: 0.0027359782
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 455926, guid: 110e0a191727d5f4f8860ae0957652dd, type: 3} - target: {fileID: 455926, guid: 110e0a191727d5f4f8860ae0957652dd, type: 3}
propertyPath: m_LocalScale.y propertyPath: m_LocalScale.y
value: 0.0028571428 value: 0.0027359782
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 455926, guid: 110e0a191727d5f4f8860ae0957652dd, type: 3} - target: {fileID: 455926, guid: 110e0a191727d5f4f8860ae0957652dd, type: 3}
propertyPath: m_LocalScale.z propertyPath: m_LocalScale.z
value: 0.0028571428 value: 0.0027359782
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 455926, guid: 110e0a191727d5f4f8860ae0957652dd, type: 3} - target: {fileID: 455926, guid: 110e0a191727d5f4f8860ae0957652dd, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
......
...@@ -10,7 +10,7 @@ token=$(echo $loginInfo | jq '.token' | sed 's/"//g') ...@@ -10,7 +10,7 @@ token=$(echo $loginInfo | jq '.token' | sed 's/"//g')
header="Authorization: $token" header="Authorization: $token"
echo "Login succeeded." echo "Login succeeded."
appName="ygopro" appName="ygopro2"
handleErrorMessage() { handleErrorMessage() {
rawJsonInput="$1" rawJsonInput="$1"
......
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