Commit 7be44462 authored by hex's avatar hex

fix and optimized

parent dde96b6a
Pipeline #39607 failed
......@@ -42,21 +42,20 @@ public class MonoCardInDeckManager : MonoBehaviour
if (isDraging)
{
gameObject.transform.position +=
(getGoodPosition(4) - gameObject.transform.position) * 0.3f;
(GetMouseWorldPosition(4) - gameObject.transform.position) * 0.3f;
}
if (Vector3.Distance(Vector3.zero, gameObject.transform.position) > 50 && bool_physicalON)
{
killIt();
KillCard();
}
}
public void killIt()
public void KillCard()
{
if (Program.I().deckManager.condition == DeckManager.Condition.changeSide)
{
gameObject.transform.position = new Vector3(0, 5, 0);
endDrag();
EndDrag();
if (Program.I().deckManager.cardInDragging == this)
{
Program.I().deckManager.cardInDragging = null;
......@@ -74,7 +73,7 @@ public class MonoCardInDeckManager : MonoBehaviour
}
}
public Vector3 getGoodPosition(float height)
public Vector3 GetMouseWorldPosition(float height)
{
float x = Input.mousePosition.x;
float y = Input.mousePosition.y;
......@@ -97,7 +96,7 @@ public class MonoCardInDeckManager : MonoBehaviour
return to_ltemp;
}
public void beginDrag()
public void BeginDrag()
{
physicalOFF();
physicalHalfON();
......@@ -105,7 +104,7 @@ public class MonoCardInDeckManager : MonoBehaviour
transform.DORotate(new Vector3(90, 0, 0), 0.6f).SetDelay(0);
}
public void endDrag()
public void EndDrag()
{
physicalON();
stopDragThisFrame = true;
......@@ -113,18 +112,18 @@ public class MonoCardInDeckManager : MonoBehaviour
if (
Input.GetKey(KeyCode.LeftControl)
|| Input.GetKey(KeyCode.RightControl)
|| getIfAlive() == false
|| !IsAlive()
)
{
Vector3 from_position = getGoodPosition(4);
Vector3 to_position = getGoodPosition(0);
Vector3 from_position = GetMouseWorldPosition(4);
Vector3 to_position = GetMouseWorldPosition(0);
Vector3 delta_position = to_position - from_position;
GetComponent<Rigidbody>().AddForce(delta_position * 1000);
dying = true;
}
}
public void tweenToVectorAndFall(Vector3 position, Vector3 rotation, float delay = 0)
public void TweenToPositionAndFall(Vector3 position, Vector3 rotation, float delay = 0)
{
var rigidbody = GetComponent<Rigidbody>();
if (rigidbody != null) rigidbody.Sleep();
......@@ -173,7 +172,7 @@ public class MonoCardInDeckManager : MonoBehaviour
public bool IsInDeckArea()
{
// 此逻辑专门用于检查卡片是否在物理上位于有效的卡组区域内。
Vector3 to_ltemp = refLectPosition(gameObject.transform.position);
Vector3 to_ltemp = ReflectPositionToGround(gameObject.transform.position);
if (to_ltemp.x < -15.2f || to_ltemp.x > 15.2f)
{
return false;
......@@ -181,7 +180,7 @@ public class MonoCardInDeckManager : MonoBehaviour
return true;
}
public bool getIfAlive()
public bool IsAlive()
{
// 步骤 1: 检查不可逆的“死亡”状态,这在任何模式下都适用。
if (died || gameObject.transform.position.y < -0.5f)
......@@ -200,7 +199,7 @@ public class MonoCardInDeckManager : MonoBehaviour
}
}
public static Vector3 refLectPosition(Vector3 pos)
public static Vector3 ReflectPositionToGround(Vector3 pos)
{
Vector3 to_ltemp = pos;
Vector3 dv = to_ltemp - Program.I().main_camera.transform.position;
......
using System;
// using System;
// using System.Collections.Generic;
// using DG.Tweening;
// using UnityEngine;
// public class gameUIbutton
// {
// public string hashString;
// public GameObject gameObject;
// public int response;
// public bool dying;
// public bool dead;
// }
// public class gameInfo : MonoBehaviour
// {
// public UITexture instance_btnPan;
// public UITextList instance_lab;
// public UIToggle toggle_ignore;
// public UIToggle toggle_all;
// public UIToggle toggle_smart;
// public GameObject line;
// public void on_toggle_ignore()
// {
// toggle_all.value = false;
// toggle_smart.value = false;
// }
// public void on_toggle_all()
// {
// toggle_ignore.value = false;
// toggle_smart.value = false;
// }
// public void on_toggle_smart()
// {
// toggle_ignore.value = false;
// toggle_all.value = false;
// }
// //public UITextList hinter;
// barPngLoader me;
// barPngLoader opponent;
// public GameObject mod_healthBar;
// public float width = 0;
// int lastTickTime = 0;
// // Use this for initialization
// void Start()
// {
// ini();
// }
// public void ini()
// {
// Update();
// }
// public bool swaped = false;
// void Update()
// {
// if (me == null || opponent == null)
// {
// me = ((GameObject)MonoBehaviour.Instantiate(mod_healthBar, new Vector3(1000, 0, 0), Quaternion.identity)).GetComponent<barPngLoader>();
// me.transform.SetParent(gameObject.transform);
// opponent = ((GameObject)MonoBehaviour.Instantiate(mod_healthBar, new Vector3(1000, 0, 0), Quaternion.identity)).GetComponent<barPngLoader>();
// opponent.transform.SetParent(gameObject.transform);
// Transform[] Transforms = me.GetComponentsInChildren<Transform>();
// foreach (Transform child in Transforms)
// {
// child.gameObject.layer = gameObject.layer;
// }
// Transforms = opponent.GetComponentsInChildren<Transform>();
// foreach (Transform child in Transforms)
// {
// child.gameObject.layer = gameObject.layer;
// }
// Color c;
// ColorUtility.TryParseHtmlString(Config.Getui("gameChainCheckArea.color"), out c);
// UIHelper.getByName<UISprite>(UIHelper.getByName<UIToggle>(gameObject, "ignore_").gameObject, "Background").color = c;
// UIHelper.getByName<UISprite>(UIHelper.getByName<UIToggle>(gameObject, "watch_").gameObject, "Background").color = c;
// UIHelper.getByName<UISprite>(UIHelper.getByName<UIToggle>(gameObject, "use_").gameObject, "Background").color = c;
// }
// // float k = ((float)(Screen.width - Program.I().cardDescription.width)) / 1200f;
// // if (k > 1.2f)
// // {
// // k = 1.2f;
// // }
// // if (k < 0.8f)
// // {
// // k = 0.8f;
// // }
// float k = (global::System.Object)Screen.width switch
// {
// 1366 => 0.8f,
// 1600 => 0.9f,
// 1920 => 1.2f,
// 2560 => 1.5f,
// _ => 1,
// };
// Vector3 ks = new Vector3(k, k, k);
// // float kb = ((float)(Screen.width - Program.I().cardDescription.width)) / 1200f;
// // Debug.Log("kb:" + kb);
// // if (kb > 1.2f)
// // {
// // kb = 1.2f;
// // }
// // if (kb < 0.73f)
// // {
// // kb = 0.73f;
// // }
// float kb = (global::System.Object)Screen.width switch
// {
// 1366 => 0.8f,
// 1600 => 0.9f,
// 1920 => 1.1f,
// 2560 => 1.4f,
// _ => 1,
// };
// Vector3 ksb = new Vector3(kb, kb, kb);
// instance_btnPan.gameObject.transform.localScale = ksb;
// opponent.transform.localScale = ks;
// me.transform.localScale = ks;
// if (!swaped)
// {
// opponent.transform.localPosition = new Vector3(Screen.width / 2 - 14, Screen.height / 2 - 14);
// me.transform.localPosition = new Vector3(Screen.width / 2 - 14, Screen.height / 2 - 14 - k * (float)(opponent.under.height));
// }
// else
// {
// me.transform.localPosition = new Vector3(Screen.width / 2 - 14, Screen.height / 2 - 14);
// opponent.transform.localPosition = new Vector3(Screen.width / 2 - 14, Screen.height / 2 - 14 - k * (float)(opponent.under.height));
// }
// width = (225 * kb) + 15f;
// float localPositionPanX = (((float)Screen.width - 225 * kb) / 2) - 15f;
// instance_btnPan.transform.localPosition = new Vector3(localPositionPanX, 120, 0);
// instance_lab.transform.localPosition = new Vector3(Screen.width / 2 - 315, -Screen.height / 2 + 90 + Screen.safeArea.y, 0);
// int j = 0;
// for (int i = 0; i < HashedButtons.Count; i++)
// {
// if (HashedButtons[i].gameObject != null)
// {
// if (HashedButtons[i].dying)
// {
// HashedButtons[i].gameObject.transform.localPosition += (new Vector3(0, -120, 0) - HashedButtons[i].gameObject.transform.localPosition) * Program.deltaTime * 20f;
// if (Math.Abs(HashedButtons[i].gameObject.transform.localPosition.y - -120) < 1)
// HashedButtons[i].dead = true;
// }
// else
// {
// HashedButtons[i].gameObject.transform.localPosition += (new Vector3(0, -220 - j * 75, 0) - HashedButtons[i].gameObject.transform.localPosition) * Program.deltaTime * 10f;
// j++;
// }
// }
// else
// HashedButtons[i].dead = true;
// }
// for (int i = HashedButtons.Count - 1; i >= 0; i--)
// {
// if (HashedButtons[i].dead)
// HashedButtons.RemoveAt(i);
// }
// float height = 198 + 75 * j;
// if (j == 0)
// {
// height = 174;
// }
// instance_btnPan.height += (int)(((float)height - (float)instance_btnPan.height) * 0.2f);
// if (Program.TimePassed() - lastTickTime > 1000)
// {
// lastTickTime = Program.TimePassed();
// tick();
// }
// }
// List<gameUIbutton> HashedButtons = new List<gameUIbutton>();
// public void addHashedButton(string hashString_, int hashInt, superButtonType type, string hint)
// {
// gameUIbutton hashedButton = new gameUIbutton();
// string hashString = hashString_;
// if (hashString == "")
// {
// hashString = hashInt.ToString();
// }
// hashedButton.hashString = hashString;
// hashedButton.response = hashInt;
// hashedButton.gameObject = Program.I().create(Program.I().new_ui_superButtonTransparent);
// UIHelper.trySetLableText(hashedButton.gameObject, "hint_", hint);
// UIHelper.getRealEventGameObject(hashedButton.gameObject).name = hashString + "----" + hashInt.ToString();
// UIHelper.registUIEventTriggerForClick(hashedButton.gameObject, listenerForClicked);
// hashedButton.gameObject.GetComponent<iconSetForButton>().setTexture(type);
// hashedButton.gameObject.GetComponent<iconSetForButton>().setText(hint);
// Transform[] Transforms = hashedButton.gameObject.GetComponentsInChildren<Transform>();
// foreach (Transform child in Transforms)
// {
// child.gameObject.layer = instance_btnPan.gameObject.layer;
// }
// hashedButton.gameObject.transform.SetParent(instance_btnPan.transform, false);
// hashedButton.gameObject.transform.localScale = Vector3.zero;
// hashedButton.gameObject.transform.localPosition = new Vector3(0, -120, 0);
// hashedButton.gameObject.transform.localEulerAngles = Vector3.zero;
// hashedButton.gameObject.transform.DOScale(new Vector3(0.9f, 0.9f, 0.9f), 0.3f);
// hashedButton.dying = false;
// HashedButtons.Add(hashedButton);
// refreshLine();
// }
// void listenerForClicked(GameObject obj)
// {
// string[] mats = obj.name.Split("----");
// if (mats.Length == 2)
// {
// for (int i = 0; i < HashedButtons.Count; i++)
// {
// if (HashedButtons[i].hashString == mats[0])
// {
// if (HashedButtons[i].response.ToString() == mats[1])
// {
// Program.I().ocgcore.ES_gameUIbuttonClicked(HashedButtons[i]);
// }
// }
// }
// }
// }
// public bool queryHashedButton(string hashString)
// {
// for (int i = 0; i < HashedButtons.Count; i++)
// {
// if (HashedButtons[i].hashString == hashString && !HashedButtons[i].dying)
// {
// return true;
// }
// }
// return false;
// }
// public void removeHashedButton(string hashString)
// {
// gameUIbutton remove = null;
// for (int i = 0; i < HashedButtons.Count; i++)
// {
// if (HashedButtons[i].hashString == hashString)
// {
// remove = HashedButtons[i];
// }
// }
// if (remove != null)
// {
// if (remove.gameObject != null)
// {
// Program.I().destroy(remove.gameObject, 0.3f, true);
// }
// remove.dying = true;
// }
// refreshLine();
// }
// public void removeAll()
// {
// if (HashedButtons.Count == 1)
// {
// if (HashedButtons[0].hashString == "swap")
// {
// return;
// }
// }
// for (int i = 0; i < HashedButtons.Count; i++)
// {
// if (HashedButtons[i].gameObject != null)
// {
// Program.I().destroy(HashedButtons[i].gameObject, 0.3f, true);
// }
// HashedButtons[i].dying = true;
// }
// refreshLine();
// }
// void refreshLine()
// {
// int j = 0;
// for (int i = 0; i < HashedButtons.Count; i++)
// {
// if (!HashedButtons[i].dying)
// {
// j++;
// }
// }
// line.SetActive(j > 0);
// }
// int[] time = new int[2];
// bool[] isTicking = new bool[2];
// public void setTime(int player, int t)
// {
// if (player < 2)
// {
// time[player] = t;
// setTimeAbsolutely(player, t);
// isTicking[player] = true;
// isTicking[1 - player] = false;
// }
// }
// public void setExcited(int player)
// {
// if (player == 0)
// {
// me.under.mainTexture = GameTextureManager.exBar;
// opponent.under.mainTexture = GameTextureManager.bar;
// }
// else
// {
// opponent.under.mainTexture = GameTextureManager.exBar;
// me.under.mainTexture = GameTextureManager.bar;
// }
// }
// public void setTimeStill(int player)
// {
// time[0] = Program.I().ocgcore.timeLimit;
// time[1] = Program.I().ocgcore.timeLimit;
// setTimeAbsolutely(0, Program.I().ocgcore.timeLimit);
// setTimeAbsolutely(1, Program.I().ocgcore.timeLimit);
// isTicking[0] = false;
// isTicking[1] = false;
// if (player == 0)
// {
// me.under.mainTexture = GameTextureManager.exBar;
// opponent.under.mainTexture = GameTextureManager.bar;
// }
// else
// {
// opponent.under.mainTexture = GameTextureManager.exBar;
// me.under.mainTexture = GameTextureManager.bar;
// }
// if (Program.I().ocgcore.timeLimit == 0)
// {
// me.api_timeHint.text = "infinite";
// opponent.api_timeHint.text = "infinite";
// }
// else
// {
// me.api_timeHint.text = "paused";
// opponent.api_timeHint.text = "paused";
// }
// }
// public bool amIdanger()
// {
// return time[0] < Program.I().ocgcore.timeLimit / 3;
// }
// void setTimeAbsolutely(int player, int t)
// {
// if (Program.I().ocgcore.timeLimit == 0)
// {
// return;
// }
// if (player == 0)
// {
// me.api_timeHint.text = t.ToString() + "/" + Program.I().ocgcore.timeLimit.ToString();
// opponent.api_timeHint.text = "waiting";
// me.api_timeBar.transform.DOKill();
// me.api_timeBar.transform.DOLocalMoveX((float)(me.api_timeBar.width) - (float)t / (float)Program.I().ocgcore.timeLimit * (float)(me.api_timeBar.width), 1f);
// }
// if (player == 1)
// {
// opponent.api_timeHint.text = t.ToString() + "/" + Program.I().ocgcore.timeLimit.ToString();
// me.api_timeHint.text = "waiting";
// opponent.api_timeBar.transform.DOKill();
// opponent.api_timeBar.transform.DOLocalMoveX((float)(opponent.api_timeBar.width) - (float)t / (float)Program.I().ocgcore.timeLimit * (float)(opponent.api_timeBar.width), 1f);
// }
// }
// public void realize()
// {
// me.api_healthHint.text = ((float)Program.I().ocgcore.life_0 > 0 ? Program.I().ocgcore.life_0 : 0).ToString();
// opponent.api_healthHint.text = ((float)Program.I().ocgcore.life_1 > 0 ? Program.I().ocgcore.life_1 : 0).ToString();
// me.api_name.text = Program.I().ocgcore.name_0_c;
// opponent.api_name.text = Program.I().ocgcore.name_1_c;
// me.api_face.mainTexture = UIHelper.getFace(Program.I().ocgcore.name_0_c);
// opponent.api_face.mainTexture = UIHelper.getFace(Program.I().ocgcore.name_1_c);
// // 玩家自己
// // me.api_healthBar.transform.DOKill();
// float myLpTargetX = (float)(me.api_healthBar.width) - getRealLife(Program.I().ocgcore.life_0) / ((float)Program.I().ocgcore.lpLimit) * (float)(me.api_healthBar.width);
// me.api_healthBar.transform.DOLocalMoveX(myLpTargetX, 1f);
// // 对手
// // opponent.api_healthBar.transform.DOKill();
// float opLpTargetX = (float)(opponent.api_healthBar.width) - getRealLife(Program.I().ocgcore.life_1) / ((float)Program.I().ocgcore.lpLimit) * (float)(opponent.api_healthBar.width);
// opponent.api_healthBar.transform.DOLocalMoveX(opLpTargetX, 1f);
// instance_lab.Clear();
// if (Program.I().ocgcore.confirmedCards.Count > 0)
// {
// instance_lab.Add(GameStringHelper.yijingqueren);
// }
// foreach (var item in Program.I().ocgcore.confirmedCards)
// {
// instance_lab.Add(item);
// }
// }
// static float getRealLife(float in_)
// {
// if (in_ < 0)
// {
// return 0;
// }
// if (in_ > Program.I().ocgcore.lpLimit)
// {
// return Program.I().ocgcore.lpLimit;
// }
// return in_;
// }
// void tick()
// {
// if (isTicking[0])
// {
// if (time[0] > 0)
// {
// time[0]--;
// }
// if (amIdanger())
// {
// if (Program.I().ocgcore != null)
// {
// Program.I().ocgcore.dangerTicking();
// }
// }
// setTimeAbsolutely(0, time[0]);
// }
// if (isTicking[1])
// {
// if (time[1] > 0)
// {
// time[1]--;
// }
// setTimeAbsolutely(1, time[1]);
// }
// }
// public enum chainCondition
// {
// standard, no, all, smart
// }
// public void set_condition(chainCondition c)
// {
// switch (c)
// {
// case chainCondition.standard:
// toggle_all.value = false;
// toggle_smart.value = false;
// toggle_ignore.value = false;
// break;
// case chainCondition.no:
// toggle_all.value = false;
// toggle_smart.value = false;
// toggle_ignore.value = true;
// break;
// case chainCondition.all:
// toggle_all.value = true;
// toggle_smart.value = false;
// toggle_ignore.value = false;
// break;
// case chainCondition.smart:
// toggle_all.value = false;
// toggle_smart.value = true;
// toggle_ignore.value = false;
// break;
// }
// }
// public chainCondition get_condition()
// {
// chainCondition res = chainCondition.standard;
// if (toggle_ignore.value)
// {
// res = chainCondition.no;
// }
// if (toggle_smart.value)
// {
// res = chainCondition.smart;
// }
// if (toggle_all.value)
// {
// res = chainCondition.all;
// }
// return res;
// }
// }
using System;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;
public class gameUIbutton
{
public string hashString;
......@@ -15,233 +528,446 @@ public class gameUIbutton
public class gameInfo : MonoBehaviour
{
#region UI Components
[Header("UI Panel Components")]
public UITexture instance_btnPan;
public UITextList instance_lab;
[Header("Toggle Components")]
public UIToggle toggle_ignore;
public UIToggle toggle_all;
public UIToggle toggle_smart;
[Header("Visual Elements")]
public GameObject line;
public GameObject mod_healthBar;
#endregion
public void on_toggle_ignore()
#region Private Fields
private barPngLoader me;
private barPngLoader opponent;
private readonly List<gameUIbutton> hashedButtons = new List<gameUIbutton>();
// Timing system
private readonly int[] time = new int[2];
private readonly bool[] isTicking = new bool[2];
private int lastTickTime = 0;
// UI positioning
public float width = 0;
public bool swaped = false;
// Cached values for performance
private float lastScreenWidth = 0;
private float lastScreenHeight = 0;
private Vector3 cachedMeScale = Vector3.one;
private Vector3 cachedOpponentScale = Vector3.one;
private Vector3 cachedBtnPanScale = Vector3.one;
// Constants
private const float ANIMATION_SPEED = 10f;
private const float DYING_ANIMATION_SPEED = 20f;
private const float SCALE_ANIMATION_DURATION = 0.3f;
private const float BUTTON_VERTICAL_SPACING = 75f;
private const float BASE_HEIGHT = 198f;
private const float MIN_HEIGHT = 174f;
private const int TICK_INTERVAL = 1000;
#endregion
#region Public Enums
public enum chainCondition
{
toggle_all.value = false;
toggle_smart.value = false;
standard, no, all, smart
}
#endregion
public void on_toggle_all()
#region Unity Lifecycle
void Start()
{
toggle_ignore.value = false;
toggle_smart.value = false;
Initialize();
}
public void on_toggle_smart()
void Update()
{
toggle_ignore.value = false;
toggle_all.value = false;
UpdateUIScaling();
UpdatePositions();
UpdateButtonAnimations();
UpdatePanelHeight();
HandleTicking();
}
#endregion
//public UITextList hinter;
#region Initialization
public void ini()
{
Initialize();
}
barPngLoader me;
private void Initialize()
{
lastScreenWidth = Screen.width;
lastScreenHeight = Screen.height;
InitializeHealthBarsIfNeeded();
UpdateUIScaling();
}
barPngLoader opponent;
private void InitializeHealthBarsIfNeeded()
{
if (me == null || opponent == null)
{
CreateHealthBars();
SetupHealthBarLayers();
ApplyConfigColors();
}
}
public GameObject mod_healthBar;
private void CreateHealthBars()
{
me = CreateHealthBar();
opponent = CreateHealthBar();
}
public float width = 0;
private barPngLoader CreateHealthBar()
{
var healthBarObj = Instantiate(mod_healthBar, new Vector3(1000, 0, 0), Quaternion.identity);
healthBarObj.transform.SetParent(transform);
return healthBarObj.GetComponent<barPngLoader>();
}
int lastTickTime = 0;
private void SetupHealthBarLayers()
{
SetChildrenLayers(me.transform);
SetChildrenLayers(opponent.transform);
}
// Use this for initialization
void Start()
private void SetChildrenLayers(Transform parent)
{
var transforms = parent.GetComponentsInChildren<Transform>();
foreach (var child in transforms)
{
ini();
child.gameObject.layer = gameObject.layer;
}
}
public void ini()
private void ApplyConfigColors()
{
Update();
if (ColorUtility.TryParseHtmlString(Config.Getui("gameChainCheckArea.color"), out Color configColor))
{
ApplyColorToToggle("ignore_", configColor);
ApplyColorToToggle("watch_", configColor);
ApplyColorToToggle("use_", configColor);
}
}
public bool swaped = false;
private void ApplyColorToToggle(string toggleName, Color color)
{
var toggle = UIHelper.getByName<UIToggle>(gameObject, toggleName);
if (toggle != null)
{
var background = UIHelper.getByName<UISprite>(toggle.gameObject, "Background");
if (background != null)
{
background.color = color;
}
}
}
#endregion
void Update()
#region Toggle Event Handlers
public void on_toggle_ignore()
{
if (me == null || opponent == null)
SetExclusiveToggle(toggle_ignore);
}
public void on_toggle_all()
{
me = ((GameObject)MonoBehaviour.Instantiate(mod_healthBar, new Vector3(1000, 0, 0), Quaternion.identity)).GetComponent<barPngLoader>();
me.transform.SetParent(gameObject.transform);
opponent = ((GameObject)MonoBehaviour.Instantiate(mod_healthBar, new Vector3(1000, 0, 0), Quaternion.identity)).GetComponent<barPngLoader>();
opponent.transform.SetParent(gameObject.transform);
SetExclusiveToggle(toggle_all);
}
Transform[] Transforms = me.GetComponentsInChildren<Transform>();
foreach (Transform child in Transforms)
public void on_toggle_smart()
{
child.gameObject.layer = gameObject.layer;
SetExclusiveToggle(toggle_smart);
}
Transforms = opponent.GetComponentsInChildren<Transform>();
foreach (Transform child in Transforms)
private void SetExclusiveToggle(UIToggle activeToggle)
{
child.gameObject.layer = gameObject.layer;
var toggles = new[] { toggle_ignore, toggle_all, toggle_smart };
foreach (var toggle in toggles)
{
if (toggle != activeToggle)
{
toggle.value = false;
}
}
}
#endregion
#region UI Scaling and Positioning
private void UpdateUIScaling()
{
if (HasScreenSizeChanged())
{
RecalculateScaling();
}
}
Color c;
ColorUtility.TryParseHtmlString(Config.Getui("gameChainCheckArea.color"), out c);
UIHelper.getByName<UISprite>(UIHelper.getByName<UIToggle>(gameObject, "ignore_").gameObject, "Background").color = c;
UIHelper.getByName<UISprite>(UIHelper.getByName<UIToggle>(gameObject, "watch_").gameObject, "Background").color = c;
UIHelper.getByName<UISprite>(UIHelper.getByName<UIToggle>(gameObject, "use_").gameObject, "Background").color = c;
private bool HasScreenSizeChanged()
{
return lastScreenWidth != Screen.width || lastScreenHeight != Screen.height;
}
// float k = ((float)(Screen.width - Program.I().cardDescription.width)) / 1200f;
// if (k > 1.2f)
// {
// k = 1.2f;
// }
// if (k < 0.8f)
// {
// k = 0.8f;
// }
float k = (global::System.Object)Screen.width switch
private void RecalculateScaling()
{
lastScreenWidth = Screen.width;
lastScreenHeight = Screen.height;
var scale = GetScaleForResolution(Screen.width);
var buttonScale = GetButtonScaleForResolution(Screen.width);
cachedMeScale = new Vector3(scale, scale, scale);
cachedOpponentScale = new Vector3(scale, scale, scale);
cachedBtnPanScale = new Vector3(buttonScale, buttonScale, buttonScale);
}
private float GetScaleForResolution(int screenWidth)
{
return screenWidth switch
{
1366 => 0.8f,
1600 => 0.9f,
1920 => 1.2f,
2560 => 1.5f,
_ => 1,
_ => 1f
};
Vector3 ks = new Vector3(k, k, k);
// float kb = ((float)(Screen.width - Program.I().cardDescription.width)) / 1200f;
// Debug.Log("kb:" + kb);
// if (kb > 1.2f)
// {
// kb = 1.2f;
// }
// if (kb < 0.73f)
// {
// kb = 0.73f;
// }
float kb = (global::System.Object)Screen.width switch
}
private float GetButtonScaleForResolution(int screenWidth)
{
return screenWidth switch
{
1366 => 0.8f,
1600 => 0.9f,
1920 => 1.1f,
2560 => 1.4f,
_ => 1,
_ => 1f
};
Vector3 ksb = new Vector3(kb, kb, kb);
instance_btnPan.gameObject.transform.localScale = ksb;
opponent.transform.localScale = ks;
me.transform.localScale = ks;
}
private void UpdatePositions()
{
UpdateHealthBarPositions();
UpdateButtonPanelPosition();
UpdateLabPosition();
}
private void UpdateHealthBarPositions()
{
if (me == null || opponent == null) return;
me.transform.localScale = cachedMeScale;
opponent.transform.localScale = cachedOpponentScale;
var centerX = Screen.width / 2 - 14;
var centerY = Screen.height / 2 - 14;
var offset = cachedMeScale.x * opponent.under.height;
if (!swaped)
{
opponent.transform.localPosition = new Vector3(Screen.width / 2 - 14, Screen.height / 2 - 14);
me.transform.localPosition = new Vector3(Screen.width / 2 - 14, Screen.height / 2 - 14 - k * (float)(opponent.under.height));
opponent.transform.localPosition = new Vector3(centerX, centerY);
me.transform.localPosition = new Vector3(centerX, centerY - offset);
}
else
{
me.transform.localPosition = new Vector3(Screen.width / 2 - 14, Screen.height / 2 - 14);
opponent.transform.localPosition = new Vector3(Screen.width / 2 - 14, Screen.height / 2 - 14 - k * (float)(opponent.under.height));
me.transform.localPosition = new Vector3(centerX, centerY);
opponent.transform.localPosition = new Vector3(centerX, centerY - offset);
}
}
width = (225 * kb) + 15f;
float localPositionPanX = (((float)Screen.width - 225 * kb) / 2) - 15f;
private void UpdateButtonPanelPosition()
{
instance_btnPan.gameObject.transform.localScale = cachedBtnPanScale;
width = (225 * cachedBtnPanScale.x) + 15f;
float localPositionPanX = ((Screen.width - 225 * cachedBtnPanScale.x) / 2) - 15f;
instance_btnPan.transform.localPosition = new Vector3(localPositionPanX, 120, 0);
instance_lab.transform.localPosition = new Vector3(Screen.width / 2 - 315, -Screen.height / 2 + 90 + Screen.safeArea.y, 0);
}
int j = 0;
for (int i = 0; i < HashedButtons.Count; i++)
{
if (HashedButtons[i].gameObject != null)
private void UpdateLabPosition()
{
if (HashedButtons[i].dying)
instance_lab.transform.localPosition = new Vector3(
Screen.width / 2 - 315,
-Screen.height / 2 + 90 + Screen.safeArea.y,
0
);
}
#endregion
#region Button Management
public void addHashedButton(string hashString_, int hashInt, superButtonType type, string hint)
{
HashedButtons[i].gameObject.transform.localPosition += (new Vector3(0, -120, 0) - HashedButtons[i].gameObject.transform.localPosition) * Program.deltaTime * 20f;
if (Math.Abs(HashedButtons[i].gameObject.transform.localPosition.y - -120) < 1)
HashedButtons[i].dead = true;
var hashedButton = CreateHashedButton(hashString_, hashInt, type, hint);
hashedButtons.Add(hashedButton);
refreshLine();
}
else
private gameUIbutton CreateHashedButton(string hashString_, int hashInt, superButtonType type, string hint)
{
var hashedButton = new gameUIbutton
{
HashedButtons[i].gameObject.transform.localPosition += (new Vector3(0, -220 - j * 75, 0) - HashedButtons[i].gameObject.transform.localPosition) * Program.deltaTime * 10f;
j++;
hashString = string.IsNullOrEmpty(hashString_) ? hashInt.ToString() : hashString_,
response = hashInt,
gameObject = CreateButtonGameObject(hashString_, hashInt, type, hint),
dying = false
};
SetupButtonGameObject(hashedButton, hint);
return hashedButton;
}
private GameObject CreateButtonGameObject(string hashString, int hashInt, superButtonType type, string hint)
{
var buttonObj = Program.I().create(Program.I().new_ui_superButtonTransparent);
var finalHashString = string.IsNullOrEmpty(hashString) ? hashInt.ToString() : hashString;
UIHelper.trySetLableText(buttonObj, "hint_", hint);
UIHelper.getRealEventGameObject(buttonObj).name = $"{finalHashString}----{hashInt}";
UIHelper.registUIEventTriggerForClick(buttonObj, listenerForClicked);
var iconSetter = buttonObj.GetComponent<iconSetForButton>();
iconSetter.setTexture(type);
iconSetter.setText(hint);
return buttonObj;
}
else
HashedButtons[i].dead = true;
private void SetupButtonGameObject(gameUIbutton hashedButton, string hint)
{
SetChildrenLayers(hashedButton.gameObject.transform);
hashedButton.gameObject.transform.SetParent(instance_btnPan.transform, false);
hashedButton.gameObject.transform.localScale = Vector3.zero;
hashedButton.gameObject.transform.localPosition = new Vector3(0, -120, 0);
hashedButton.gameObject.transform.localEulerAngles = Vector3.zero;
hashedButton.gameObject.transform.DOScale(new Vector3(0.9f, 0.9f, 0.9f), SCALE_ANIMATION_DURATION);
}
for (int i = HashedButtons.Count - 1; i >= 0; i--)
private void UpdateButtonAnimations()
{
if (HashedButtons[i].dead)
HashedButtons.RemoveAt(i);
int activeButtonIndex = 0;
for (int i = 0; i < hashedButtons.Count; i++)
{
var button = hashedButtons[i];
if (button.gameObject == null)
{
button.dead = true;
continue;
}
float height = 198 + 75 * j;
if (j == 0)
if (button.dying)
{
height = 174;
AnimateButtonToDeathPosition(button);
}
instance_btnPan.height += (int)(((float)height - (float)instance_btnPan.height) * 0.2f);
if (Program.TimePassed() - lastTickTime > 1000)
else
{
lastTickTime = Program.TimePassed();
tick();
AnimateButtonToActivePosition(button, activeButtonIndex);
activeButtonIndex++;
}
}
List<gameUIbutton> HashedButtons = new List<gameUIbutton>();
RemoveDeadButtons();
}
public void addHashedButton(string hashString_, int hashInt, superButtonType type, string hint)
private void AnimateButtonToDeathPosition(gameUIbutton button)
{
var targetPosition = new Vector3(0, -120, 0);
button.gameObject.transform.localPosition = Vector3.Lerp(
button.gameObject.transform.localPosition,
targetPosition,
Program.deltaTime * DYING_ANIMATION_SPEED
);
if (Vector3.Distance(button.gameObject.transform.localPosition, targetPosition) < 1f)
{
gameUIbutton hashedButton = new gameUIbutton();
string hashString = hashString_;
if (hashString == "")
button.dead = true;
}
}
private void AnimateButtonToActivePosition(gameUIbutton button, int index)
{
hashString = hashInt.ToString();
var targetPosition = new Vector3(0, -220 - index * BUTTON_VERTICAL_SPACING, 0);
button.gameObject.transform.localPosition = Vector3.Lerp(
button.gameObject.transform.localPosition,
targetPosition,
Program.deltaTime * ANIMATION_SPEED
);
}
hashedButton.hashString = hashString;
hashedButton.response = hashInt;
hashedButton.gameObject = Program.I().create(Program.I().new_ui_superButtonTransparent);
UIHelper.trySetLableText(hashedButton.gameObject, "hint_", hint);
UIHelper.getRealEventGameObject(hashedButton.gameObject).name = hashString + "----" + hashInt.ToString();
UIHelper.registUIEventTriggerForClick(hashedButton.gameObject, listenerForClicked);
hashedButton.gameObject.GetComponent<iconSetForButton>().setTexture(type);
hashedButton.gameObject.GetComponent<iconSetForButton>().setText(hint);
Transform[] Transforms = hashedButton.gameObject.GetComponentsInChildren<Transform>();
foreach (Transform child in Transforms)
private void RemoveDeadButtons()
{
for (int i = hashedButtons.Count - 1; i >= 0; i--)
{
child.gameObject.layer = instance_btnPan.gameObject.layer;
if (hashedButtons[i].dead)
{
hashedButtons.RemoveAt(i);
}
}
hashedButton.gameObject.transform.SetParent(instance_btnPan.transform, false);
hashedButton.gameObject.transform.localScale = Vector3.zero;
hashedButton.gameObject.transform.localPosition = new Vector3(0, -120, 0);
hashedButton.gameObject.transform.localEulerAngles = Vector3.zero;
hashedButton.gameObject.transform.DOScale(new Vector3(0.9f, 0.9f, 0.9f), 0.3f);
hashedButton.dying = false;
HashedButtons.Add(hashedButton);
refreshLine();
}
void listenerForClicked(GameObject obj)
private void UpdatePanelHeight()
{
string[] mats = obj.name.Split("----");
if (mats.Length == 2)
int activeButtonCount = GetActiveButtonCount();
float targetHeight = activeButtonCount == 0 ? MIN_HEIGHT : BASE_HEIGHT + BUTTON_VERTICAL_SPACING * activeButtonCount;
instance_btnPan.height += (int)((targetHeight - instance_btnPan.height) * 0.2f);
}
private int GetActiveButtonCount()
{
for (int i = 0; i < HashedButtons.Count; i++)
int count = 0;
foreach (var button in hashedButtons)
{
if (HashedButtons[i].hashString == mats[0])
if (!button.dying)
{
if (HashedButtons[i].response.ToString() == mats[1])
count++;
}
}
return count;
}
private void listenerForClicked(GameObject obj)
{
var parts = obj.name.Split("----");
if (parts.Length != 2) return;
var hashString = parts[0];
var responseString = parts[1];
var button = FindButtonByHash(hashString, responseString);
if (button != null)
{
Program.I().ocgcore.ES_gameUIbuttonClicked(HashedButtons[i]);
Program.I().ocgcore.ES_gameUIbuttonClicked(button);
}
}
private gameUIbutton FindButtonByHash(string hashString, string responseString)
{
foreach (var button in hashedButtons)
{
if (button.hashString == hashString && button.response.ToString() == responseString)
{
return button;
}
}
return null;
}
public bool queryHashedButton(string hashString)
{
for (int i = 0; i < HashedButtons.Count; i++)
foreach (var button in hashedButtons)
{
if (HashedButtons[i].hashString == hashString && !HashedButtons[i].dying)
if (button.hashString == hashString && !button.dying)
{
return true;
}
......@@ -251,72 +977,97 @@ public class gameInfo : MonoBehaviour
public void removeHashedButton(string hashString)
{
gameUIbutton remove = null;
for (int i = 0; i < HashedButtons.Count; i++)
var buttonToRemove = FindButtonToRemove(hashString);
if (buttonToRemove != null)
{
if (HashedButtons[i].hashString == hashString)
{
remove = HashedButtons[i];
RemoveButton(buttonToRemove);
refreshLine();
}
}
if (remove != null)
private gameUIbutton FindButtonToRemove(string hashString)
{
if (remove.gameObject != null)
foreach (var button in hashedButtons)
{
Program.I().destroy(remove.gameObject, 0.3f, true);
if (button.hashString == hashString)
{
return button;
}
remove.dying = true;
}
refreshLine();
return null;
}
public void removeAll()
private void RemoveButton(gameUIbutton button)
{
if (HashedButtons.Count == 1)
if (button.gameObject != null)
{
if (HashedButtons[0].hashString == "swap")
{
return;
Program.I().destroy(button.gameObject, SCALE_ANIMATION_DURATION, true);
}
button.dying = true;
}
for (int i = 0; i < HashedButtons.Count; i++)
public void removeAll()
{
if (HashedButtons[i].gameObject != null)
if (ShouldKeepSwapButton()) return;
foreach (var button in hashedButtons)
{
Program.I().destroy(HashedButtons[i].gameObject, 0.3f, true);
}
HashedButtons[i].dying = true;
RemoveButton(button);
}
refreshLine();
}
void refreshLine()
{
int j = 0;
for (int i = 0; i < HashedButtons.Count; i++)
private bool ShouldKeepSwapButton()
{
if (!HashedButtons[i].dying)
return hashedButtons.Count == 1 && hashedButtons[0].hashString == "swap";
}
private void refreshLine()
{
j++;
line.SetActive(GetActiveButtonCount() > 0);
}
#endregion
#region Time Management
private void HandleTicking()
{
if (Program.TimePassed() - lastTickTime > TICK_INTERVAL)
{
lastTickTime = Program.TimePassed();
tick();
}
line.SetActive(j > 0);
}
int[] time = new int[2];
bool[] isTicking = new bool[2];
public void setTime(int player, int t)
{
if (player < 2)
{
if (player >= 2) return;
time[player] = t;
setTimeAbsolutely(player, t);
isTicking[player] = true;
isTicking[1 - player] = false;
}
public void setTimeStill(int player)
{
var timeLimit = Program.I().ocgcore.timeLimit;
time[0] = timeLimit;
time[1] = timeLimit;
setTimeAbsolutely(0, timeLimit);
setTimeAbsolutely(1, timeLimit);
isTicking[0] = false;
isTicking[1] = false;
setExcited(player);
UpdateTimeDisplayForStill(timeLimit);
}
private void UpdateTimeDisplayForStill(int timeLimit)
{
var displayText = timeLimit == 0 ? "infinite" : "paused";
me.api_timeHint.text = displayText;
opponent.api_timeHint.text = displayText;
}
public void setExcited(int player)
......@@ -333,182 +1084,156 @@ public class gameInfo : MonoBehaviour
}
}
public void setTimeStill(int player)
{
time[0] = Program.I().ocgcore.timeLimit;
time[1] = Program.I().ocgcore.timeLimit;
setTimeAbsolutely(0, Program.I().ocgcore.timeLimit);
setTimeAbsolutely(1, Program.I().ocgcore.timeLimit);
isTicking[0] = false;
isTicking[1] = false;
if (player == 0)
public bool amIdanger()
{
me.under.mainTexture = GameTextureManager.exBar;
opponent.under.mainTexture = GameTextureManager.bar;
return time[0] < Program.I().ocgcore.timeLimit / 3;
}
else
private void setTimeAbsolutely(int player, int t)
{
opponent.under.mainTexture = GameTextureManager.exBar;
me.under.mainTexture = GameTextureManager.bar;
var timeLimit = Program.I().ocgcore.timeLimit;
if (timeLimit == 0) return;
var timeRatio = (float)t / timeLimit;
var barComponent = player == 0 ? me : opponent;
var otherComponent = player == 0 ? opponent : me;
UpdateTimeDisplay(barComponent, otherComponent, t, timeLimit, timeRatio);
}
if (Program.I().ocgcore.timeLimit == 0)
private void UpdateTimeDisplay(barPngLoader activeBar, barPngLoader waitingBar, int currentTime, int timeLimit, float timeRatio)
{
me.api_timeHint.text = "infinite";
opponent.api_timeHint.text = "infinite";
}
else
if (activeBar?.api_timeHint == null || waitingBar?.api_timeHint == null || activeBar?.api_timeBar == null)
{
me.api_timeHint.text = "paused";
opponent.api_timeHint.text = "paused";
}
Program.DEBUGLOG("UpdateTimeDisplay: Required components are null");
return;
}
public bool amIdanger()
{
return time[0] < Program.I().ocgcore.timeLimit / 3;
activeBar.api_timeHint.text = $"{currentTime}/{timeLimit}";
waitingBar.api_timeHint.text = "waiting";
var targetX = activeBar.api_timeBar.width * (1f - timeRatio);
activeBar.api_timeBar.transform.DOKill();
activeBar.api_timeBar.transform.DOLocalMoveX(targetX, 1f);
}
void setTimeAbsolutely(int player, int t)
private void tick()
{
if (Program.I().ocgcore.timeLimit == 0)
for (int player = 0; player < 2; player++)
{
return;
}
if (player == 0)
if (isTicking[player] && time[player] > 0)
{
me.api_timeHint.text = t.ToString() + "/" + Program.I().ocgcore.timeLimit.ToString();
opponent.api_timeHint.text = "waiting";
time[player]--;
me.api_timeBar.transform.DOKill();
me.api_timeBar.transform.DOLocalMoveX((float)(me.api_timeBar.width) - (float)t / (float)Program.I().ocgcore.timeLimit * (float)(me.api_timeBar.width), 1f);
}
if (player == 1)
if (player == 0 && amIdanger() && Program.I().ocgcore != null)
{
opponent.api_timeHint.text = t.ToString() + "/" + Program.I().ocgcore.timeLimit.ToString();
me.api_timeHint.text = "waiting";
Program.I().ocgcore.dangerTicking();
}
opponent.api_timeBar.transform.DOKill();
opponent.api_timeBar.transform.DOLocalMoveX((float)(opponent.api_timeBar.width) - (float)t / (float)Program.I().ocgcore.timeLimit * (float)(opponent.api_timeBar.width), 1f);
setTimeAbsolutely(player, time[player]);
}
}
}
#endregion
#region Health and Status Management
public void realize()
{
me.api_healthHint.text = ((float)Program.I().ocgcore.life_0 > 0 ? Program.I().ocgcore.life_0 : 0).ToString();
opponent.api_healthHint.text = ((float)Program.I().ocgcore.life_1 > 0 ? Program.I().ocgcore.life_1 : 0).ToString();
me.api_name.text = Program.I().ocgcore.name_0_c;
opponent.api_name.text = Program.I().ocgcore.name_1_c;
me.api_face.mainTexture = UIHelper.getFace(Program.I().ocgcore.name_0_c);
opponent.api_face.mainTexture = UIHelper.getFace(Program.I().ocgcore.name_1_c);
// 玩家自己
// me.api_healthBar.transform.DOKill();
float myLpTargetX = (float)(me.api_healthBar.width) - getRealLife(Program.I().ocgcore.life_0) / ((float)Program.I().ocgcore.lpLimit) * (float)(me.api_healthBar.width);
me.api_healthBar.transform.DOLocalMoveX(myLpTargetX, 1f);
// 对手
// opponent.api_healthBar.transform.DOKill();
float opLpTargetX = (float)(opponent.api_healthBar.width) - getRealLife(Program.I().ocgcore.life_1) / ((float)Program.I().ocgcore.lpLimit) * (float)(opponent.api_healthBar.width);
opponent.api_healthBar.transform.DOLocalMoveX(opLpTargetX, 1f);
instance_lab.Clear();
if (Program.I().ocgcore.confirmedCards.Count > 0)
{
instance_lab.Add(GameStringHelper.yijingqueren);
UpdateHealthDisplay();
UpdatePlayerInfo();
UpdateHealthBars();
UpdateConfirmedCardsList();
}
foreach (var item in Program.I().ocgcore.confirmedCards)
private void UpdateHealthDisplay()
{
instance_lab.Add(item);
}
me.api_healthHint.text = Mathf.Max(Program.I().ocgcore.life_0, 0).ToString();
opponent.api_healthHint.text = Mathf.Max(Program.I().ocgcore.life_1, 0).ToString();
}
static float getRealLife(float in_)
{
if (in_ < 0)
private void UpdatePlayerInfo()
{
return 0;
me.api_name.text = Program.I().ocgcore.name_0_c;
opponent.api_name.text = Program.I().ocgcore.name_1_c;
me.api_face.mainTexture = UIHelper.getFace(Program.I().ocgcore.name_0_c);
opponent.api_face.mainTexture = UIHelper.getFace(Program.I().ocgcore.name_1_c);
}
if (in_ > Program.I().ocgcore.lpLimit)
private void UpdateHealthBars()
{
return Program.I().ocgcore.lpLimit;
}
return in_;
var lpLimit = Program.I().ocgcore.lpLimit;
UpdateHealthBar(me, Program.I().ocgcore.life_0, lpLimit);
UpdateHealthBar(opponent, Program.I().ocgcore.life_1, lpLimit);
}
void tick()
{
if (isTicking[0])
private void UpdateHealthBar(barPngLoader barLoader, float currentLife, float lpLimit)
{
if (time[0] > 0)
{
time[0]--;
var realLife = getRealLife(currentLife);
var lifeRatio = realLife / lpLimit;
var targetX = barLoader.api_healthBar.width * (1f - lifeRatio);
barLoader.api_healthBar.transform.DOLocalMoveX(targetX, 1f);
}
if (amIdanger())
{
if (Program.I().ocgcore != null)
private void UpdateConfirmedCardsList()
{
Program.I().ocgcore.dangerTicking();
}
}
setTimeAbsolutely(0, time[0]);
}
if (isTicking[1])
instance_lab.Clear();
var confirmedCards = Program.I().ocgcore.confirmedCards;
if (confirmedCards.Count > 0)
{
if (time[1] > 0)
instance_lab.Add(GameStringHelper.yijingqueren);
foreach (var item in confirmedCards)
{
time[1]--;
instance_lab.Add(item);
}
setTimeAbsolutely(1, time[1]);
}
}
public enum chainCondition
private static float getRealLife(float life)
{
standard, no, all, smart
var lpLimit = Program.I().ocgcore.lpLimit;
return Mathf.Clamp(life, 0, lpLimit);
}
#endregion
public void set_condition(chainCondition c)
#region Chain Condition Management
public void set_condition(chainCondition condition)
{
switch (c)
ResetAllToggles();
switch (condition)
{
case chainCondition.standard:
toggle_all.value = false;
toggle_smart.value = false;
toggle_ignore.value = false;
break;
case chainCondition.no:
toggle_all.value = false;
toggle_smart.value = false;
toggle_ignore.value = true;
break;
case chainCondition.all:
toggle_all.value = true;
toggle_smart.value = false;
toggle_ignore.value = false;
break;
case chainCondition.smart:
toggle_all.value = false;
toggle_smart.value = true;
toggle_ignore.value = false;
break;
case chainCondition.standard:
default:
// All toggles remain false for standard condition
break;
}
}
public chainCondition get_condition()
{
chainCondition res = chainCondition.standard;
if (toggle_ignore.value)
private void ResetAllToggles()
{
res = chainCondition.no;
}
if (toggle_smart.value)
{
res = chainCondition.smart;
toggle_ignore.value = false;
toggle_all.value = false;
toggle_smart.value = false;
}
if (toggle_all.value)
public chainCondition get_condition()
{
res = chainCondition.all;
}
return res;
if (toggle_ignore.value) return chainCondition.no;
if (toggle_smart.value) return chainCondition.smart;
if (toggle_all.value) return chainCondition.all;
return chainCondition.standard;
}
#endregion
}
using System;
using System.Collections.Generic;
using System.IO;
using DG.Tweening;
using UnityEngine;
using YGOSharp.OCGWrapper.Enums;
using DG.Tweening;
public class GameField : OCGobject
{
#region Private Fields
// P-Zone相关UI对象
[Header("P-Zone Numbers")]
public GameObject me_left_p_num;
public GameObject me_right_p_num;
public GameObject op_left_p_num;
public GameObject op_right_p_num;
GameObject p_hole_me = null;
GameObject p_hole_op = null;
Transform p_hole_mel = null;
Transform p_hole_opl = null;
Transform p_hole_mer = null;
Transform p_hole_opr = null;
// P-Zone洞穴效果
private GameObject p_hole_me = null;
private GameObject p_hole_op = null;
private Transform p_hole_mel = null;
private Transform p_hole_opl = null;
private Transform p_hole_mer = null;
private Transform p_hole_opr = null;
// 游戏阶段和状态
public phaser Phase = null;
public bool mePHole = false;
public bool opPHole = false;
// 雷电定位器列表
public List<thunder_locator> thunders = new List<thunder_locator>();
UILabel label = null;
List<gameHiddenButton> gameHiddenButtons = new List<gameHiddenButton>();
// UI组件
private UILabel label = null;
private readonly List<gameHiddenButton> gameHiddenButtons = new List<gameHiddenButton>();
// 文本网格组件
[Header("Location Text Meshes")]
public TMPro.TextMeshPro LOCATION_DECK_0;
public TMPro.TextMeshPro LOCATION_EXTRA_0;
public TMPro.TextMeshPro LOCATION_GRAVE_0;
......@@ -37,83 +46,141 @@ public class GameField : OCGobject
public TMPro.TextMeshPro LOCATION_GRAVE_1;
public TMPro.TextMeshPro LOCATION_REMOVED_1;
UITexture leftT;
UITexture midT;
UITexture rightT;
UITexture phaseTexure;
// 场地纹理
private UITexture leftT;
private UITexture midT;
private UITexture rightT;
private UITexture phaseTexure;
// 阶段回调返回值
public int retOfbp = -1;
void onBP()
{
var m = new BinaryMaster();
m.writer.Write(retOfbp);
Program.I().ocgcore.sendReturn(m.get());
}
public int retOfEp = -1;
void onEP()
public int retOfMp = -1;
// 场地状态
private bool P = false;
private bool prelong = false;
private const float BASE_FIELD_HEIGHT = 819f;
private float fieldSprite_height = BASE_FIELD_HEIGHT;
public float delat = 0;
private float prereal = 0;
public bool isLong = false;
private readonly int[] fieldCode = new int[2] { 0, 0 };
// 黑洞效果
private GameObject cookie_dark_hole;
private int overCount = 0;
// 提示文本
private string currentString = "";
private GameObject big_string;
// 场地禁用容器
private readonly List<FieldDisabledContainer> field_disabled_containers = new List<FieldDisabledContainer>();
public ph currentPhase;
#endregion
#region Public Enums
public enum ph { dp, sp, mp1, bp, mp2, ep };
#endregion
#region Private Classes
private class FieldDisabledContainer
{
var m = new BinaryMaster();
m.writer.Write(retOfEp);
Program.I().ocgcore.sendReturn(m.get());
public GPS p;
public Vector3 position;
public GameObject game_object;
public bool disabled = false;
}
#endregion
public int retOfMp = -1;
void onMP()
#region Constructor
public GameField()
{
var m = new BinaryMaster();
m.writer.Write(retOfMp);
Program.I().ocgcore.sendReturn(m.get());
InitializeGameObject();
InitializePNumbers();
InitializeGameHiddenButtons();
InitializeTextMeshes();
InitializeLabel();
loadNewField();
Program.I().ocgcore.AddUpdateAction_s(Update);
overCount = 0;
}
public GameField()
private void InitializeGameObject()
{
gameObject = create(Program.I().new_ocgcore_field, getGoodPosition(), Vector3.zero, false, Program.I().ui_container_3d, false);
UIHelper.getByName(gameObject, "obj_0").transform.localScale = Vector3.zero;
UIHelper.getByName(gameObject, "obj_1").transform.localScale = Vector3.zero;
Phase = gameObject.GetComponentInChildren<phaser>();
Phase.bpAction = onBP;
Phase.epAction = onEP;
Phase.mp2Action = onMP;
InitializeTextures();
}
private void InitializeTextures()
{
leftT = UIHelper.getByName<UITexture>(gameObject, "leftT");
midT = UIHelper.getByName<UITexture>(gameObject, "midT");
rightT = UIHelper.getByName<UITexture>(gameObject, "rightT");
phaseTexure = UIHelper.getByName<UITexture>(gameObject, "phaseT");
midT.border = new Vector4(0, 500, 0, 230);
// 清空纹理
leftT.mainTexture = null;
midT.mainTexture = null;
rightT.mainTexture = null;
phaseTexure.mainTexture = null;
}
private void InitializePNumbers()
{
me_left_p_num = create(Program.I().mod_ocgcore_number);
me_right_p_num = create(Program.I().mod_ocgcore_number);
op_left_p_num = create(Program.I().mod_ocgcore_number);
op_right_p_num = create(Program.I().mod_ocgcore_number);
}
Program.I().ocgcore.AddUpdateAction_s(Update);
gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Deck, 0));
gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Extra, 0));
gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Grave, 0));
gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Removed, 0));
gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Deck, 1));
gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Extra, 1));
gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Grave, 1));
gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Removed, 1));
LOCATION_DECK_0 = create(Program.I().new_ui_textMesh, Vector3.zero, new Vector3(60, 0, 0)).GetComponent<TMPro.TextMeshPro>();
LOCATION_EXTRA_0 = create(Program.I().new_ui_textMesh, Vector3.zero, new Vector3(60, 0, 0)).GetComponent<TMPro.TextMeshPro>();
LOCATION_GRAVE_0 = create(Program.I().new_ui_textMesh, Vector3.zero, new Vector3(60, 0, 0)).GetComponent<TMPro.TextMeshPro>();
LOCATION_REMOVED_0 = create(Program.I().new_ui_textMesh, Vector3.zero, new Vector3(60, 0, 0)).GetComponent<TMPro.TextMeshPro>();
private void InitializeGameHiddenButtons()
{
var locations = new[] { CardLocation.Deck, CardLocation.Extra, CardLocation.Grave, CardLocation.Removed };
for (int player = 0; player <= 1; player++)
{
foreach (var location in locations)
{
gameHiddenButtons.Add(new gameHiddenButton(location, player));
}
}
}
private void InitializeTextMeshes()
{
var textMeshRotation = new Vector3(60, 0, 0);
LOCATION_DECK_1 = create(Program.I().new_ui_textMesh, Vector3.zero, new Vector3(60, 0, 0)).GetComponent<TMPro.TextMeshPro>();
LOCATION_EXTRA_1 = create(Program.I().new_ui_textMesh, Vector3.zero, new Vector3(60, 0, 0)).GetComponent<TMPro.TextMeshPro>();
LOCATION_GRAVE_1 = create(Program.I().new_ui_textMesh, Vector3.zero, new Vector3(60, 0, 0)).GetComponent<TMPro.TextMeshPro>();
LOCATION_REMOVED_1 = create(Program.I().new_ui_textMesh, Vector3.zero, new Vector3(60, 0, 0)).GetComponent<TMPro.TextMeshPro>();
LOCATION_DECK_0 = CreateTextMesh(textMeshRotation);
LOCATION_EXTRA_0 = CreateTextMesh(textMeshRotation);
LOCATION_GRAVE_0 = CreateTextMesh(textMeshRotation);
LOCATION_REMOVED_0 = CreateTextMesh(textMeshRotation);
LOCATION_DECK_1 = CreateTextMesh(textMeshRotation);
LOCATION_EXTRA_1 = CreateTextMesh(textMeshRotation);
LOCATION_GRAVE_1 = CreateTextMesh(textMeshRotation);
LOCATION_REMOVED_1 = CreateTextMesh(textMeshRotation);
}
private TMPro.TextMeshPro CreateTextMesh(Vector3 rotation)
{
return create(Program.I().new_ui_textMesh, Vector3.zero, rotation).GetComponent<TMPro.TextMeshPro>();
}
private void InitializeLabel()
{
label = create(Program.I().mod_simple_ngui_text, new Vector3(0, 0, -14.5f), new Vector3(60, 0, 0), false, Program.I().ui_container_3d, false).GetComponent<UILabel>();
label.fontSize = 40;
label.overflowMethod = UILabel.Overflow.ShrinkContent;
......@@ -122,281 +189,367 @@ public class GameField : OCGobject
label.height = 40;
label.transform.localScale = new Vector3(0.03f, 0.03f, 0.03f);
label.text = "";
overCount = 0;
loadNewField();
}
#endregion
public void loadOldField()
#region Phase Callbacks
private void onBP()
{
if (File.Exists("textures/field2.png"))//YGOMobile Paths
var m = new BinaryMaster();
m.writer.Write(retOfbp);
Program.I().ocgcore.sendReturn(m.get());
}
private void onEP()
{
Texture2D textureField = UIHelper.getTexture2D("textures/field2.png");//YGOMobile Paths
Texture2D[] textureFieldSliced = UIHelper.sliceField(textureField);
leftT.mainTexture = textureFieldSliced[0];
midT.mainTexture = textureFieldSliced[1];
rightT.mainTexture = textureFieldSliced[2];
var m = new BinaryMaster();
m.writer.Write(retOfEp);
Program.I().ocgcore.sendReturn(m.get());
}
else
private void onMP()
{
leftT.mainTexture = new Texture2D(100, 100);
midT.mainTexture = new Texture2D(100, 100);
rightT.mainTexture = new Texture2D(100, 100);
var m = new BinaryMaster();
m.writer.Write(retOfMp);
Program.I().ocgcore.sendReturn(m.get());
}
#endregion
#region Field Loading Methods
public void loadOldField()
{
LoadFieldTexture("textures/field2.png", false);
phaseTexure.mainTexture = GameTextureManager.phase;
gameObject.GetComponentInChildren<lazyBTNMOVER>().shift(false);
}
public void loadNewField()
{
if (File.Exists("textures/field3.png"))//YGOMobile Paths
LoadFieldTexture("textures/field3.png", true);
phaseTexure.mainTexture = null;
gameObject.GetComponentInChildren<lazyBTNMOVER>().shift(true);
}
private void LoadFieldTexture(string texturePath, bool isNewField)
{
if (File.Exists(texturePath))
{
Texture2D textureField = UIHelper.getTexture2D("textures/field3.png");//YGOMobile Paths
Texture2D textureField = UIHelper.getTexture2D(texturePath);
Texture2D[] textureFieldSliced = UIHelper.sliceField(textureField);
leftT.mainTexture = textureFieldSliced[0];
midT.mainTexture = textureFieldSliced[1];
rightT.mainTexture = textureFieldSliced[2];
SetFieldTextures(textureFieldSliced);
}
else
{
SetDefaultTextures();
}
}
private void SetFieldTextures(Texture2D[] textures)
{
leftT.mainTexture = textures[0];
midT.mainTexture = textures[1];
rightT.mainTexture = textures[2];
}
private void SetDefaultTextures()
{
leftT.mainTexture = new Texture2D(100, 100);
midT.mainTexture = new Texture2D(100, 100);
rightT.mainTexture = new Texture2D(100, 100);
}
phaseTexure.mainTexture = null;
gameObject.GetComponentInChildren<lazyBTNMOVER>().shift(true);
}
#endregion
bool P = false;
#region P-Zone Management
public void relocatePnums(bool p)
{
if (Program.I().ocgcore.MasterRule >= 4)
{
P = p;
if (p)
var scale = new Vector3(2, 2, 2);
if (Program.I().ocgcore.MasterRule >= 4)
{
me_left_p_num.transform.localScale = new Vector3(2, 2, 2);
me_left_p_num.transform.eulerAngles = new Vector3(30, -45, 0);
me_right_p_num.transform.localScale = new Vector3(2, 2, 2);
me_right_p_num.transform.eulerAngles = new Vector3(30, 45, 0);
op_left_p_num.transform.localScale = new Vector3(2, 2, 2);
op_left_p_num.transform.eulerAngles = new Vector3(0, -45, 0);
op_right_p_num.transform.localScale = new Vector3(2, 2, 2);
op_right_p_num.transform.eulerAngles = new Vector3(0, 45, 0);
SetPNumsTransformMasterRule4(p, scale);
}
else
{
me_left_p_num.transform.localScale = new Vector3(2, 2, 2);
me_left_p_num.transform.eulerAngles = new Vector3(90, 0, 0);
me_right_p_num.transform.localScale = new Vector3(2, 2, 2);
me_right_p_num.transform.eulerAngles = new Vector3(90, 0, 0);
op_left_p_num.transform.localScale = new Vector3(2, 2, 2);
op_left_p_num.transform.eulerAngles = new Vector3(90, 0, 0);
op_right_p_num.transform.localScale = new Vector3(2, 2, 2);
op_right_p_num.transform.eulerAngles = new Vector3(90, 0, 0);
SetPNumsTransformLegacy(p, scale);
}
}
else
{
P = p;
if (p)
private void SetPNumsTransformMasterRule4(bool p, Vector3 scale)
{
me_left_p_num.transform.localScale = new Vector3(2, 2, 2);
me_left_p_num.transform.eulerAngles = new Vector3(0, -45, 0);
me_right_p_num.transform.localScale = new Vector3(2, 2, 2);
me_right_p_num.transform.eulerAngles = new Vector3(0, 45, 0);
op_left_p_num.transform.localScale = new Vector3(2, 2, 2);
op_left_p_num.transform.eulerAngles = new Vector3(0, -45, 0);
op_right_p_num.transform.localScale = new Vector3(2, 2, 2);
op_right_p_num.transform.eulerAngles = new Vector3(0, 45, 0);
var meRotation = p ? new Vector3(30, -45, 0) : new Vector3(90, 0, 0);
var meRightRotation = p ? new Vector3(30, 45, 0) : new Vector3(90, 0, 0);
var opRotation = p ? new Vector3(0, -45, 0) : new Vector3(90, 0, 0);
var opRightRotation = p ? new Vector3(0, 45, 0) : new Vector3(90, 0, 0);
SetPNumTransform(me_left_p_num, scale, meRotation);
SetPNumTransform(me_right_p_num, scale, meRightRotation);
SetPNumTransform(op_left_p_num, scale, opRotation);
SetPNumTransform(op_right_p_num, scale, opRightRotation);
}
else
private void SetPNumsTransformLegacy(bool p, Vector3 scale)
{
me_left_p_num.transform.localScale = new Vector3(2, 2, 2);
me_left_p_num.transform.eulerAngles = new Vector3(90, 0, 0);
me_right_p_num.transform.localScale = new Vector3(2, 2, 2);
me_right_p_num.transform.eulerAngles = new Vector3(90, 0, 0);
op_left_p_num.transform.localScale = new Vector3(2, 2, 2);
op_left_p_num.transform.eulerAngles = new Vector3(90, 0, 0);
op_right_p_num.transform.localScale = new Vector3(2, 2, 2);
op_right_p_num.transform.eulerAngles = new Vector3(90, 0, 0);
}
}
var rotation = p ? new Vector3(0, -45, 0) : new Vector3(90, 0, 0);
var rightRotation = p ? new Vector3(0, 45, 0) : new Vector3(90, 0, 0);
SetPNumTransform(me_left_p_num, scale, rotation);
SetPNumTransform(me_right_p_num, scale, rightRotation);
SetPNumTransform(op_left_p_num, scale, rotation);
SetPNumTransform(op_right_p_num, scale, rightRotation);
}
public void dispose()
private void SetPNumTransform(GameObject obj, Vector3 scale, Vector3 rotation)
{
Program.I().ocgcore.RemoveUpdateAction_s(Update);
obj.transform.localScale = scale;
obj.transform.eulerAngles = rotation;
}
#endregion
private static Vector3 getGoodPosition()
#region Update Method
public void Update()
{
return new Vector3(0, 0, 0);
UpdateFieldSize();
UpdateTextMeshPositions();
UpdateLabelPosition();
UpdatePHoleEffects();
UpdatePNumberPositions();
UpdateDisabledContainers();
}
bool prelong = false;
float fieldSprite_height = 819f;
public float delat = 0;
float prereal = 0;
public void Update()
private void UpdateFieldSize()
{
delat = ((isLong ? (40f + 60f * ((1.21f - Program.fieldSize) / 0.21f)) : 0f)) / 110f * 5f;
fieldSprite_height += ((isLong ? (819f + 40f + 60f * ((1.21f - Program.fieldSize) / 0.21f)) : 819f) - fieldSprite_height) * (Program.deltaTime * 4);
delat = (isLong ? (40f + 60f * ((1.21f - Program.fieldSize) / 0.21f)) : 0f) / 110f * 5f;
float targetHeight = isLong ? (BASE_FIELD_HEIGHT + 40f + 60f * ((1.21f - Program.fieldSize) / 0.21f)) : BASE_FIELD_HEIGHT;
fieldSprite_height += (targetHeight - fieldSprite_height) * (Program.deltaTime * 4);
midT.height = (int)fieldSprite_height;
Vector3 position = midT.gameObject.transform.localPosition;
position.y = fieldSprite_height - 819f;
position.y /= 2;
position.y = (fieldSprite_height - BASE_FIELD_HEIGHT) / 2;
midT.gameObject.transform.localPosition = position;
UpdateGameObjectTransform();
UpdateSideTextures();
}
private void UpdateGameObjectTransform()
{
gameObject.transform.localPosition = getGoodPosition();
gameObject.transform.localScale = new Vector3(Program.fieldSize, Program.fieldSize, Program.fieldSize);
leftT.transform.localScale = new Vector3(1f / Program.fieldSize, 1f / Program.fieldSize, 1f / Program.fieldSize);
leftT.transform.localPosition = new Vector3(((-1f + 1f / Program.fieldSize) * (float)(leftT.width)) / 3.5f, 0, 0);
rightT.transform.localScale = new Vector3(1f / Program.fieldSize, 1f / Program.fieldSize, 1f / Program.fieldSize);
rightT.transform.localPosition = new Vector3(((1f - 1f / Program.fieldSize) * (float)(rightT.width)) / 3.5f, 0, 0);
}
relocateTextMesh(LOCATION_DECK_0, 0, CardLocation.Deck, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_EXTRA_0, 0, CardLocation.Extra, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_REMOVED_0, 0, CardLocation.Removed, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_GRAVE_0, 0, CardLocation.Grave, new Vector3(0, 0, -3f));
private void UpdateSideTextures()
{
float scale = 1f / Program.fieldSize;
leftT.transform.localScale = new Vector3(scale, scale, scale);
leftT.transform.localPosition = new Vector3(((-1f + scale) * leftT.width) / 3.5f, 0, 0);
rightT.transform.localScale = new Vector3(scale, scale, scale);
rightT.transform.localPosition = new Vector3(((1f - scale) * rightT.width) / 3.5f, 0, 0);
}
relocateTextMesh(LOCATION_DECK_1, 1, CardLocation.Deck, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_EXTRA_1, 1, CardLocation.Extra, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_REMOVED_1, 1, CardLocation.Removed, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_GRAVE_1, 1, CardLocation.Grave, new Vector3(0, 0, -3f));
private void UpdateTextMeshPositions()
{
var offset = new Vector3(0, 0, -3f);
relocateTextMesh(LOCATION_DECK_0, 0, CardLocation.Deck, offset);
relocateTextMesh(LOCATION_EXTRA_0, 0, CardLocation.Extra, offset);
relocateTextMesh(LOCATION_REMOVED_0, 0, CardLocation.Removed, offset);
relocateTextMesh(LOCATION_GRAVE_0, 0, CardLocation.Grave, offset);
relocateTextMesh(LOCATION_DECK_1, 1, CardLocation.Deck, offset);
relocateTextMesh(LOCATION_EXTRA_1, 1, CardLocation.Extra, offset);
relocateTextMesh(LOCATION_REMOVED_1, 1, CardLocation.Removed, offset);
relocateTextMesh(LOCATION_GRAVE_1, 1, CardLocation.Grave, offset);
}
private void UpdateLabelPosition()
{
label.transform.localPosition = new Vector3(-5f * (Program.fieldSize - 1), 0, -15.5f * Program.fieldSize);
}
private void UpdatePHoleEffects()
{
HandlePHoleCreation();
UpdatePHolePositions();
}
private void HandlePHoleCreation()
{
HandleMePHole();
HandleOpPHole();
if (prelong != isLong)
{
prelong = isLong;
for (int i = 0; i < field_disabled_containers.Count; i++)
{
if (field_disabled_containers[i].p.location == (UInt32)CardLocation.SpellZone)
UpdateDisabledSpellZonePositions();
}
}
private void HandleMePHole()
{
if (field_disabled_containers[i].p.controller == 1)
if (mePHole && p_hole_me == null)
{
field_disabled_containers[i].position = Program.I().ocgcore.get_point_worldposition(field_disabled_containers[i].p);
if (field_disabled_containers[i].game_object != null)
CreatePHole(ref p_hole_me, ref p_hole_mel, ref p_hole_mer);
}
else if (!mePHole && p_hole_me != null)
{
field_disabled_containers[i].game_object.transform.position = field_disabled_containers[i].position;
DestroyPHole(ref p_hole_me, ref p_hole_mel, ref p_hole_mer);
}
}
private void HandleOpPHole()
{
if (opPHole && p_hole_op == null)
{
CreatePHole(ref p_hole_op, ref p_hole_opl, ref p_hole_opr);
}
else if (!opPHole && p_hole_op != null)
{
DestroyPHole(ref p_hole_op, ref p_hole_opl, ref p_hole_opr);
}
}
float real = (Program.fieldSize - 1) * 0.9f + 1f;
if (mePHole)
private void CreatePHole(ref GameObject hole, ref Transform left, ref Transform right)
{
if (p_hole_me == null)
hole = create(Program.I().mod_ocgcore_ss_p_idle_effect, Vector3.zero);
left = hole.transform.Find("l");
right = hole.transform.Find("r");
prereal = 0;
}
private void DestroyPHole(ref GameObject hole, ref Transform left, ref Transform right)
{
p_hole_me = create(Program.I().mod_ocgcore_ss_p_idle_effect, new Vector3(0, 0, 0));
p_hole_mel = p_hole_me.transform.Find("l");
p_hole_mer = p_hole_me.transform.Find("r");
destroy(hole, 0, false, true);
hole = null;
left = null;
right = null;
prereal = 0;
}
private void UpdatePHolePositions()
{
float real = (Program.fieldSize - 1) * 0.9f + 1f;
if (Mathf.Approximately(prereal, real)) return;
prereal = real;
if (Program.I().ocgcore.MasterRule >= 4)
{
UpdatePHolePositionsMasterRule4(real);
}
else
{
if (p_hole_me != null)
{
destroy(p_hole_me, 0, false, true);
p_hole_mel = null;
p_hole_mer = null;
prereal = 0;
UpdatePHolePositionsLegacy(real);
}
}
if (opPHole)
{
if (p_hole_op == null)
private void UpdatePHolePositionsMasterRule4(float real)
{
p_hole_op = create(Program.I().mod_ocgcore_ss_p_idle_effect, new Vector3(0, 0, 0));
p_hole_opl = p_hole_op.transform.Find("l");
p_hole_opr = p_hole_op.transform.Find("r");
prereal = 0;
UpdatePHolePosition(p_hole_mel, p_hole_mer, new Vector3(-10.1f * real, 0, -11.5f * real), new Vector3(9.62f * real, 0, -11.5f * real));
UpdatePHolePosition(p_hole_opl, p_hole_opr, new Vector3(-10.1f * real, 0, 11.5f * real), new Vector3(9.62f * real, 0, 11.5f * real));
}
private void UpdatePHolePositionsLegacy(float real)
{
UpdatePHolePosition(p_hole_mel, p_hole_mer, new Vector3(-15.2f * real, 0, -9f), new Vector3(14.65f * real, 0, -9f));
UpdatePHolePosition(p_hole_opl, p_hole_opr, new Vector3(-15.2f * real, 0, 9f), new Vector3(14.65f * real, 0, 9f));
}
else
private void UpdatePHolePosition(Transform left, Transform right, Vector3 leftPos, Vector3 rightPos)
{
if (p_hole_op != null)
if (left != null && right != null)
{
destroy(p_hole_op, 0, false, true);
p_hole_opl = null;
p_hole_opr = null;
prereal = 0;
left.localPosition = leftPos;
right.localPosition = rightPos;
}
}
if (prereal != real)
private void UpdatePNumberPositions()
{
prereal = real;
float real = (Program.fieldSize - 1) * 0.9f + 1f;
if (Program.I().ocgcore.MasterRule >= 4)
{
if (p_hole_mel != null && p_hole_mer != null)
{
p_hole_mel.localPosition = new Vector3(-10.1f * real, 0, -11.5f * real);
p_hole_mer.localPosition = new Vector3(9.62f * real, 0, -11.5f * real);
UpdatePNumberPositionsMasterRule4(real);
}
if (p_hole_opl != null && p_hole_opr != null)
else
{
p_hole_opl.localPosition = new Vector3(-10.1f * real, 0, 11.5f * real);
p_hole_opr.localPosition = new Vector3(9.62f * real, 0, 11.5f * real);
UpdatePNumberPositionsLegacy(real);
}
}
else
private void UpdatePNumberPositionsMasterRule4(float real)
{
if (p_hole_mel != null && p_hole_mer != null)
if (P)
{
p_hole_mel.localPosition = new Vector3(-15.2f * real, 0, -9f);
p_hole_mer.localPosition = new Vector3(14.65f * real, 0, -9f);
SetPNumberPosition(me_left_p_num, new Vector3(-10.1f * real + 1, 5, -11.5f * real - 1), -3f);
SetPNumberPosition(me_right_p_num, new Vector3(9.62f * real - 1, 5, -11.5f * real - 1), -3f);
SetPNumberPosition(op_left_p_num, new Vector3(-10.1f * real + 1, 5, 11.5f * real - 1), -3f);
SetPNumberPosition(op_right_p_num, new Vector3(9.62f * real - 1, 5, 11.5f * real - 1), -3f);
}
if (p_hole_opl != null && p_hole_opr != null)
else
{
p_hole_opl.localPosition = new Vector3(-15.2f * real, 0, 9f);
p_hole_opr.localPosition = new Vector3(14.65f * real, 0, 9f);
SetPNumberPosition(me_left_p_num, new Vector3(-10.1f * real, 0, -11.5f * real), -1f);
SetPNumberPosition(me_right_p_num, new Vector3(9.62f * real, 0, -11.5f * real), -1f);
SetPNumberPosition(op_left_p_num, new Vector3(-10.1f * real, 0, 11.5f * real), -1f);
SetPNumberPosition(op_right_p_num, new Vector3(9.62f * real, 0, 11.5f * real), -1f);
}
}
}
if (Program.I().ocgcore.MasterRule >= 4)
private void UpdatePNumberPositionsLegacy(float real)
{
if (P)
{
me_left_p_num.transform.position = UIHelper.getCamGoodPosition(new Vector3(-10.1f * real + 1, 5, -11.5f * real - 1), -3f);
me_right_p_num.transform.position = UIHelper.getCamGoodPosition(new Vector3(9.62f * real - 1, 5, -11.5f * real - 1), -3f);
op_left_p_num.transform.position = UIHelper.getCamGoodPosition(new Vector3(-10.1f * real + 1, 5, 11.5f * real - 1), -3f);
op_right_p_num.transform.position = UIHelper.getCamGoodPosition(new Vector3(9.62f * real - 1, 5, 11.5f * real - 1), -3f);
SetPNumberPosition(me_left_p_num, new Vector3(-15.2f * real, 5, -10f), -3f);
SetPNumberPosition(me_right_p_num, new Vector3(14.65f * real, 5, -10f), -3f);
SetPNumberPosition(op_left_p_num, new Vector3(-15.2f * real, 5, 8f), -3f);
SetPNumberPosition(op_right_p_num, new Vector3(14.65f * real, 5, 8f), -3f);
}
else
{
me_left_p_num.transform.position = UIHelper.getCamGoodPosition(new Vector3(-10.1f * real, 0, -11.5f * real), -1f);
me_right_p_num.transform.position = UIHelper.getCamGoodPosition(new Vector3(9.62f * real, 0, -11.5f * real), -1f);
op_left_p_num.transform.position = UIHelper.getCamGoodPosition(new Vector3(-10.1f * real, 0, 11.5f * real), -1f);
op_right_p_num.transform.position = UIHelper.getCamGoodPosition(new Vector3(9.62f * real, 0, 11.5f * real), -1f);
SetPNumberPosition(me_left_p_num, new Vector3(-15.2f * real, 0f, -9f), -1f);
SetPNumberPosition(me_right_p_num, new Vector3(14.65f * real, 0f, -9f), -1f);
SetPNumberPosition(op_left_p_num, new Vector3(-15.2f * real, 0f, 9f), -1f);
SetPNumberPosition(op_right_p_num, new Vector3(14.65f * real, 0f, 9f), -1f);
}
}
else
private void SetPNumberPosition(GameObject obj, Vector3 worldPos, float offset)
{
if (P)
obj.transform.position = UIHelper.getCamGoodPosition(worldPos, offset);
}
private void UpdateDisabledContainers()
{
if (prelong != isLong)
{
me_left_p_num.transform.position = UIHelper.getCamGoodPosition(new Vector3(-15.2f * real, 5, -10f), -3f);
me_right_p_num.transform.position = UIHelper.getCamGoodPosition(new Vector3(14.65f * real, 5, -10f), -3f);
op_left_p_num.transform.position = UIHelper.getCamGoodPosition(new Vector3(-15.2f * real, 5, 8f), -3f);
op_right_p_num.transform.position = UIHelper.getCamGoodPosition(new Vector3(14.65f * real, 5, 8f), -3f);
UpdateDisabledSpellZonePositions();
}
else
}
private void UpdateDisabledSpellZonePositions()
{
me_left_p_num.transform.position = UIHelper.getCamGoodPosition(new Vector3(-15.2f * real, 0f, -9f), -1f);
me_right_p_num.transform.position = UIHelper.getCamGoodPosition(new Vector3(14.65f * real, 0f, -9f), -1f);
op_left_p_num.transform.position = UIHelper.getCamGoodPosition(new Vector3(-15.2f * real, 0f, 9f), -1f);
op_right_p_num.transform.position = UIHelper.getCamGoodPosition(new Vector3(14.65f * real, 0f, 9f), -1f);
foreach (var container in field_disabled_containers)
{
if (container.p.location == (UInt32)CardLocation.SpellZone && container.p.controller == 1)
{
container.position = Program.I().ocgcore.get_point_worldposition(container.p);
if (container.game_object != null)
{
container.game_object.transform.position = container.position;
}
}
}
}
#endregion
#region Utility Methods
public void dispose()
{
Program.I().ocgcore.RemoveUpdateAction_s(Update);
}
private static Vector3 getGoodPosition()
{
return Vector3.zero;
}
private static void relocateTextMesh(TMPro.TextMeshPro obj, uint con, CardLocation loc, Vector3 poi)
......@@ -407,83 +560,81 @@ public class GameField : OCGobject
location = (UInt32)loc
}) + poi, -2);
}
#endregion
public bool isLong = false;
int[] fieldCode = new int[2] { 0, 0 };
#region Field Code Management
public void set(int player, int code)
{
if (player >= 0) if (player < 2)
{
if (fieldCode[player] != code)
{
if (player < 0 || player >= 2) return;
if (fieldCode[player] == code) return;
fieldCode[player] = code;
if (code > 0)
{
Texture2D tex = null;
if (File.Exists("picture/field/" + code.ToString() + ".png"))
{
tex = UIHelper.getTexture2D("picture/field/" + code.ToString() + ".png");
}
else if (File.Exists("expansions/pics/field/" + code.ToString() + ".png"))
{
tex = UIHelper.getTexture2D("expansions/pics/field/" + code.ToString() + ".png");
SetFieldCode(player, code);
}
else if (File.Exists("pics/field/" + code.ToString() + ".png"))
{
tex = UIHelper.getTexture2D("pics/field/" + code.ToString() + ".png");
}
else if (File.Exists("picture/field/" + code.ToString() + ".jpg"))
else
{
tex = UIHelper.getTexture2D("picture/field/" + code.ToString() + ".jpg");
HideFieldObject(player);
}
else if (File.Exists("expansions/pics/field/" + code.ToString() + ".jpg"))
{
tex = UIHelper.getTexture2D("expansions/pics/field/" + code.ToString() + ".jpg");
}
else
private void SetFieldCode(int player, int code)
{
tex = UIHelper.getTexture2D("pics/field/" + code.ToString() + ".jpg");
}
Texture2D tex = LoadFieldCodeTexture(code);
var obj = UIHelper.getByName(gameObject, $"obj_{player}");
if (tex != null)
{
UIHelper.getByName<UITexture>(gameObject, "field_" + player.ToString()).mainTexture = tex;
var obj = UIHelper.getByName(gameObject, "obj_" + player.ToString());
DOTween.Kill(obj.transform);
obj.transform.DOScale(new Vector3(1, 1, 1), 0.5f);
UIHelper.getByName<UITexture>(gameObject, $"field_{player}").mainTexture = tex;
AnimateFieldObject(obj, Vector3.one);
}
else
{
var obj = UIHelper.getByName(gameObject, "obj_" + player.ToString());
DOTween.Kill(obj.transform);
obj.transform.DOScale(Vector3.zero, 0.5f);
AnimateFieldObject(obj, Vector3.zero);
}
}
else
private Texture2D LoadFieldCodeTexture(int code)
{
var obj = UIHelper.getByName(gameObject, "obj_" + player.ToString());
DOTween.Kill(obj.transform);
obj.transform.DOScale(Vector3.zero, 0.5f);
}
string[] paths = {
$"picture/field/{code}.png",
$"expansions/pics/field/{code}.png",
$"pics/field/{code}.png",
$"picture/field/{code}.jpg",
$"expansions/pics/field/{code}.jpg",
$"pics/field/{code}.jpg"
};
foreach (string path in paths)
{
if (File.Exists(path))
{
return UIHelper.getTexture2D(path);
}
}
return null;
}
GameObject cookie_dark_hole;
int overCount = 0;
public void shiftBlackHole(int a, Vector3 v = default(Vector3))
{
overCount += a;
if (overCount < 0)
private void HideFieldObject(int player)
{
overCount = 0;
var obj = UIHelper.getByName(gameObject, $"obj_{player}");
AnimateFieldObject(obj, Vector3.zero);
}
if (overCount > 2)
private void AnimateFieldObject(GameObject obj, Vector3 targetScale)
{
overCount = 2;
DOTween.Kill(obj.transform);
obj.transform.DOScale(targetScale, 0.5f);
}
#endregion
#region Black Hole Effects
public void shiftBlackHole(int a, Vector3 v = default(Vector3))
{
overCount = Mathf.Clamp(overCount + a, 0, 2);
if (overCount == 2)
{
shiftBlackHole(true, v);
......@@ -494,293 +645,277 @@ public class GameField : OCGobject
{
if (on)
{
if (cookie_dark_hole == null)
CreateBlackHole(v);
}
else
{
DestroyBlackHole(v);
}
}
private void CreateBlackHole(Vector3 position)
{
if (cookie_dark_hole != null) return;
Program.I().mod_ocgcore_ss_dark_hole.transform.localScale = Vector3.zero;
cookie_dark_hole = create(Program.I().mod_ocgcore_ss_dark_hole, v);
cookie_dark_hole = create(Program.I().mod_ocgcore_ss_dark_hole, position);
cookie_dark_hole.transform.DOScale(new Vector3(6, 6, 6), 1f);
cookie_dark_hole.transform.eulerAngles = new Vector3(90, 0, 0);
}
}
else
{
if (cookie_dark_hole != null)
private void DestroyBlackHole(Vector3 targetPosition)
{
if (cookie_dark_hole == null) return;
Sequence seq = DOTween.Sequence();
seq.AppendInterval(1f); // 延迟1秒
seq.AppendInterval(1f);
seq.Append(cookie_dark_hole.transform.DOScale(Vector3.zero, 1f));
seq.Join(cookie_dark_hole.transform.DOMove(v, 1f));
seq.Join(cookie_dark_hole.transform.DOMove(targetPosition, 1f));
destroy(cookie_dark_hole, 2.4f); // 延迟1秒 + 动画1秒 + 缓冲0.4秒
cookie_dark_hole = null; // 避免重复销毁
}
}
destroy(cookie_dark_hole, 2.4f);
cookie_dark_hole = null;
}
#endregion
string currentString = "";
#region Hint System
public void setHint(string hint)
{
currentString = "T" + Program.I().ocgcore.turns.ToString() + " " + hint;
currentString = $"T{Program.I().ocgcore.turns} {hint}";
realize();
}
public void setHintLogical(string hint)
{
currentString = "T" + Program.I().ocgcore.turns.ToString() + " " + hint;
currentString = $"T{Program.I().ocgcore.turns} {hint}";
}
GameObject big_string;
#endregion
#region Animation Methods
public void animation_show_big_string(Texture2D tex, bool only = false)
{
if (Ocgcore.inSkiping)
{
return;
}
if (Ocgcore.inSkiping) return;
if (only)
{
destroy(big_string);
}
big_string = create(Program.I().New_phase, Program.I().ocgcore.centre(), Vector3.zero, false, Program.I().ui_main_2d, true, new Vector3(Screen.height / 1000f * Program.fieldSize, Screen.height / 1000f * Program.fieldSize, Screen.height / 1000f * Program.fieldSize));
float scale = Screen.height / 1000f * Program.fieldSize;
big_string = create(Program.I().New_phase, Program.I().ocgcore.centre(), Vector3.zero, false, Program.I().ui_main_2d, true, new Vector3(scale, scale, scale));
big_string.GetComponentInChildren<UITexture>().mainTexture = tex;
Program.I().ocgcore.Sleep(40);
big_string.AddComponent<animation_screen_lock2>();
destroy(big_string, 3f);
}
class field_disabled_container
public void animation_show_lp_num(int player, bool up, int count)
{
public GPS p;
public Vector3 position;
public GameObject game_object;
public bool disabled = false;
}
int color = up ? 3 : 0;
Vector3 screen_p = player == 0
? new Vector3(Program.I().ocgcore.getScreenCenter(), 100f, 5)
: new Vector3(Program.I().ocgcore.getScreenCenter(), Screen.height - 100f, 5);
List<field_disabled_container> field_disabled_containers = new List<field_disabled_container>();
Vector3 position = Program.I().main_camera.ScreenToWorldPoint(screen_p);
public void set_point_disabled(GPS gps, bool disabled)
GameObject obj = create(Program.I().mod_ocgcore_number);
obj.GetComponent<number_loader>().set_number(count, color);
obj.AddComponent<animation_screen_lock>().screen_point = screen_p;
obj.transform.position = position;
obj.transform.localScale = Vector3.zero;
obj.transform.eulerAngles = new Vector3(60, 0, 0);
obj.transform.DOScale(Vector3.one, 0.18f);
destroy(obj, 1f);
}
public void animation_screen_blood(int player, int amount_)
{
//temp
int amount = Mathf.Min(amount_, 8000);
int count = amount / 250;
if (Program.I().ocgcore.MasterRule >= 4)
CreateBloodEffects(player, count);
if (player == 0)
{
if (gps.location == (int)CardLocation.SpellZone)
CreateScreenShakeAndBloodScreen(amount);
}
}
private void CreateBloodEffects(int player, int count)
{
if (gps.position == 0 || gps.position == 4)
Vector3 basePosition = player == 0
? new Vector3(0, 0, -15f)
: new Vector3(0, 0, 15f);
for (int i = 0; i < count; i++)
{
disabled = false;
}
Vector3 randomOffset = new Vector3(
UnityEngine.Random.Range(-20, 20),
0,
player == 0 ? UnityEngine.Random.Range(0, -20) : UnityEngine.Random.Range(0, 20)
);
create(Program.I().mod_ocgcore_blood, basePosition + randomOffset);
}
}
field_disabled_container container = null;
private void CreateScreenShakeAndBloodScreen(int amount)
{
Program.I().ocgcore.Sleep((int)(60 * (float)amount / 2500f));
float duration = (float)amount / 2500f;
float strength = (float)amount / 1500f;
Program.I().main_camera.transform.DOShakePosition(duration, strength);
foreach (field_disabled_container cont in field_disabled_containers)
// 主血屏效果
CreateBloodScreenEffect(new Vector3(
Program.I().ocgcore.getScreenCenter(),
100f,
0.5f + 4000f / (float)amount
));
// 随机血屏效果
int bloodScreenCount = amount / 1000;
for (int i = 0; i < bloodScreenCount; i++)
{
if (cont.p.controller == gps.controller)
CreateBloodScreenEffect(new Vector3(
(float)Screen.width / UnityEngine.Random.Range(10, 30) * 10f,
(float)Screen.height / UnityEngine.Random.Range(10, 30) * 10f,
0.5f + 4000f / (float)amount
));
}
}
private void CreateBloodScreenEffect(Vector3 screenPoint)
{
if (cont.p.location == gps.location)
GameObject obj = create(Program.I().mod_ocgcore_blood_screen);
obj.AddComponent<animation_screen_lock>().screen_point = screenPoint;
destroy(obj, 2.5f);
}
#endregion
#region Field Disabled Management
public void set_point_disabled(GPS gps, bool disabled)
{
if (cont.p.sequence == gps.sequence)
// Master Rule 4特殊处理
if (Program.I().ocgcore.MasterRule >= 4 &&
gps.location == (int)CardLocation.SpellZone &&
(gps.position == 0 || gps.position == 4))
{
container = cont;
break;
}
}
disabled = false;
}
var container = FindOrCreateDisabledContainer(gps);
container.disabled = disabled;
}
private FieldDisabledContainer FindOrCreateDisabledContainer(GPS gps)
{
var container = field_disabled_containers.Find(cont =>
cont.p.controller == gps.controller &&
cont.p.location == gps.location &&
cont.p.sequence == gps.sequence);
if (container == null)
{
container = new field_disabled_container
container = new FieldDisabledContainer
{
p = gps,
position = Program.I().ocgcore.get_point_worldposition(gps)
};
field_disabled_containers.Add(container);
}
container.disabled = disabled;
return container;
}
public enum ph { dp, sp, mp1, bp, mp2, ep };
public ph currentPhase;
public void realize()
public void clearDisabled()
{
if (Phase.colliderBp.enabled)
foreach (var container in field_disabled_containers)
{
Phase.labBp.gradientTop = Color.white;
container.disabled = false;
}
else
{
Phase.labBp.gradientTop = Color.grey;
}
if (Phase.colliderEp.enabled)
{
Phase.labEp.gradientTop = Color.white;
}
else
#endregion
#region Phase Management
public void realize()
{
Phase.labEp.gradientTop = Color.grey;
UpdatePhaseLabels();
UpdateDisabledObjects();
UpdateLabelText();
}
if (Phase.colliderMp2.enabled)
private void UpdatePhaseLabels()
{
Phase.labMp2.gradientTop = Color.white;
// 设置可交互阶段的颜色
Phase.labBp.gradientTop = Phase.colliderBp.enabled ? Color.white : Color.grey;
Phase.labEp.gradientTop = Phase.colliderEp.enabled ? Color.white : Color.grey;
Phase.labMp2.gradientTop = Phase.colliderMp2.enabled ? Color.white : Color.grey;
// 重置所有阶段为灰色
SetPhaseLabelsGrey();
// 设置当前阶段为绿色
SetCurrentPhaseGreen();
}
else
private void SetPhaseLabelsGrey()
{
Phase.labMp2.gradientTop = Color.grey;
}
Phase.labDp.gradientTop = Color.grey;
Phase.labSp.gradientTop = Color.grey;
Phase.labMp1.gradientTop = Color.grey;
switch (currentPhase)
{
case ph.dp:
Phase.labDp.gradientTop = Color.green;
break;
case ph.sp:
Phase.labSp.gradientTop = Color.green;
break;
case ph.mp1:
Phase.labMp1.gradientTop = Color.green;
break;
case ph.bp:
Phase.labBp.gradientTop = Color.green;
break;
case ph.mp2:
Phase.labMp2.gradientTop = Color.green;
break;
case ph.ep:
Phase.labEp.gradientTop = Color.green;
break;
}
for (int i = 0; i < field_disabled_containers.Count; i++)
{
if (field_disabled_containers[i].disabled)
{
if (field_disabled_containers[i].game_object == null)
{
field_disabled_containers[i].game_object = create(Program.I().mod_simple_quad, field_disabled_containers[i].position, new Vector3(90, 0, 0), false, null, true);
field_disabled_containers[i].game_object.transform.localScale = Vector3.zero;
field_disabled_containers[i].game_object.transform.DOScale(new Vector3(4, 4, 4), 1f);
field_disabled_containers[i].game_object.GetComponent<Renderer>().material.mainTexture = GameTextureManager.negated;
}
}
else
{
destroy(field_disabled_containers[i].game_object, 0.6f, true, true);
}
}
label.text = currentString;
}
public void clearDisabled()
private void SetCurrentPhaseGreen()
{
for (int i = 0; i < field_disabled_containers.Count; i++)
switch (currentPhase)
{
field_disabled_containers[i].disabled = false;
case ph.dp: Phase.labDp.gradientTop = Color.green; break;
case ph.sp: Phase.labSp.gradientTop = Color.green; break;
case ph.mp1: Phase.labMp1.gradientTop = Color.green; break;
case ph.bp: Phase.labBp.gradientTop = Color.green; break;
case ph.mp2: Phase.labMp2.gradientTop = Color.green; break;
case ph.ep: Phase.labEp.gradientTop = Color.green; break;
}
}
public void animation_show_lp_num(int player, bool up, int count)
private void UpdateDisabledObjects()
{
int color = 0;
if (up)
foreach (var container in field_disabled_containers)
{
color = 3;
}
Vector3 position;
Vector3 screen_p;
if (player==0)
if (container.disabled)
{
screen_p = new Vector3(Program.I().ocgcore.getScreenCenter(), 100f, 5);
position = Program.I().main_camera.ScreenToWorldPoint(new Vector3(Program.I().ocgcore.getScreenCenter(), 100f, 5));
CreateDisabledEffect(container);
}
else
{
screen_p = new Vector3(Program.I().ocgcore.getScreenCenter(), Screen.height - 100f, 5);
position = Program.I().main_camera.ScreenToWorldPoint(new Vector3(Program.I().ocgcore.getScreenCenter(), Screen.height - 100f, 5));
DestroyDisabledEffect(container);
}
}
}
private void CreateDisabledEffect(FieldDisabledContainer container)
{
if (container.game_object != null) return;
GameObject obj = create(Program.I().mod_ocgcore_number);
obj.GetComponent<number_loader>().set_number(count, color);
obj.AddComponent<animation_screen_lock>().screen_point = screen_p;
obj.transform.position = position;
obj.transform.localScale = Vector3.zero;
obj.transform.eulerAngles = new Vector3(60, 0, 0);
obj.transform.DOScale(new Vector3(1, 1, 1), 0.18f);
destroy(obj, 1f);
container.game_object = create(Program.I().mod_simple_quad, container.position, new Vector3(90, 0, 0), false, null, true);
container.game_object.transform.localScale = Vector3.zero;
container.game_object.transform.DOScale(new Vector3(4, 4, 4), 1f);
container.game_object.GetComponent<Renderer>().material.mainTexture = GameTextureManager.negated;
}
public void animation_screen_blood(int player, int amount_)
private void DestroyDisabledEffect(FieldDisabledContainer container)
{
int amount = amount_;
if (amount > 8000)
if (container.game_object != null)
{
amount = 8000;
}
int count = ((int)amount) / 250;
for (int i = 0; i < count; i++)
{
if (player == 0)
{
create(
Program.I().mod_ocgcore_blood,
new Vector3(
UnityEngine.Random.Range(-20, 20),
0,
UnityEngine.Random.Range(-5, -25)
)
);
}
else
{
create(
Program.I().mod_ocgcore_blood,
new Vector3(
UnityEngine.Random.Range(-20, 20),
0,
UnityEngine.Random.Range(5, 25)
)
);
destroy(container.game_object, 0.6f, true, true);
container.game_object = null;
}
}
if (player == 0)
{
Program.I().ocgcore.Sleep((int)(60 * (float)amount / 2500f));
float duration = (float)amount / 2500f;
float strength = (float)amount / 1500f;
Program.I().main_camera.transform.DOShakePosition(duration, strength);
GameObject obj_ = create(Program.I().mod_ocgcore_blood_screen);
obj_.AddComponent<animation_screen_lock>().screen_point =
new Vector3(
Program.I().ocgcore.getScreenCenter(),
100f,
0.5f + 4000f / (float)amount);
destroy(obj_, 2.5f);
for (int i = 0; i < (int)amount / 1000; i++)
private void UpdateLabelText()
{
GameObject obj = create(Program.I().mod_ocgcore_blood_screen);
obj.AddComponent<animation_screen_lock>().screen_point =
new Vector3(
(float)Screen.width / (float)UnityEngine.Random.Range(10, 30) * 10f,
(float)Screen.height / (float)UnityEngine.Random.Range(10, 30) * 10f,
0.5f + 4000f / (float)amount);
destroy(obj, 2.5f);
}
}
label.text = currentString;
}
#endregion
}
......@@ -273,6 +273,9 @@ public class Program : MonoBehaviour
public static Vector3 cameraPosition = new Vector3(0, 23, -23);
public static Vector3 cameraRotation = new Vector3(60, 0, 0);
// public static Vector3 cameraPosition = new Vector3(0, 23, -40);
// public static Vector3 cameraRotation = new Vector3(35, 0, 0);
public static bool cameraFacing = false;
public static float verticleScale = 5f;
......@@ -747,8 +750,8 @@ public class Program : MonoBehaviour
{
camera_game_main = this.main_camera;
}
camera_game_main.transform.position = new Vector3(0, 23, -23);
camera_game_main.transform.eulerAngles = new Vector3(60, 0, 0);
camera_game_main.transform.position = cameraPosition;
camera_game_main.transform.eulerAngles = cameraRotation;
camera_game_main.transform.localScale = new Vector3(1, 1, 1);
camera_game_main.rect = new Rect(0, 0, 1, 1);
camera_game_main.depth = 0;
......@@ -779,8 +782,8 @@ public class Program : MonoBehaviour
camera_container_3d.cullingMask = (int)Mathf.Pow(2, 9);
camera_container_3d.fieldOfView = 75;
camera_container_3d.rect = camera_game_main.rect;
camera_container_3d.transform.position = new Vector3(0, 23, -23);
camera_container_3d.transform.eulerAngles = new Vector3(60, 0, 0);
camera_container_3d.transform.position = cameraPosition;
camera_container_3d.transform.eulerAngles = cameraRotation;
camera_container_3d.transform.localScale = new Vector3(1, 1, 1);
camera_container_3d.rect = new Rect(0, 0, 1, 1);
camera_container_3d.clearFlags = CameraClearFlags.Depth;
......@@ -818,8 +821,8 @@ public class Program : MonoBehaviour
camera_main_3d.cullingMask = (int)Mathf.Pow(2, 10);
camera_main_3d.fieldOfView = 75;
camera_main_3d.rect = new Rect(0, 0, 1, 1);
camera_main_3d.transform.position = new Vector3(0, 23, -23);
camera_main_3d.transform.eulerAngles = new Vector3(60, 0, 0);
camera_main_3d.transform.position = cameraPosition;
camera_main_3d.transform.eulerAngles = cameraRotation;
camera_main_3d.transform.localScale = new Vector3(1, 1, 1);
camera_main_3d.clearFlags = CameraClearFlags.Depth;
......
......@@ -148,21 +148,6 @@ public class DeckManager : ServantWithCardDescription
itemOnListProducer,
86
);
// Program.go(
// 500,
// () =>
// {
// List<MonoCardInDeckManager> cs = new List<MonoCardInDeckManager>();
// for (int i = 0; i < 300; i++)
// {
// cs.Add(createCard());
// }
// for (int i = 0; i < 300; i++)
// {
// destroyCard(cs[i]);
// }
// }
// );
}
GameObject itemOnListProducer(string[] Args)
......@@ -1461,7 +1446,7 @@ public class DeckManager : ServantWithCardDescription
{
// 判定为拖拽,开始拖拽卡牌
cardInDragging = cardForLongPress;
cardInDragging.beginDrag();
cardInDragging.BeginDrag();
cardForLongPress = null; // 清除长按检测状态
isContinuouslyAdding = false; // 确保连续添加状态也被重置
}
......@@ -1633,12 +1618,12 @@ public class DeckManager : ServantWithCardDescription
if ((cardInSearchResult.data.Type & (UInt32)CardType.Token) == 0)
{
MonoCardInDeckManager card = createCard();
card.transform.position = card.getGoodPosition(4);
card.transform.position = card.GetMouseWorldPosition(4f);
card.cardData = cardInSearchResult.data;
card.gameObject.layer = 16;
deck.IMain.Add(card);
cardInDragging = card;
card.beginDrag();
card.BeginDrag();
}
}
}
......@@ -1650,11 +1635,11 @@ public class DeckManager : ServantWithCardDescription
if (cardInDragging != null)
{
// 第一步:终止拖拽,设置物理状态
cardInDragging.endDrag();
cardInDragging.EndDrag();
// 第二步:逻辑判断是否仍应纳入卡组
if (condition == Condition.changeSide && !cardInDragging.IsInDeckArea()) { }
else if (cardInDragging.getIfAlive())
else if (cardInDragging.IsAlive())
{
deckDirty = true;
}
......@@ -1684,7 +1669,7 @@ public class DeckManager : ServantWithCardDescription
Program.pointedGameObject.GetComponent<MonoCardInDeckManager>();
if (cardInDeck != null)
{
cardInDeck.killIt(); // 标记为待删除
cardInDeck.KillCard(); // 标记为待删除
// 从数据结构中移除
deck.IMain.Remove(cardInDeck);
deck.IExtra.Remove(cardInDeck);
......@@ -1734,7 +1719,7 @@ public class DeckManager : ServantWithCardDescription
if (checkBanlistAvail(data.Id))
{
MonoCardInDeckManager card = createCard();
card.transform.position = card.getGoodPosition(4);
card.transform.position = card.GetMouseWorldPosition(4f);
card.cardData = data;
card.gameObject.layer = 16;
if (data.IsExtraCard())
......@@ -1974,11 +1959,11 @@ public class DeckManager : ServantWithCardDescription
Vector3 rightPosition = right.gameObject.transform.position;
if (leftPosition.y > 3f)
{
leftPosition = MonoCardInDeckManager.refLectPosition(leftPosition);
leftPosition = MonoCardInDeckManager.ReflectPositionToGround(leftPosition);
}
if (rightPosition.y > 3f)
{
rightPosition = MonoCardInDeckManager.refLectPosition(rightPosition);
rightPosition = MonoCardInDeckManager.ReflectPositionToGround(rightPosition);
}
if (leftPosition.z > -3 && rightPosition.z > -3)
{
......@@ -2020,7 +2005,7 @@ public class DeckManager : ServantWithCardDescription
for (int i = 0; i < deckTemp.Count; i++)
{
Vector3 p = deckTemp[i].gameObject.transform.position;
if (deckTemp[i].getIfAlive() == true)
if (deckTemp[i].IsAlive())
{
if (p.z > -8)
{
......@@ -2179,7 +2164,7 @@ public class DeckManager : ServantWithCardDescription
// tweenToVectorAndFall 本身就是DoTween动画, 它会独立运行,
// 而我们的Sequence只负责在正确的时间点触发它。
card.tweenToVectorAndFall(toVector, new Vector3(90, 0, 0));
card.TweenToPositionAndFall(toVector, new Vector3(90, 0, 0));
});
}
......@@ -2247,7 +2232,7 @@ public class DeckManager : ServantWithCardDescription
0.6f + Mathf.Sin((90 - toAngle.x) / 180f * Mathf.PI) * k,
11.8f - v.x * 4f
);
deck.IMain[i].tweenToVectorAndFall(toVector, toAngle);
deck.IMain[i].TweenToPositionAndFall(toVector, toAngle);
}
for (int i = 0; i < deck.IExtra.Count; i++)
{
......@@ -2265,7 +2250,7 @@ public class DeckManager : ServantWithCardDescription
0.6f + Mathf.Sin((90 - toAngle.x) / 180f * Mathf.PI) * k,
-6.2f
);
deck.IExtra[i].tweenToVectorAndFall(toVector, toAngle);
deck.IExtra[i].TweenToPositionAndFall(toVector, toAngle);
}
for (int i = 0; i < deck.ISide.Count; i++)
......@@ -2284,7 +2269,7 @@ public class DeckManager : ServantWithCardDescription
0.6f + Mathf.Sin((90 - toAngle.x) / 180f * Mathf.PI) * k,
-12f
);
deck.ISide[i].tweenToVectorAndFall(toVector, toAngle);
deck.ISide[i].TweenToPositionAndFall(toVector, toAngle);
}
}
......
......@@ -166,22 +166,22 @@ namespace YGOSharp
{
foreach (var item in stack)
{
if (item.cardData.Id == code && item.getIfAlive())
if (item.cardData.Id == code && item.IsAlive())
{
returnValue++;
continue;
}
if (item.cardData.Alias == code && item.getIfAlive())
if (item.cardData.Alias == code && item.IsAlive())
{
returnValue++;
continue;
}
if (item.cardData.Id == al && item.getIfAlive())
if (item.cardData.Id == al && item.IsAlive())
{
returnValue++;
continue;
}
if (item.cardData.Alias == al && item.getIfAlive() && al > 0)
if (item.cardData.Alias == al && item.IsAlive() && al > 0)
{
returnValue++;
continue;
......@@ -244,7 +244,7 @@ namespace YGOSharp
public List<MonoCardInDeckManager> getAllObjectCardAndDeload()
{
List<MonoCardInDeckManager> r = new List<MonoCardInDeckManager>();
IList<MonoCardInDeckManager>[] stacks = { IMain, IExtra, ISide,IRemoved };
IList<MonoCardInDeckManager>[] stacks = { IMain, IExtra, ISide, IRemoved };
foreach (var stack in stacks)
{
foreach (var item in stack)
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &1
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 12004, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_PixelRect:
serializedVersion: 2
x: 0
y: 66
width: 1107
height: 601
m_ShowMode: 0
m_Title: Build Settings
m_RootView: {fileID: 4}
m_MinSize: {x: 640, y: 601}
m_MaxSize: {x: 4000, y: 4021}
m_Maximized: 0
--- !u!114 &2
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
......@@ -19,12 +43,62 @@ MonoBehaviour:
width: 1512
height: 916
m_ShowMode: 4
m_Title: Hierarchy
m_RootView: {fileID: 2}
m_Title: Simulator
m_RootView: {fileID: 5}
m_MinSize: {x: 875, y: 300}
m_MaxSize: {x: 10000, y: 10000}
m_Maximized: 1
--- !u!114 &2
--- !u!114 &3
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
m_Name: BuildPlayerWindow
m_EditorClassIdentifier:
m_Children: []
m_Position:
serializedVersion: 2
x: 0
y: 0
width: 1107
height: 601
m_MinSize: {x: 640, y: 601}
m_MaxSize: {x: 4000, y: 4021}
m_ActualView: {fileID: 15}
m_Panes:
- {fileID: 15}
m_Selected: 0
m_LastSelected: 0
--- !u!114 &4
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 12010, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_Children:
- {fileID: 3}
m_Position:
serializedVersion: 2
x: 0
y: 0
width: 1107
height: 601
m_MinSize: {x: 640, y: 601}
m_MaxSize: {x: 4000, y: 4021}
vertical: 0
controlID: 1594
--- !u!114 &5
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
......@@ -37,9 +111,9 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Children:
- {fileID: 3}
- {fileID: 5}
- {fileID: 4}
- {fileID: 6}
- {fileID: 8}
- {fileID: 7}
m_Position:
serializedVersion: 2
x: 0
......@@ -52,7 +126,7 @@ MonoBehaviour:
m_TopViewHeight: 30
m_UseBottomView: 1
m_BottomViewHeight: 20
--- !u!114 &3
--- !u!114 &6
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
......@@ -74,7 +148,7 @@ MonoBehaviour:
m_MinSize: {x: 0, y: 0}
m_MaxSize: {x: 0, y: 0}
m_LastLoadedLayoutName:
--- !u!114 &4
--- !u!114 &7
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
......@@ -95,7 +169,7 @@ MonoBehaviour:
height: 20
m_MinSize: {x: 0, y: 0}
m_MaxSize: {x: 0, y: 0}
--- !u!114 &5
--- !u!114 &8
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
......@@ -108,8 +182,8 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Children:
- {fileID: 6}
- {fileID: 11}
- {fileID: 9}
- {fileID: 14}
m_Position:
serializedVersion: 2
x: 0
......@@ -119,8 +193,8 @@ MonoBehaviour:
m_MinSize: {x: 300, y: 200}
m_MaxSize: {x: 24288, y: 16192}
vertical: 0
controlID: 16
--- !u!114 &6
controlID: 31
--- !u!114 &9
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
......@@ -133,8 +207,8 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Children:
- {fileID: 7}
- {fileID: 10}
- {fileID: 13}
m_Position:
serializedVersion: 2
x: 0
......@@ -144,8 +218,8 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 16192, y: 16192}
vertical: 1
controlID: 17
--- !u!114 &7
controlID: 32
--- !u!114 &10
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
......@@ -158,8 +232,8 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Children:
- {fileID: 8}
- {fileID: 9}
- {fileID: 11}
- {fileID: 12}
m_Position:
serializedVersion: 2
x: 0
......@@ -169,8 +243,8 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 100}
m_MaxSize: {x: 16192, y: 8096}
vertical: 0
controlID: 18
--- !u!114 &8
controlID: 69
--- !u!114 &11
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
......@@ -191,12 +265,12 @@ MonoBehaviour:
height: 444
m_MinSize: {x: 201, y: 221}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 13}
m_ActualView: {fileID: 17}
m_Panes:
- {fileID: 13}
- {fileID: 17}
m_Selected: 0
m_LastSelected: 0
--- !u!114 &9
--- !u!114 &12
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
......@@ -215,15 +289,15 @@ MonoBehaviour:
y: 0
width: 864.5
height: 444
m_MinSize: {x: 202, y: 221}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 14}
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 4000, y: 4000}
m_ActualView: {fileID: 18}
m_Panes:
- {fileID: 12}
- {fileID: 14}
- {fileID: 16}
- {fileID: 18}
m_Selected: 1
m_LastSelected: 0
--- !u!114 &10
--- !u!114 &13
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
......@@ -242,15 +316,15 @@ MonoBehaviour:
y: 444
width: 1147
height: 422
m_MinSize: {x: 101, y: 121}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 16}
m_MinSize: {x: 100, y: 100}
m_MaxSize: {x: 4000, y: 4000}
m_ActualView: {fileID: 20}
m_Panes:
- {fileID: 15}
- {fileID: 16}
- {fileID: 19}
- {fileID: 20}
m_Selected: 1
m_LastSelected: 0
--- !u!114 &11
--- !u!114 &14
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
......@@ -269,14 +343,65 @@ MonoBehaviour:
y: 0
width: 365
height: 866
m_MinSize: {x: 276, y: 71}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 17}
m_MinSize: {x: 275, y: 50}
m_MaxSize: {x: 4000, y: 4000}
m_ActualView: {fileID: 21}
m_Panes:
- {fileID: 17}
- {fileID: 21}
m_Selected: 0
m_LastSelected: 0
--- !u!114 &12
--- !u!114 &15
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 12043, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_MinSize: {x: 640, y: 580}
m_MaxSize: {x: 4000, y: 4000}
m_TitleContent:
m_Text: Build Settings
m_Image: {fileID: 0}
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 0
y: 66
width: 1107
height: 580
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
m_SaveData: []
m_OverlaysVisible: 1
m_TreeViewState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs:
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
m_OriginalName:
m_EditFieldRect:
serializedVersion: 2
x: 0
y: 0
width: 0
height: 0
m_UserData: 0
m_IsWaitingForDelay: 0
m_IsRenaming: 0
m_OriginalEventType: 11
m_IsRenamingFilename: 0
m_ClientGUIView: {fileID: 0}
m_SearchString:
--- !u!114 &16
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
......@@ -292,7 +417,7 @@ MonoBehaviour:
m_MaxSize: {x: 4000, y: 4000}
m_TitleContent:
m_Text: Scene
m_Image: {fileID: 2593428753322112591, guid: 0000000000000000d000000000000000,
m_Image: {fileID: 8634526014445323508, guid: 0000000000000000d000000000000000,
type: 0}
m_Tooltip:
m_Pos:
......@@ -638,7 +763,7 @@ MonoBehaviour:
m_SceneVisActive: 1
m_LastLockedObject: {fileID: 0}
m_ViewIsLockedToObject: 0
--- !u!114 &13
--- !u!114 &17
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
......@@ -654,7 +779,7 @@ MonoBehaviour:
m_MaxSize: {x: 4000, y: 4000}
m_TitleContent:
m_Text: Hierarchy
m_Image: {fileID: 7966133145522015247, guid: 0000000000000000d000000000000000,
m_Image: {fileID: -3734745235275155857, guid: 0000000000000000d000000000000000,
type: 0}
m_Tooltip:
m_Pos:
......@@ -671,9 +796,9 @@ MonoBehaviour:
m_SceneHierarchy:
m_TreeViewState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 04b00000
m_LastClickedID: 45060
m_ExpandedIDs: c6f5ffff16f6ffffecf9ffff06fbffff
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 5634e9ffa634e9ff7238e9ff705ff1ffc05ff1ff9663f1ff8447f2ff304bf2ff704df2ff944df2ff9a4df2ffa64df2ff0e4ff2ff5250f2ffa250f2ff7854f2ff1c6af4ff6c6af4ff426ef4fff08cfcff408dfcff1691fcffb032feff0033feffd636feff06fbffff
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
......@@ -689,7 +814,7 @@ MonoBehaviour:
m_IsRenaming: 0
m_OriginalEventType: 11
m_IsRenamingFilename: 0
m_ClientGUIView: {fileID: 8}
m_ClientGUIView: {fileID: 11}
m_SearchString:
m_ExpandedScenes: []
m_CurrenRootInstanceID: 0
......@@ -697,7 +822,7 @@ MonoBehaviour:
m_IsLocked: 0
m_CurrentSortingName: TransformSorting
m_WindowGUID: 4c969a2b90040154d917609493e03593
--- !u!114 &14
--- !u!114 &18
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
......@@ -713,7 +838,7 @@ MonoBehaviour:
m_MaxSize: {x: 4000, y: 4000}
m_TitleContent:
m_Text: Simulator
m_Image: {fileID: 8720083202187608617, guid: 0000000000000000d000000000000000,
m_Image: {fileID: 3038311277492192215, guid: 0000000000000000d000000000000000,
type: 0}
m_Tooltip:
m_Pos:
......@@ -735,7 +860,7 @@ MonoBehaviour:
m_ShowGizmos: 0
m_TargetDisplay: 0
m_ClearColor: {r: 0, g: 0, b: 0, a: 1}
m_TargetSize: {x: 2778, y: 1284}
m_TargetSize: {x: 1920, y: 1080}
m_TextureFilterMode: 0
m_TextureHideFlags: 61
m_RenderIMGUI: 1
......@@ -758,7 +883,7 @@ MonoBehaviour:
friendlyName: Apple iPhone 13 Pro Max
networkReachability: 1
systemLanguage: 10
--- !u!114 &15
--- !u!114 &19
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
......@@ -774,14 +899,14 @@ MonoBehaviour:
m_MaxSize: {x: 10000, y: 10000}
m_TitleContent:
m_Text: Project
m_Image: {fileID: -5467254957812901981, guid: 0000000000000000d000000000000000,
m_Image: {fileID: -5179483145760003458, guid: 0000000000000000d000000000000000,
type: 0}
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 0
y: 540
width: 1148
width: 1146
height: 401
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
......@@ -813,9 +938,9 @@ MonoBehaviour:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 100}
m_SelectedIDs: cebf0000
m_LastClickedID: 49102
m_ExpandedIDs: 0000000070ae000072ae000074ae000076ae000078ae00007aae00007cae0000
m_SelectedIDs: fcc10000
m_LastClickedID: 49660
m_ExpandedIDs: 0000000068ae00006aae00006cae00006eae000070ae000072ae000074ae000000ca9a3bffffff7f
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
......@@ -831,7 +956,7 @@ MonoBehaviour:
m_IsRenaming: 0
m_OriginalEventType: 11
m_IsRenamingFilename: 1
m_ClientGUIView: {fileID: 10}
m_ClientGUIView: {fileID: 13}
m_SearchString:
m_CreateAssetUtility:
m_EndAction: {fileID: 0}
......@@ -843,7 +968,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 0000000070ae000072ae000074ae000076ae000078ae00007aae00007cae0000
m_ExpandedIDs: 0000000068ae00006aae00006cae00006eae000070ae000072ae000074ae0000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
......@@ -870,7 +995,7 @@ MonoBehaviour:
m_ListAreaState:
m_SelectedInstanceIDs:
m_LastClickedInstanceID: 0
m_HadKeyboardFocusLastEvent: 1
m_HadKeyboardFocusLastEvent: 0
m_ExpandedInstanceIDs: c62300000000000096d2000090d20000
m_RenameOverlay:
m_UserAcceptedRename: 0
......@@ -887,7 +1012,7 @@ MonoBehaviour:
m_IsRenaming: 0
m_OriginalEventType: 11
m_IsRenamingFilename: 1
m_ClientGUIView: {fileID: 10}
m_ClientGUIView: {fileID: 13}
m_CreateAssetUtility:
m_EndAction: {fileID: 0}
m_InstanceID: 0
......@@ -899,7 +1024,7 @@ MonoBehaviour:
m_GridSize: 64
m_SkipHiddenPackages: 0
m_DirectoriesAreaWidth: 207
--- !u!114 &16
--- !u!114 &20
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
......@@ -915,7 +1040,7 @@ MonoBehaviour:
m_MaxSize: {x: 4000, y: 4000}
m_TitleContent:
m_Text: Console
m_Image: {fileID: -4327648978806127646, guid: 0000000000000000d000000000000000,
m_Image: {fileID: -4950941429401207979, guid: 0000000000000000d000000000000000,
type: 0}
m_Tooltip:
m_Pos:
......@@ -929,7 +1054,7 @@ MonoBehaviour:
m_LastAppliedPresetName: Default
m_SaveData: []
m_OverlaysVisible: 1
--- !u!114 &17
--- !u!114 &21
MonoBehaviour:
m_ObjectHideFlags: 52
m_CorrespondingSourceObject: {fileID: 0}
......
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