modify scripts

This commit is contained in:
2025-10-17 09:14:59 +08:00
parent 0da10d3e7c
commit 9336ed0d6f
20 changed files with 778 additions and 24 deletions

View File

@ -0,0 +1,465 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1818791151053463826
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2567939603980722763}
- component: {fileID: 3423675973788078395}
- component: {fileID: 1805814460615924799}
- component: {fileID: 6259068709827928649}
- component: {fileID: 1114516486659757762}
m_Layer: 5
m_Name: MessageText
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2567939603980722763
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1818791151053463826}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1.0007356, y: 1.0007356, z: 1.0007356}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 8034155342639863909}
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_AnchoredPosition: {x: -0.55041504, y: 120.05658}
m_SizeDelta: {x: 800, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3423675973788078395
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1818791151053463826}
m_CullTransparentMesh: 1
--- !u!114 &1805814460615924799
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1818791151053463826}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: New Text
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4279308570
m_fontColor: {r: 0.103773594, g: 0.06510325, b: 0.06510325, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 48
m_fontSizeBase: 48
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 1
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!95 &6259068709827928649
Animator:
serializedVersion: 5
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1818791151053463826}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 0}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_StabilizeFeet: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
--- !u!225 &1114516486659757762
CanvasGroup:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1818791151053463826}
m_Enabled: 1
m_Alpha: 1
m_Interactable: 1
m_BlocksRaycasts: 1
m_IgnoreParentGroups: 0
--- !u!1 &7811482148034564061
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8034155342639863909}
- component: {fileID: 8031136941516792535}
- component: {fileID: 8016891387234896929}
- component: {fileID: 3521832069348138651}
- component: {fileID: 5153632076726711166}
m_Layer: 5
m_Name: MessagePopup
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8034155342639863909
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7811482148034564061}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2567939603980722763}
- {fileID: 8729196215722196391}
m_Father: {fileID: 0}
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_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1284, y: 400}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8031136941516792535
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7811482148034564061}
m_CullTransparentMesh: 0
--- !u!95 &8016891387234896929
Animator:
serializedVersion: 5
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7811482148034564061}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: cac0359e35eca487b8be1ca73b3d159d, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_StabilizeFeet: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
--- !u!225 &3521832069348138651
CanvasGroup:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7811482148034564061}
m_Enabled: 1
m_Alpha: 1
m_Interactable: 1
m_BlocksRaycasts: 1
m_IgnoreParentGroups: 0
--- !u!114 &5153632076726711166
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7811482148034564061}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b00e69d6788d74f1cb21197ea9faaa8d, type: 3}
m_Name:
m_EditorClassIdentifier:
fade: 1
closeButton: {fileID: 0}
tagsToShow: []
isPopupAboveTags: 0
fadeAlpha: 1
appearSound: {fileID: 0}
disappearSound: {fileID: 0}
messageText: {fileID: 1805814460615924799}
--- !u!1001 &4313604078728082956
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 8034155342639863909}
m_Modifications:
- target: {fileID: 90856562591110198, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_Color.b
value: 0.14509805
objectReference: {fileID: 0}
- target: {fileID: 90856562591110198, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_Color.g
value: 0.8901961
objectReference: {fileID: 0}
- target: {fileID: 90856562591110198, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_Color.r
value: 0.10980392
objectReference: {fileID: 0}
- target: {fileID: 907128453201242062, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_Name
value: NO
objectReference: {fileID: 0}
- target: {fileID: 1804143460132237798, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_SizeDelta.x
value: 308.7
objectReference: {fileID: 0}
- target: {fileID: 1804143460132237798, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_SizeDelta.y
value: 93.683
objectReference: {fileID: 0}
- target: {fileID: 1804143460132237798, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_AnchoredPosition.x
value: 6
objectReference: {fileID: 0}
- target: {fileID: 1804143460132237798, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_AnchoredPosition.y
value: 9.76
objectReference: {fileID: 0}
- target: {fileID: 3661189285963648132, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4641059037314894576, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_text
value: NO
objectReference: {fileID: 0}
- target: {fileID: 4641059037314894576, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: instanceID
value: NO
objectReference: {fileID: 0}
- target: {fileID: 4641059037314894576, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_fontSize
value: 77.4
objectReference: {fileID: 0}
- target: {fileID: 4641059037314894576, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_sharedMaterial
value:
objectReference: {fileID: 3722732180671858053, guid: 14928a98ac0086a4483452d618f1764c, type: 2}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_AnchorMax.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_AnchorMax.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_AnchorMin.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_AnchorMin.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_SizeDelta.x
value: 422.6
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_SizeDelta.y
value: 80
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_LocalScale.x
value: 1.0007356
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_LocalScale.y
value: 1.0007356
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_LocalScale.z
value: 1.0007356
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_AnchoredPosition.x
value: 242.62836
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_AnchoredPosition.y
value: -7.036865
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8610968763401608209, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8644439777305475629, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_Color.b
value: 0.84313726
objectReference: {fileID: 0}
- target: {fileID: 8644439777305475629, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_Color.g
value: 0.8039216
objectReference: {fileID: 0}
- target: {fileID: 8644439777305475629, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_Color.r
value: 0.7921569
objectReference: {fileID: 0}
- target: {fileID: 8673558434284163724, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_Color.b
value: 0.047058824
objectReference: {fileID: 0}
- target: {fileID: 8673558434284163724, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_Color.g
value: 0.69803923
objectReference: {fileID: 0}
- target: {fileID: 8673558434284163724, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
propertyPath: m_Color.r
value: 0.007843138
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects:
- {fileID: 6038492710620930376, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
- {fileID: 3661189285963648132, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
--- !u!224 &8729196215722196391 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 4825982739004869547, guid: e81bbbc218b73d345bfb5f45c5fa7c66, type: 3}
m_PrefabInstance: {fileID: 4313604078728082956}
m_PrefabAsset: {fileID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 520cfca0b533043a68fce421523ffd17
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -2617,6 +2617,7 @@ MonoBehaviour:
m_DeselectOnBackgroundClick: 1
m_PointerBehavior: 0
m_CursorLockBehavior: 0
m_ScrollDeltaPerTick: 6
--- !u!1 &1251246399
GameObject:
m_ObjectHideFlags: 0
@ -5096,7 +5097,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 862757017896117680, guid: 62f7a9d47df56401f802404b7d45d912, type: 3}
propertyPath: m_AnchoredPosition.y
value: -233.00006
value: -233.00012
objectReference: {fileID: 0}
- target: {fileID: 862757017896117680, guid: 62f7a9d47df56401f802404b7d45d912, type: 3}
propertyPath: m_LocalEulerAnglesHint.x

View File

@ -23,71 +23,71 @@ namespace WordsToolkit.Scripts.Editor
public static string WordConnect = "WordConnect";
private static string WordConnectPath = "Assets/WordConnectGameToolkit";
[MenuItem( nameof(WordConnect) + "/Settings/Shop settings")]
[MenuItem(nameof(WordConnect) + "/Settings/Shop settings")]
public static void IAPProducts()
{
Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(WordConnectPath + "/Resources/Settings/CoinsShopSettings.asset");
}
[MenuItem( nameof(WordConnect) + "/Settings/Ads settings")]
[MenuItem(nameof(WordConnect) + "/Settings/Ads settings")]
public static void AdsSettings()
{
Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(WordConnectPath + "/Resources/Settings/AdsSettings.asset");
}
//DailyBonusSettings
[MenuItem( nameof(WordConnect) + "/Settings/Daily bonus settings")]
[MenuItem(nameof(WordConnect) + "/Settings/Daily bonus settings")]
public static void DailyBonusSettings()
{
Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(WordConnectPath + "/Resources/Settings/DailyBonusSettings.asset");
}
//GameSettings
[MenuItem( nameof(WordConnect) + "/Settings/Game settings")]
[MenuItem(nameof(WordConnect) + "/Settings/Game settings")]
public static void GameSettings()
{
Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(WordConnectPath + "/Resources/Settings/GameSettings.asset");
}
//SpinSettings
[MenuItem( nameof(WordConnect) + "/Settings/Spin settings")]
[MenuItem(nameof(WordConnect) + "/Settings/Spin settings")]
public static void SpinSettings()
{
Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(WordConnectPath + "/Resources/Settings/SpinSettings.asset");
}
//DebugSettings
[MenuItem( nameof(WordConnect) + "/Settings/Debug settings")]
[MenuItem(nameof(WordConnect) + "/Settings/Debug settings")]
public static void DebugSettings()
{
Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(WordConnectPath + "/Resources/Settings/DebugSettings.asset");
}
[MenuItem( nameof(WordConnect) + "/Settings/Crossword config")]
[MenuItem(nameof(WordConnect) + "/Settings/Crossword config")]
public static void CrosswordConfig()
{
Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(WordConnectPath + "/Resources/Settings/CrosswordConfig.asset");
}
[MenuItem( nameof(WordConnect) + "/Settings/Tutorial settings")]
[MenuItem(nameof(WordConnect) + "/Settings/Tutorial settings")]
public static void TutorialSettings()
{
Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(WordConnectPath + "/Resources/Settings/TutorialSettings.asset");
}
[MenuItem( nameof(WordConnect) + "/Settings/Language configuration")]
[MenuItem(nameof(WordConnect) + "/Settings/Language configuration")]
public static void LanguageConfiguration()
{
Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(WordConnectPath + "/Resources/Settings/LanguageConfiguration.asset");
}
[MenuItem( nameof(WordConnect) + "/Settings/Gift settings")]
[MenuItem(nameof(WordConnect) + "/Settings/Gift settings")]
public static void GiftSettings()
{
Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(WordConnectPath + "/Resources/Settings/GiftSettings.asset");
}
[MenuItem( nameof(WordConnect) + "/Scenes/Main scene &1", priority = 0)]
[MenuItem(nameof(WordConnect) + "/Scenes/Main scene &1", priority = 0)]
public static void MainScene()
{
EditorSceneManager.OpenScene(WordConnectPath + "/Scenes/main.unity");
@ -99,7 +99,7 @@ namespace WordsToolkit.Scripts.Editor
EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
}
[MenuItem( nameof(WordConnect) + "/Scenes/Game scene &2")]
[MenuItem(nameof(WordConnect) + "/Scenes/Game scene &2")]
public static void GameScene()
{
var stateManager = Object.FindObjectOfType<StateManager>();
@ -107,7 +107,7 @@ namespace WordsToolkit.Scripts.Editor
EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
}
[MenuItem( nameof(WordConnect) + "/Editor/Tile editor", priority = 1)]
[MenuItem(nameof(WordConnect) + "/Editor/Tile editor", priority = 1)]
public static void ColorEditor()
{
string folderPath = WordConnectPath + "/Resources/ColorsTile";
@ -130,37 +130,44 @@ namespace WordsToolkit.Scripts.Editor
EditorGUIUtility.PingObject(tileAsset);
}
[MenuItem( nameof(WordConnect) + "/Documentation/Main", priority = 2)]
[MenuItem(nameof(WordConnect) + "/Documentation/Main", priority = 2)]
public static void MainDoc()
{
Application.OpenURL("https://candy-smith.gitbook.io/main");
}
[MenuItem( nameof(WordConnect) + "/Documentation/ADS/Setup ads")]
[MenuItem(nameof(WordConnect) + "/Documentation/ADS/Setup ads")]
public static void UnityadsDoc()
{
Application.OpenURL("https://candy-smith.gitbook.io/bubble-shooter-toolkit/tutorials/ads-setup/");
}
[MenuItem( nameof(WordConnect) + "/Documentation/Unity IAP (in-apps)")]
[MenuItem(nameof(WordConnect) + "/Documentation/Unity IAP (in-apps)")]
public static void Inapp()
{
Application.OpenURL("https://candy-smith.gitbook.io/main/block-puzzle-game-toolkit/setting-up-in-app-purchase-products");
}
[MenuItem( nameof(WordConnect) + "/NLP/Training Language Model")]
[MenuItem(nameof(WordConnect) + "/NLP/Training Language Model")]
public static void TrainingModel()
{
Application.OpenURL("https://colab.research.google.com/drive/199zNcB3FPfnrD6E7OiwmwCcf27jMnY1b?usp=sharing");
}
[MenuItem( nameof(WordConnect) + "/Reset PlayerPrefs &e")]
[MenuItem(nameof(WordConnect) + "/Reset PlayerPrefs &e")]
private static void ResetPlayerPrefs()
{
GameDataManager.ClearALlData();
PlayerPrefs.DeleteKey("GameState");
Debug.Log("PlayerPrefs are reset");
}
// 🔥 新增菜单项,打开 PrefabBatchViewer 窗口
[MenuItem(nameof(WordConnect) + "/Settings/Prefab Batch Viewer")]
public static void OpenPrefabBatchViewer()
{
PopupPreview.ShowWindow();
}
}
}

View File

@ -0,0 +1,93 @@
using UnityEditor;
using UnityEngine;
using System.IO;
using System.Linq;
public class PopupPreview : EditorWindow
{
private GameObject[] prefabs;
private int currentIndex = 0;
private GameObject currentInstance;
[MenuItem("Tools/Prefab Batch Viewer")]
public static void ShowWindow()
{
GetWindow<PopupPreview>("Prefab Batch Viewer");
}
private void OnEnable()
{
string path = "Assets/WordConnectGameToolkit/Resources/Popups";
string[] prefabPaths = Directory.GetFiles(path, "*.prefab", SearchOption.AllDirectories);
prefabs = prefabPaths
.Select(p => AssetDatabase.LoadAssetAtPath<GameObject>(p))
.Where(p => p != null)
.ToArray();
}
private void OnGUI()
{
if (prefabs == null || prefabs.Length == 0)
{
EditorGUILayout.LabelField("No prefabs found in Resources/Popups.");
return;
}
EditorGUILayout.LabelField($"Prefab {currentIndex + 1}/{prefabs.Length}", EditorStyles.boldLabel);
EditorGUILayout.ObjectField("Current Prefab", prefabs[currentIndex], typeof(GameObject), false);
GUILayout.Space(10);
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("Previous"))
{
ShowPreviousPrefab();
}
if (GUILayout.Button("Next"))
{
ShowNextPrefab();
}
EditorGUILayout.EndHorizontal();
GUILayout.Space(10);
if (currentInstance == null)
{
if (GUILayout.Button("Instantiate in Scene"))
{
InstantiateCurrentPrefab();
}
}
else
{
if (GUILayout.Button("Remove Instance"))
{
DestroyImmediate(currentInstance);
}
}
}
private void ShowPreviousPrefab()
{
currentIndex = (currentIndex - 1 + prefabs.Length) % prefabs.Length;
InstantiateCurrentPrefab();
}
private void ShowNextPrefab()
{
currentIndex = (currentIndex + 1) % prefabs.Length;
InstantiateCurrentPrefab();
}
private void InstantiateCurrentPrefab()
{
if (currentInstance != null)
{
DestroyImmediate(currentInstance);
}
currentInstance = (GameObject)PrefabUtility.InstantiatePrefab(prefabs[currentIndex]);
currentInstance.name = prefabs[currentIndex].name + "_Preview";
Selection.activeGameObject = currentInstance;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 599a70f1dde3c4f8b879a52397f2416e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -26,6 +26,7 @@ namespace WordsToolkit.Scripts.Enums
LanguageChanged,
TileSelected,
PurchaseSucceeded,
PurchaseFailed,
ButtonClicked,
WordAnimated,
ExtraWordClaimed

View File

@ -4,7 +4,11 @@
"references": [
"GUID:343deaaf83e0cee4ca978e7df0b80d21",
"GUID:d3bf71b33c0c04eb9bc1a8d6513d76bb",
"GUID:b0214a6008ed146ff8f122a6a9c2f6cc"
"GUID:b0214a6008ed146ff8f122a6a9c2f6cc",
"GUID:00dd4a7ac8c24c898083910c81898ecc",
"GUID:ac6e78962cfc743b9a5fc5f5a808aa72",
"GUID:b25ad8286798741e3b2cc3883283e669",
"GUID:75bdbcf23199f4cfb86c610d1d946666"
],
"includePlatforms": [
"Editor"

View File

@ -0,0 +1,21 @@
using UnityEngine;
using TMPro;
using UnityEngine.UI;
namespace WordsToolkit.Scripts.Popups
{
public class MessagePopup : Banner
{
[SerializeField] private TextMeshProUGUI messageText;
public void SetMessage(string message)
{
if (messageText != null)
{
messageText.text = message;
gameObject.SetActive(true);
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b00e69d6788d74f1cb21197ea9faaa8d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -49,6 +49,7 @@ namespace WordsToolkit.Scripts.Popups
}
EventManager.GetEvent<string>(EGameEvent.PurchaseSucceeded).Subscribe(PurchaseSucceded);
EventManager.GetEvent<(string, string)>(EGameEvent.PurchaseFailed).Subscribe(PurchaseFailed);
}
private void OnDisable()
@ -85,6 +86,44 @@ namespace WordsToolkit.Scripts.Popups
}
}
private void PurchaseFailed((string, string) info)
{
var productId = info.Item1;
var errorMessage = info.Item2;
var errorType = IAPErrorHelper.ParseError(errorMessage);
Debug.LogWarning($"Purchase failed for product {productId}: {errorMessage}, Error Type: {errorType}");
switch (errorType)
{
case IAPErrorType.InvalidProductID:
Debug.LogError($"Invalid product ID: {productId}");
ShowErrorMessage("Invalid product ID. Please try again later.");
break;
case IAPErrorType.UserCancelled:
Debug.LogWarning("Purchase cancelled by user.");
break;
case IAPErrorType.DuplicateTransaction:
Debug.LogWarning($"Duplicate transaction for product {productId}. This usually means the purchase was already completed.");
break;
case IAPErrorType.IAPInitFailed:
Debug.LogError("IAP initialization failed. Please check your IAP settings.");
ShowErrorMessage("IAP initialization failed. Please try again later.");
break;
default:
ShowErrorMessage($"Payment failed: {errorMessage}");
break;
}
}
private void ShowErrorMessage(string message)
{
var popup = menuManager.ShowPopup<MessagePopup>();
if (popup != null)
{
popup.SetMessage(message);
}
}
public void BuyCoins(string id)
{
// StopInteration();

View File

@ -25,6 +25,7 @@ namespace WordsToolkit.Scripts.Services.IAP
private IExtensionProvider extensionProvider;
public static event Action<string> OnSuccessfulPurchase;
public static event Action<(string,string)> OnFailedPurchase;
public static event Action<bool, List<string>> OnRestorePurchasesFinished;
public void InitializePurchasing(IEnumerable<(string productId, ProductTypeWrapper.ProductType productType)> products)
@ -111,20 +112,24 @@ namespace WordsToolkit.Scripts.Services.IAP
{
Debug.Log(string.Format("Purchasing product asychronously: '{0}'", product.definition.id));
storeController.InitiatePurchase(product);
OnFailedPurchase?.Invoke((productId, "Product not found or not available for purchase.")); // debug only
}
else
{
Debug.Log($"BuyProductID: FAIL. Not purchasing product, either is not found or is not available for purchase {productId}");
OnFailedPurchase?.Invoke((productId, "InvalidProductID: product not found or not available for purchase."));
}
}
else
{
Debug.Log("BuyProductID FAIL. Not initialized.");
Debug.Log("IAPInitFailed: BuyProductID FAIL. Not initialized.");
OnFailedPurchase?.Invoke((productId, "IAPInitFailed: Not initialized."));
}
}
catch (Exception e)
{
Debug.Log("BuyProductID: FAIL. Exception during purchase. " + e);
OnFailedPurchase?.Invoke((productId, "Exception during purchase: " + e.Message));
}
}
@ -159,11 +164,13 @@ namespace WordsToolkit.Scripts.Services.IAP
public void OnPurchaseFailed(Product product, PurchaseFailureDescription failureDescription)
{
Debug.Log("OnPurchaseFailed: FAIL. Product: " + product.definition.id + " PurchaseFailureDescription: " + failureDescription);
OnFailedPurchase?.Invoke((product.definition.id, failureDescription.message));
}
public void OnPurchaseFailed(Product i, PurchaseFailureReason p)
{
Debug.Log($"OnPurchaseFailed: FAIL. Product: '{i.definition.id}', PurchaseFailureReason: {p}");
OnFailedPurchase?.Invoke((i.definition.id, p.ToString()));
}
public void OnInitializeFailed(InitializationFailureReason reason)

View File

@ -0,0 +1,57 @@
using System;
namespace WordsToolkit.Scripts.Services.IAP
{
/// <summary>
/// IAP 典型错误类型枚举
/// </summary>
public enum IAPErrorType
{
None,
UserCancelled,
PaymentDeclined,
InsufficientFunds,
ProductUnavailable,
DuplicateTransaction,
NetworkError,
NetworkUnavailable,
IAPInitFailed,
InvalidProductID,
Unknown
}
public static class IAPErrorHelper
{
/// <summary>
/// 根据错误信息字符串,提取并映射到 IAPErrorType 枚举
/// </summary>
public static IAPErrorType ParseError(string errorMessage)
{
if (string.IsNullOrEmpty(errorMessage))
return IAPErrorType.Unknown;
errorMessage = errorMessage.ToLowerInvariant();
if (errorMessage.Contains("usercancelled") || errorMessage.Contains("user cancelled"))
return IAPErrorType.UserCancelled;
if (errorMessage.Contains("paymentdeclined") || errorMessage.Contains("payment declined"))
return IAPErrorType.PaymentDeclined;
if (errorMessage.Contains("insufficientfunds") || errorMessage.Contains("insufficient funds"))
return IAPErrorType.InsufficientFunds;
if (errorMessage.Contains("productunavailable") || errorMessage.Contains("product unavailable"))
return IAPErrorType.ProductUnavailable;
if (errorMessage.Contains("duplicatetransaction") || errorMessage.Contains("duplicate transaction"))
return IAPErrorType.DuplicateTransaction;
if (errorMessage.Contains("networkerror") || errorMessage.Contains("network error"))
return IAPErrorType.NetworkError;
if (errorMessage.Contains("networkunavailable") || errorMessage.Contains("network unavailable"))
return IAPErrorType.NetworkUnavailable;
if (errorMessage.Contains("InvalidProductID".ToLowerInvariant()) )
return IAPErrorType.InvalidProductID;
if (errorMessage.Contains("IAPInitFailed".ToLowerInvariant()))
return IAPErrorType.IAPInitFailed;
return IAPErrorType.Unknown;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 03eff658508844cfd91bab5657295e76
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -50,6 +50,12 @@ namespace WordsToolkit.Scripts.Services.IAP
IAPController.OnSuccessfulPurchase += purchaseHandler;
#endif
}
public void SubscribeToPurchaseFailedEvent(Action<(string, string)> purchaseHandler)
{
#if UNITY_PURCHASING
IAPController.OnFailedPurchase += purchaseHandler;
#endif
}
public void UnsubscribeFromPurchaseEvent(Action<string> purchaseHandler)
{

View File

@ -13,6 +13,8 @@ namespace WordsToolkit.Scripts.Services.IAP
bool IsProductPurchased(string productId);
void RestorePurchases(Action<bool, List<string>> action);
void SubscribeToPurchaseEvent(Action<string> purchaseHandler);
void SubscribeToPurchaseFailedEvent(Action<(string, string)> purchaseHandler);
void UnsubscribeFromPurchaseEvent(Action<string> purchaseHandler);
}
}

View File

@ -3,7 +3,11 @@
"rootNamespace": "",
"references": [
"GUID:d3bf71b33c0c04eb9bc1a8d6513d76bb",
"GUID:00dd4a7ac8c24c898083910c81898ecc"
"GUID:00dd4a7ac8c24c898083910c81898ecc",
"GUID:ac6e78962cfc743b9a5fc5f5a808aa72",
"GUID:b25ad8286798741e3b2cc3883283e669",
"GUID:75bdbcf23199f4cfb86c610d1d946666",
"GUID:b0214a6008ed146ff8f122a6a9c2f6cc"
],
"includePlatforms": [
"Editor"

View File

@ -103,6 +103,7 @@ namespace WordsToolkit.Scripts.System
language = langName;
EventManager.GetEvent<string>(EGameEvent.LanguageChanged).Subscribe(LanguageChanged);
iapManager.SubscribeToPurchaseEvent(PurchaseSucceeded);
iapManager.SubscribeToPurchaseFailedEvent(PurchaseFailed);
stateManager.OnStateChanged.AddListener((state) => {
if (state != EScreenStates.MainMenu)
@ -229,6 +230,11 @@ namespace WordsToolkit.Scripts.System
{
EventManager.GetEvent<string>(EGameEvent.PurchaseSucceeded).Invoke(id);
}
public void PurchaseFailed((string, string) info)
{
EventManager.GetEvent<(string, string)>(EGameEvent.PurchaseFailed).Invoke(info);
}
public void SetGameMode(EGameMode gameMode)
{

View File

@ -8,4 +8,5 @@ EditorBuildSettings:
- enabled: 1
path: Assets/WordConnectGameToolkit/Scenes/main.unity
guid: 88c9f51e8542e47d28fa27d5846353d5
m_configObjects: {}
m_configObjects:
com.unity.adaptiveperformance.simulator.provider_settings: {fileID: 11400000, guid: 3e70720b3e3ab479dbbe59419be4071d, type: 2}

View File

@ -165,7 +165,7 @@ PlayerSettings:
applicationIdentifier:
Android: com.CandySmith.WordConnect
Standalone: com.DefaultCompany.WordsCompleteProject
iPhone: com.CandySmith.WordConnect
iPhone: com.Sophon-Future-Technology--Shenzhen--Co.--Ltd..WordConnect
buildNumber:
Standalone: 0
VisionOS: 0