修改逻辑
@ -643,7 +643,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -0.000007495649}
|
||||
m_AnchoredPosition: {x: 0, y: 0.00026443074}
|
||||
m_SizeDelta: {x: 0, y: 300}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!114 &1181747651547168674
|
||||
@ -1347,7 +1347,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!224 &124795435256669180
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1437,10 +1437,10 @@ RectTransform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 3838833872239473580}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 100, y: 100}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &3798398430471671831
|
||||
CanvasRenderer:
|
||||
@ -1470,7 +1470,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Sprite: {fileID: 21300000, guid: cc9edef0c7d8eb54a84077129a9351a8, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
@ -1890,7 +1890,7 @@ MonoBehaviour:
|
||||
m_HandleRect: {fileID: 6608813160943937009}
|
||||
m_Direction: 2
|
||||
m_Value: 0
|
||||
m_Size: 1
|
||||
m_Size: 0.99999845
|
||||
m_NumberOfSteps: 0
|
||||
m_OnValueChanged:
|
||||
m_PersistentCalls:
|
||||
|
||||
BIN
Assets/Art/UITextures/UIImageSelectMap/背景.png
Normal file
|
After Width: | Height: | Size: 5.7 MiB |
179
Assets/Art/UITextures/UIImageSelectMap/背景.png.meta
Normal file
@ -0,0 +1,179 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc9edef0c7d8eb54a84077129a9351a8
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
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: 2
|
||||
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: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 8192
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 8192
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: iPhone
|
||||
maxTextureSize: 8192
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 8192
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Windows Store Apps
|
||||
maxTextureSize: 8192
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 8192
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Server
|
||||
maxTextureSize: 8192
|
||||
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: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -61,6 +61,14 @@ namespace QFramework
|
||||
data.rightLabel = datas.ContainsKey("rightLabel") ? datas["rightLabel"] : "";
|
||||
data.wrongLabel = datas.ContainsKey("wrongLabel") ? datas["wrongLabel"] : "";
|
||||
data.finishedEvent = datas.ContainsKey("finishedEvent") ? datas["finishedEvent"] : "";
|
||||
if (datas.ContainsKey("random"))
|
||||
{
|
||||
bool.TryParse(datas["random"], out data.random);
|
||||
}
|
||||
else
|
||||
{
|
||||
data.random = false;
|
||||
}
|
||||
|
||||
foreach (var item in items)
|
||||
{
|
||||
|
||||
@ -22,17 +22,26 @@ namespace QFramework.Example
|
||||
public string rightLabel;
|
||||
public string wrongLabel;
|
||||
public string finishedEvent;
|
||||
public bool random = false;
|
||||
public List<OptionItem> items = new List<OptionItem>();
|
||||
|
||||
}
|
||||
public partial class UIImageSelectMap : UIPanel
|
||||
{
|
||||
/// <summary>
|
||||
/// ÓÒ²àÊý¾Ý½á¹¹
|
||||
/// </summary>
|
||||
class RightDataItem
|
||||
{
|
||||
public GameObject rightObj;
|
||||
public bool isRight = false;
|
||||
}
|
||||
ResLoader loader;
|
||||
GameObject moveObj;
|
||||
GameObject enterRight;
|
||||
GameObject leftDragObj;
|
||||
Dictionary<GameObject, UIImageSelectMapData.OptionItem> itemDatas = new Dictionary<GameObject, UIImageSelectMapData.OptionItem>();
|
||||
Dictionary<GameObject, GameObject> leftAndRightMap = new Dictionary<GameObject, GameObject>();
|
||||
Dictionary<GameObject, RightDataItem> leftAndRightMap = new Dictionary<GameObject, RightDataItem>();
|
||||
protected override void OnInit(IUIData uiData = null)
|
||||
{
|
||||
mData = uiData as UIImageSelectMapData ?? new UIImageSelectMapData();
|
||||
@ -48,6 +57,10 @@ namespace QFramework.Example
|
||||
RightContent.RemoveAllChildren();
|
||||
itemDatas.Clear();
|
||||
leftAndRightMap.Clear();
|
||||
if (mData.random)
|
||||
{
|
||||
Utility.Shuffle(mData.items);
|
||||
}
|
||||
foreach (var item in mData.items)
|
||||
{
|
||||
var leftObj = GameObject.Instantiate(LeftItem, LeftContent);
|
||||
@ -86,7 +99,7 @@ namespace QFramework.Example
|
||||
Transform trans = data.pointerClick.transform;
|
||||
if (leftAndRightMap.ContainsKey(trans.gameObject))
|
||||
{
|
||||
leftAndRightMap[trans.gameObject].SetActive(true);
|
||||
leftAndRightMap[trans.gameObject].rightObj.SetActive(true);
|
||||
trans.GetComponent<Image>().color = Color.white;
|
||||
trans.Find("PicBg/Pic").GetComponent<Image>().color = new Color(1, 1, 1, 0);
|
||||
|
||||
@ -124,19 +137,29 @@ namespace QFramework.Example
|
||||
if (enterRight && leftAndRightMap.ContainsKey(enterRight) == false)
|
||||
{
|
||||
TextMeshProUGUI nameText = enterRight.transform.Find("Name").GetComponent<TextMeshProUGUI>();
|
||||
bool isRight = false;
|
||||
if (enterRight.name == itemDatas[leftDragObj].pic)
|
||||
{
|
||||
nameText.color = Color.green;
|
||||
isRight = true;
|
||||
if (Check())
|
||||
{
|
||||
if (string.IsNullOrEmpty(mData.finishedEvent))
|
||||
{
|
||||
StringEventSystem.Global.Send(mData.finishedEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
nameText.color = Color.red;
|
||||
|
||||
}
|
||||
Image img = enterRight.transform.Find("PicBg/Pic").GetComponent<Image>();
|
||||
img.sprite = moveObj.GetComponent<Image>().sprite;
|
||||
img.color = Color.white;
|
||||
nameText.text = itemDatas[leftDragObj].name;
|
||||
leftAndRightMap.Add(enterRight, leftDragObj);
|
||||
leftAndRightMap.Add(enterRight, new RightDataItem() { rightObj = leftDragObj, isRight = isRight });
|
||||
leftDragObj.SetActive(false);
|
||||
}
|
||||
GameObject.Destroy(moveObj);
|
||||
@ -144,6 +167,18 @@ namespace QFramework.Example
|
||||
leftDragObj = null;
|
||||
}
|
||||
|
||||
public bool Check()
|
||||
{
|
||||
foreach (var item in leftAndRightMap)
|
||||
{
|
||||
if (item.Value.isRight == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void LeftOnDrag(PointerEventData data)
|
||||
{
|
||||
//data.pointerDrag.transform.position = Input.mousePosition;
|
||||
|
||||
@ -1713,6 +1713,11 @@ namespace XMLTool
|
||||
{
|
||||
act.args.Add("rightBg", rightBg.Value);
|
||||
}
|
||||
XAttribute random = action.Attribute("random");
|
||||
if (random != null)
|
||||
{
|
||||
act.args.Add("random", random.Value);
|
||||
}
|
||||
foreach (var itemData in action.Elements("Item"))
|
||||
{
|
||||
act.items.Add(new ImageSelectMapAction.Item()
|
||||
|
||||
|
Before Width: | Height: | Size: 566 KiB After Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 180 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 283 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 113 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 508 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 173 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 467 KiB After Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 477 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 301 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 12 KiB |
@ -14,13 +14,14 @@
|
||||
<Enter>
|
||||
<Action type="Sequence">
|
||||
<Action type="ImageSelectMap"
|
||||
random="true"
|
||||
scoreName=""
|
||||
totalScore=""
|
||||
rightScore=""
|
||||
wrongScore=""
|
||||
rightLabel=""
|
||||
wrongLabel=""
|
||||
finishedEvent=""
|
||||
finishedEvent="全部完成"
|
||||
rightBg="baoshi/背景图.png">
|
||||
<Item name="碧玺(红)" pic="baoshi/碧玺(红).png"></Item>
|
||||
<Item name="玻璃猫眼(白)" pic="baoshi/玻璃猫眼(白).png"></Item>
|
||||
@ -48,6 +49,13 @@
|
||||
<Item name="紫晶" pic="baoshi/紫晶.png"></Item>
|
||||
</Action>
|
||||
|
||||
|
||||
<Condition type="StrEvent" value="全部完成"></Condition>
|
||||
|
||||
<Action type="TipWindow" value="恭喜你完成当前模块" btns="确定" audio=""></Action>
|
||||
|
||||
|
||||
|
||||
</Action>
|
||||
</Enter>
|
||||
</State>
|
||||
|
||||
@ -7,5 +7,60 @@
|
||||
<Type>All</Type>
|
||||
<Name>玉石分类</Name>
|
||||
<OnlyCurScore>true</OnlyCurScore>
|
||||
<!--状态机-->
|
||||
<FSM name="状态机1">
|
||||
<State name="初始状态">
|
||||
<Enter>
|
||||
<Action type="Sequence">
|
||||
<Action type="ImageSelectMap"
|
||||
scoreName=""
|
||||
totalScore=""
|
||||
rightScore=""
|
||||
wrongScore=""
|
||||
rightLabel=""
|
||||
wrongLabel=""
|
||||
finishedEvent="全部完成"
|
||||
rightBg="baoshi/背景图.png">
|
||||
<Item name="碧玺(红)" pic="baoshi/碧玺(红).png"></Item>
|
||||
<Item name="玻璃猫眼(白)" pic="baoshi/玻璃猫眼(白).png"></Item>
|
||||
<Item name="查罗石" pic="baoshi/查罗石.png"></Item>
|
||||
<Item name="发晶(无色)" pic="baoshi/发晶(无色).png"></Item>
|
||||
<Item name="方柱石" pic="baoshi/方柱石.png"></Item>
|
||||
<Item name="橄榄石" pic="baoshi/橄榄石.png"></Item>
|
||||
<Item name="合成红宝石" pic="baoshi/合成红宝石.png"></Item>
|
||||
<Item name="合成尖晶石" pic="baoshi/合成尖晶石.png"></Item>
|
||||
<Item name="红玛瑙" pic="baoshi/红玛瑙.png"></Item>
|
||||
<Item name="菱锰矿" pic="baoshi/菱锰矿.png"></Item>
|
||||
<Item name="合成立方氧化锆" pic="baoshi/合成立方氧化锆.png"></Item>
|
||||
<Item name="磷灰石" pic="baoshi/磷灰石.png"></Item>
|
||||
<Item name="石英岩玉" pic="baoshi/石英岩玉.png"></Item>
|
||||
<Item name="月光石(黄)" pic="baoshi/月光石(黄).png"></Item>
|
||||
<Item name="合成蓝宝石" pic="baoshi/合成蓝宝石.png"></Item>
|
||||
<Item name="托帕石" pic="baoshi/托帕石.png"></Item>
|
||||
<Item name="玉髓(蓝)" pic="baoshi/玉髓(蓝).png"></Item>
|
||||
<Item name="碧玺(绿)" pic="baoshi/碧玺(绿).png"></Item>
|
||||
<Item name="合成祖母绿" pic="baoshi/合成祖母绿.png"></Item>
|
||||
<Item name="和田玉(碧玉)" pic="baoshi/和田玉(碧玉).png"></Item>
|
||||
<Item name="欧泊(白)" pic="baoshi/欧泊(白).png"></Item>
|
||||
<Item name="月光石(白)" pic="baoshi/月光石(白).png"></Item>
|
||||
<Item name="合成蓝宝石" pic="baoshi/合成蓝宝石.png"></Item>
|
||||
<Item name="紫晶" pic="baoshi/紫晶.png"></Item>
|
||||
</Action>
|
||||
|
||||
<Condition type="StrEvent" value="全部完成"></Condition>
|
||||
|
||||
|
||||
<Action type="TipWindow" value="恭喜你完成当前模块" btns="确定" audio=""></Action>
|
||||
|
||||
|
||||
|
||||
</Action>
|
||||
</Enter>
|
||||
</State>
|
||||
|
||||
|
||||
<Transision from="any" to="初始状态">
|
||||
</Transision>
|
||||
</FSM>
|
||||
|
||||
</Module>
|
||||