Commit 4c21b99a authored by J114514's avatar J114514

Merge remote-tracking branch 'SherryChaos/MDPro3/master'

parents e6f8b136 61ed9ebc
......@@ -14,13 +14,19 @@ namespace MDPro3.Duel
public class GraveBehaviour : MonoBehaviour
{
public int controller;
BgEffectManager manager;
BoxCollider graveCollider;
BoxCollider excludeCollider;
GameObject grave;
GameObject exclude;
private BgEffectManager manager;
private BoxCollider graveCollider;
private BoxCollider excludeCollider;
private GameObject grave;
private GameObject exclude;
private bool graveCountShowing;
private bool excludeCountShowing;
private bool graveButtonsCreated;
private bool excludeButtonsCreated;
public List<DuelButtonInfo> graveButtons = new();
public List<DuelButton> graveButtonObjs = new();
public List<DuelButtonInfo> excludeButtons = new();
public List<DuelButton> excludeButtonObjs = new();
private void Start()
{
......@@ -35,15 +41,12 @@ namespace MDPro3.Duel
excludeCollider.size = new Vector3(6, 2, 6);
}
bool graveCountShowing;
bool excludeCountShowing;
private void Update()
{
if (UserInput.HoverObject == grave)
{
manager.GetElement<Renderer>("Material01").material.SetFloat("_GraveMouseOver", 1);
if (UserInput.MouseLeftDown)
if (UserInput.MouseLeftPressing)
manager.GetElement<Renderer>("Material01").material.SetFloat("_GravePressButton", 1);
else
manager.GetElement<Renderer>("Material01").material.SetFloat("_GravePressButton", 0);
......@@ -66,7 +69,7 @@ namespace MDPro3.Duel
if (UserInput.HoverObject == exclude)
{
manager.GetElement<Renderer>("Material01").material.SetFloat("_ExcludeMouseOver", 1);
if (UserInput.MouseLeftDown)
if (UserInput.MouseLeftPressing)
manager.GetElement<Renderer>("Material01").material.SetFloat("_ExcludePressButton", 1);
else
manager.GetElement<Renderer>("Material01").material.SetFloat("_ExcludePressButton", 0);
......@@ -77,7 +80,7 @@ namespace MDPro3.Duel
{
manager.GetElement<Renderer>("Material01").material.SetFloat("_ExcludeMouseOver", 0);
manager.GetElement<Renderer>("Material01").material.SetFloat("_ExcludePressButton", 0);
if (UserInput.MouseLeftDown)
if (UserInput.MouseLeftUp)
HideExcludeButtons();
if (excludeCountShowing)
{
......@@ -85,6 +88,7 @@ namespace MDPro3.Duel
Program.instance.ocgcore.GetUI<OcgCoreUI>().HidePlaceCount();
}
}
if (UserInput.HoverObject == grave)
if (!graveCountShowing)
{
......@@ -98,9 +102,8 @@ namespace MDPro3.Duel
Program.instance.ocgcore.GetUI<OcgCoreUI>().ShowLocationCount(new GPS { location = (uint)CardLocation.Removed, controller = (uint)controller });
}
}
bool graveButtonsCreated = false;
bool excludeButtonsCreated = false;
void GraveOnClick()
private void GraveOnClick()
{
AudioManager.PlaySE("SE_DUEL_SELECT");
......@@ -138,7 +141,8 @@ namespace MDPro3.Duel
else
ShowGraveButtons();
}
void ExcludeOnClick()
private void ExcludeOnClick()
{
AudioManager.PlaySE("SE_DUEL_SELECT");
......@@ -147,7 +151,7 @@ namespace MDPro3.Duel
if (Program.instance.ocgcore.returnAction != null)
return;
if (!graveButtonsCreated)
if (!excludeButtonsCreated)
{
bool spsummmon = false;
bool activate = false;
......@@ -177,32 +181,31 @@ namespace MDPro3.Duel
ShowExcludeButtons();
}
void ShowGraveButtons()
private void ShowGraveButtons()
{
foreach (var button in graveButtonObjs)
button.Show();
}
void ShowExcludeButtons()
private void ShowExcludeButtons()
{
foreach (var button in excludeButtonObjs)
button.Show();
}
void HideGraveButtons()
private void HideGraveButtons()
{
foreach (var button in graveButtonObjs)
button.Hide();
}
void HideExcludeButtons()
private void HideExcludeButtons()
{
foreach (var button in excludeButtonObjs)
button.Hide();
}
public List<DuelButtonInfo> graveButtons = new List<DuelButtonInfo>();
public List<DuelButton> graveButtonObjs = new List<DuelButton>();
public List<DuelButtonInfo> excludeButtons = new List<DuelButtonInfo>();
public List<DuelButton> excludeButtonObjs = new List<DuelButton>();
void CreateGraveButtons()
private void CreateGraveButtons()
{
if (graveButtonsCreated || Program.instance.ocgcore.returnAction != null || graveButtons.Count == 0)
return;
......@@ -223,7 +226,8 @@ namespace MDPro3.Duel
}
graveButtonsCreated = true;
}
void CreateExcludeButtons()
private void CreateExcludeButtons()
{
if (excludeButtonsCreated || Program.instance.ocgcore.returnAction != null || excludeButtons.Count == 0)
return;
......@@ -253,6 +257,7 @@ namespace MDPro3.Duel
graveButtons.Clear();
graveButtonsCreated = false;
}
public void ClearExcludeButtons()
{
foreach (var go in excludeButtonObjs)
......@@ -262,6 +267,5 @@ namespace MDPro3.Duel
excludeButtonsCreated = false;
}
}
}
......@@ -62,7 +62,7 @@ namespace MDPro3.UI
StartCoroutine(RefreshIcons());
}
IEnumerator RefreshIcons()
private IEnumerator RefreshIcons()
{
while (TextureManager.container == null)
yield return null;
......@@ -151,7 +151,7 @@ namespace MDPro3.UI
GetComponent<Button>().spriteState = spriteState;
}
void RefreshPosition()
private void RefreshPosition()
{
if (response[0] == -4) // 确认
{
......@@ -223,7 +223,7 @@ namespace MDPro3.UI
transform.DOScale(0, transitionTime);
}
void OnClick()
private void OnClick()
{
AudioManager.PlaySE("SE_DUEL_DECIDE");
......@@ -260,7 +260,7 @@ namespace MDPro3.UI
}
else if (response[0] == -1 || response[0] == -2)
{
List<GameCard> responseCards = new List<GameCard>();
var responseCards = new List<GameCard>();
foreach (var card in OcgCore.cards)
if (card.p.controller == controller)
if ((card.p.location & location) > 0)
......
......@@ -137,6 +137,15 @@ namespace MDPro3.Net
return 0;
}
public static string GetGenesysPointString(int code)
{
var gp = GetGenesysPoint(code);
if (gp < 0)
return "X";
return gp.ToString();
}
/// <summary>
/// color for Genesys Points one card score
/// </summary>
......
......@@ -447,7 +447,7 @@ namespace MDPro3.Servant
}
bool greenOn;
private bool greenOn;
public void GreenBackgroundOn()
{
greenBackground.gameObject.SetActive(true);
......@@ -888,7 +888,6 @@ namespace MDPro3.Servant
return false;
}
private async UniTask ProcessMessage()
{
messageDispatcher.Dispose();
......@@ -1235,7 +1234,6 @@ namespace MDPro3.Servant
}
}
public int GetMyHandCount()
{
if (needRefreshMyHand)
......
......@@ -7,6 +7,7 @@ using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using YgomSystem.ElementSystem;
namespace MDPro3.UI
......@@ -64,8 +65,11 @@ namespace MDPro3.UI
if (battlePhase || main2Phase || endPhase)
{
playerMaterial.SetFloat("_Active", 1);
//Click
if (UserInput.HoverObject == collider_.gameObject && UserInput.MouseLeftUp)
if (!EventSystem.current.IsPointerOverGameObject()
&& UserInput.HoverObject == collider_.gameObject
&& UserInput.MouseLeftUp)
{
if (Program.instance.ocgcore.currentPopup == null)
{
......@@ -82,17 +86,25 @@ namespace MDPro3.UI
Program.instance.ocgcore.GetUI<OcgCoreUI>().CardList.Hide();
}
}
if (UserInput.HoverObject == collider_.gameObject && UserInput.MouseLeftDown)
if (!EventSystem.current.IsPointerOverGameObject()
&& UserInput.HoverObject == collider_.gameObject
&& UserInput.MouseLeftPressing)
playerMaterial.SetFloat("_PressButton", 1);
else
playerMaterial.SetFloat("_PressButton", 0);
//MouseOver
if (UserInput.HoverObject == collider_.gameObject && !hover)
if (!EventSystem.current.IsPointerOverGameObject()
&& UserInput.HoverObject == collider_.gameObject
&& !hover)
{
hover = true;
DOTween.To(() => mouseOver, x => mouseOver = x, 1, 0.2f);
}
else if (UserInput.HoverObject != collider_ && hover)
else if (!EventSystem.current.IsPointerOverGameObject()
&& UserInput.HoverObject != collider_
&& hover)
{
hover = false;
DOTween.To(() => mouseOver, x => mouseOver = x, 0, 0.2f);
......
using Cysharp.Threading.Tasks;
using DG.Tweening;
using MDPro3.Duel.YGOSharp;
using MDPro3.Net;
using MDPro3.Servant;
using MDPro3.UI.ServantUI;
using MDPro3.Utility;
......@@ -239,6 +240,12 @@ namespace MDPro3.UI
m_IconBETA = m_IconBETA != null ? m_IconBETA
: Manager.GetNestedElement<Image>(LABEL_IMG_ICON_BETA);
private const string LABEL_TXT_GP = "TextGP";
private TextMeshProUGUI m_TextGP;
protected TextMeshProUGUI TextGP =>
m_TextGP = m_TextGP != null ? m_TextGP
: Manager.GetElement<TextMeshProUGUI>(LABEL_TXT_GP);
#endregion
#region Pendulum Description Area
......@@ -414,6 +421,11 @@ namespace MDPro3.UI
IconDIY.gameObject.SetActive((data.Ot & 4) > 0);
IconBETA.gameObject.SetActive(data.isPre);
var gp = OnlineService.GetGenesysPoint(data.GetOriginalID());
var gpString = OnlineService.GetGenesysPointString(data.GetOriginalID());
TextGP.text = string.Format("G:{0}", gpString);
TextGP.color = OnlineService.GetGenesysPointColor(gp);
#endregion
#region Description Area
......
fileFormatVersion: 2
guid: fc0712e351423bb42b56c0f1aef6c775
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: iOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
......@@ -52,7 +52,7 @@ TextureImporter:
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
......@@ -106,6 +106,19 @@ TextureImporter:
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: iOS
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
......
......@@ -234,6 +234,7 @@ SpriteAtlas:
- 1c67dcd331aba654c9bd5bf1cb62e9b6: 21300000
- 74c89dd3140caaf41822b2dfb3c41e3e: 21300000
- 79c360e3cce6f9543bbc1fcd0ef1820b: 21300000
- fc0712e351423bb42b56c0f1aef6c775: 21300000
- a55d21040be77c9449a55ef7cd89ff1e: 21300000
- c35afa04c123f974f8b61677d55c6ee7: 21300000
- f51cae04dc114a34eb0f5765a668c831: 21300000
......@@ -965,6 +966,7 @@ SpriteAtlas:
- {fileID: 21300000, guid: 1c67dcd331aba654c9bd5bf1cb62e9b6, type: 3}
- {fileID: 21300000, guid: 74c89dd3140caaf41822b2dfb3c41e3e, type: 3}
- {fileID: 21300000, guid: 79c360e3cce6f9543bbc1fcd0ef1820b, type: 3}
- {fileID: 21300000, guid: fc0712e351423bb42b56c0f1aef6c775, type: 3}
- {fileID: 21300000, guid: a55d21040be77c9449a55ef7cd89ff1e, type: 3}
- {fileID: 21300000, guid: c35afa04c123f974f8b61677d55c6ee7, type: 3}
- {fileID: 21300000, guid: f51cae04dc114a34eb0f5765a668c831, type: 3}
......@@ -1695,6 +1697,7 @@ SpriteAtlas:
- _images_chain_01
- GUI_T_Icon1_Counter_SUMMON
- GUI_DeckEdit_FilterDialog_Icon_Category
- GUI_T_Icon_Pool_6
- tex_IconLink1
- GUI_CommonButtonAddDeck_Icon
- ChainNumSet_6
......
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