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

Revert "video Background"

This reverts commit 3483c603.
parent 695be855
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
[Header("ui_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_search;
public gameInfo new_ui_gameInfo;
......@@ -290,6 +291,9 @@ public class Program : MonoBehaviour
UIHelper.iniFaces();
initializeALLcameras();
fixALLcamerasPreFrame();
backGroundPic = new BackGroundPic();
servants.Add(backGroundPic);
backGroundPic.fixScreenProblem();
// });
// go(300, () =>
// {
......@@ -715,6 +719,7 @@ public class Program : MonoBehaviour
private readonly List<Servant> servants = new List<Servant>();
public Servant backGroundPic;
public Menu menu;
public Setting setting;
public selectDeck selectDeck;
......@@ -757,6 +762,7 @@ public class Program : MonoBehaviour
public void shiftToServant(Servant to)
{
if (to != backGroundPic && backGroundPic.isShowed) backGroundPic.hide();
if (to != menu && menu.isShowed) menu.hide();
if (to != setting && setting.isShowed) setting.hide();
if (to != selectDeck && selectDeck.isShowed) selectDeck.hide();
......@@ -768,6 +774,7 @@ public class Program : MonoBehaviour
if (to != puzzleMode && puzzleMode.isShowed) puzzleMode.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 == setting && setting.isShowed == false) setting.show();
if (to == selectDeck && selectDeck.isShowed == false) selectDeck.show();
......@@ -904,6 +911,7 @@ public class Program : MonoBehaviour
private void gameStart()
{
if (UIHelper.shouldMaximize()) UIHelper.MaximizeWindow();
backGroundPic.show();
shiftToServant(menu);
}
......
......@@ -217,7 +217,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 407516, guid: 0f5784805788a664da2c92f42ec39685, type: 3}
propertyPath: m_RootOrder
value: 3
value: 4
objectReference: {fileID: 0}
- target: {fileID: 407516, guid: 0f5784805788a664da2c92f42ec39685, type: 3}
propertyPath: m_LocalPosition.x
......@@ -849,7 +849,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 433886, guid: dd57848b7cec7c441b1e5e16bfaf237f, type: 3}
propertyPath: m_RootOrder
value: 1
value: 2
objectReference: {fileID: 0}
- target: {fileID: 433886, guid: dd57848b7cec7c441b1e5e16bfaf237f, type: 3}
propertyPath: m_LocalPosition.x
......@@ -944,7 +944,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 468652, guid: 589b9f7f12556814fb7cc2371ef35649, type: 3}
propertyPath: m_RootOrder
value: 2
value: 3
objectReference: {fileID: 0}
- target: {fileID: 468652, guid: 589b9f7f12556814fb7cc2371ef35649, type: 3}
propertyPath: m_LocalPosition.x
......@@ -1194,6 +1194,12 @@ Camera:
type: 3}
m_PrefabInstance: {fileID: 863808012}
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
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -1611,7 +1617,7 @@ PrefabInstance:
- target: {fileID: 11419100, guid: 995e2fa1a1156d248955c5fb98502585, type: 3}
propertyPath: mod_simple_ngui_background_texture
value:
objectReference: {fileID: 0}
objectReference: {fileID: 865207707}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 995e2fa1a1156d248955c5fb98502585, type: 3}
--- !u!1 &1283106570 stripped
......@@ -1903,6 +1909,67 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
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
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -2060,15 +2127,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 455926, guid: 110e0a191727d5f4f8860ae0957652dd, type: 3}
propertyPath: m_LocalScale.x
value: 0.0028571428
value: 0.0027359782
objectReference: {fileID: 0}
- target: {fileID: 455926, guid: 110e0a191727d5f4f8860ae0957652dd, type: 3}
propertyPath: m_LocalScale.y
value: 0.0028571428
value: 0.0027359782
objectReference: {fileID: 0}
- target: {fileID: 455926, guid: 110e0a191727d5f4f8860ae0957652dd, type: 3}
propertyPath: m_LocalScale.z
value: 0.0028571428
value: 0.0027359782
objectReference: {fileID: 0}
- target: {fileID: 455926, guid: 110e0a191727d5f4f8860ae0957652dd, type: 3}
propertyPath: m_LocalPosition.x
......
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