Merge branch 'master' of http://172.16.1.52:8090/r/GemBattle into master
# Conflicts:
# Assets/00000/package/Materials/Sequence_034_4X3.mat
3 files renamed
3 files copied
12 files deleted
20 files added
24 files modified
New file |
| | |
| | | %YAML 1.1 |
| | | %TAG !u! tag:unity3d.com,2011: |
| | | --- !u!21 &2100000 |
| | | Material: |
| | | serializedVersion: 6 |
| | | m_ObjectHideFlags: 0 |
| | | m_CorrespondingSourceObject: {fileID: 0} |
| | | m_PrefabInstance: {fileID: 0} |
| | | m_PrefabAsset: {fileID: 0} |
| | | m_Name: Glow_029 |
| | | m_Shader: {fileID: 203, guid: 0000000000000000f000000000000000, type: 0} |
| | | m_ShaderKeywords: |
| | | m_LightmapFlags: 4 |
| | | m_EnableInstancingVariants: 0 |
| | | m_DoubleSidedGI: 0 |
| | | m_CustomRenderQueue: -1 |
| | | stringTagMap: {} |
| | | disabledShaderPasses: [] |
| | | m_SavedProperties: |
| | | serializedVersion: 3 |
| | | m_TexEnvs: |
| | | - _MainTex: |
| | | m_Texture: {fileID: 2800000, guid: 2590ed49450e9ec4f83a55d334191a7c, type: 3} |
| | | m_Scale: {x: 1, y: 1} |
| | | m_Offset: {x: 0, y: 0} |
| | | m_Floats: |
| | | - _InvFade: 1 |
| | | m_Colors: |
| | | - _TintColor: {r: 1, g: 1, b: 1, a: 1} |
| | | m_BuildTextureStacks: [] |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 87675fbf1be9d324a82ba7d801523365 |
| | | NativeFormatImporter: |
| | | externalObjects: {} |
| | | mainObjectFileID: 0 |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | %YAML 1.1 |
| | | %TAG !u! tag:unity3d.com,2011: |
| | | --- !u!21 &2100000 |
| | | Material: |
| | | serializedVersion: 6 |
| | | m_ObjectHideFlags: 0 |
| | | m_CorrespondingSourceObject: {fileID: 0} |
| | | m_PrefabInstance: {fileID: 0} |
| | | m_PrefabAsset: {fileID: 0} |
| | | m_Name: Glow_029_b |
| | | m_Shader: {fileID: 203, guid: 0000000000000000f000000000000000, type: 0} |
| | | m_ShaderKeywords: |
| | | m_LightmapFlags: 4 |
| | | m_EnableInstancingVariants: 0 |
| | | m_DoubleSidedGI: 0 |
| | | m_CustomRenderQueue: -1 |
| | | stringTagMap: {} |
| | | disabledShaderPasses: [] |
| | | m_SavedProperties: |
| | | serializedVersion: 3 |
| | | m_TexEnvs: |
| | | - _MainTex: |
| | | m_Texture: {fileID: 2800000, guid: f71587def4007b54396d8d699e7f45dd, type: 3} |
| | | m_Scale: {x: 1, y: 1} |
| | | m_Offset: {x: 0.12, y: 0} |
| | | m_Floats: |
| | | - _InvFade: 1 |
| | | m_Colors: |
| | | - _TintColor: {r: 1, g: 1, b: 1, a: 1} |
| | | m_BuildTextureStacks: [] |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: dd836a103aa5136488fa96aae6f302af |
| | | NativeFormatImporter: |
| | | externalObjects: {} |
| | | mainObjectFileID: 0 |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2f8f8871ead832445a20709c09832794 |
| | | PrefabImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 842e361d71154fb4990124ed81ba359f |
| | | PrefabImporter: |
| | | externalObjects: {} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2590ed49450e9ec4f83a55d334191a7c |
| | | TextureImporter: |
| | | internalIDToNameTable: [] |
| | | externalObjects: {} |
| | | serializedVersion: 11 |
| | | mipmaps: |
| | | mipMapMode: 0 |
| | | enableMipMap: 1 |
| | | 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 |
| | | isReadable: 0 |
| | | streamingMipmaps: 0 |
| | | streamingMipmapsPriority: 0 |
| | | vTOnly: 0 |
| | | grayScaleToAlpha: 0 |
| | | generateCubemap: 6 |
| | | cubemapConvolution: 0 |
| | | seamlessCubemap: 0 |
| | | textureFormat: 1 |
| | | maxTextureSize: 2048 |
| | | textureSettings: |
| | | serializedVersion: 2 |
| | | filterMode: -1 |
| | | aniso: -1 |
| | | mipBias: -100 |
| | | wrapU: -1 |
| | | wrapV: -1 |
| | | wrapW: -1 |
| | | nPOTScale: 1 |
| | | lightmap: 0 |
| | | compressionQuality: 50 |
| | | spriteMode: 0 |
| | | 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: 0 |
| | | textureShape: 1 |
| | | singleChannelComponent: 0 |
| | | maxTextureSizeSet: 0 |
| | | compressionQualitySet: 0 |
| | | textureFormatSet: 0 |
| | | ignorePngGamma: 0 |
| | | applyGammaDecoding: 0 |
| | | platformSettings: |
| | | - serializedVersion: 3 |
| | | buildTarget: DefaultTexturePlatform |
| | | maxTextureSize: 2048 |
| | | resizeAlgorithm: 0 |
| | | textureFormat: -1 |
| | | textureCompression: 1 |
| | | compressionQuality: 50 |
| | | crunchedCompression: 0 |
| | | allowsAlphaSplitting: 0 |
| | | overridden: 0 |
| | | androidETC2FallbackOverride: 0 |
| | | forceMaximumCompressionQuality_BC6H_BC7: 0 |
| | | - serializedVersion: 3 |
| | | buildTarget: Standalone |
| | | maxTextureSize: 2048 |
| | | resizeAlgorithm: 0 |
| | | textureFormat: -1 |
| | | textureCompression: 1 |
| | | compressionQuality: 50 |
| | | crunchedCompression: 0 |
| | | allowsAlphaSplitting: 0 |
| | | overridden: 0 |
| | | androidETC2FallbackOverride: 0 |
| | | forceMaximumCompressionQuality_BC6H_BC7: 0 |
| | | spriteSheet: |
| | | serializedVersion: 2 |
| | | sprites: [] |
| | | outline: [] |
| | | physicsShape: [] |
| | | bones: [] |
| | | spriteID: |
| | | internalID: 0 |
| | | vertices: [] |
| | | indices: |
| | | edges: [] |
| | | weights: [] |
| | | secondaryTextures: [] |
| | | spritePackingTag: |
| | | pSDRemoveMatte: 0 |
| | | pSDShowRemoveMatteOption: 0 |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f71587def4007b54396d8d699e7f45dd |
| | | TextureImporter: |
| | | internalIDToNameTable: [] |
| | | externalObjects: {} |
| | | serializedVersion: 11 |
| | | mipmaps: |
| | | mipMapMode: 0 |
| | | enableMipMap: 1 |
| | | 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 |
| | | isReadable: 0 |
| | | streamingMipmaps: 0 |
| | | streamingMipmapsPriority: 0 |
| | | vTOnly: 0 |
| | | grayScaleToAlpha: 0 |
| | | generateCubemap: 6 |
| | | cubemapConvolution: 0 |
| | | seamlessCubemap: 0 |
| | | textureFormat: 1 |
| | | maxTextureSize: 2048 |
| | | textureSettings: |
| | | serializedVersion: 2 |
| | | filterMode: -1 |
| | | aniso: -1 |
| | | mipBias: -100 |
| | | wrapU: -1 |
| | | wrapV: -1 |
| | | wrapW: -1 |
| | | nPOTScale: 1 |
| | | lightmap: 0 |
| | | compressionQuality: 50 |
| | | spriteMode: 0 |
| | | 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: 0 |
| | | textureShape: 1 |
| | | singleChannelComponent: 0 |
| | | maxTextureSizeSet: 0 |
| | | compressionQualitySet: 0 |
| | | textureFormatSet: 0 |
| | | ignorePngGamma: 0 |
| | | applyGammaDecoding: 0 |
| | | platformSettings: |
| | | - serializedVersion: 3 |
| | | buildTarget: DefaultTexturePlatform |
| | | maxTextureSize: 2048 |
| | | resizeAlgorithm: 0 |
| | | textureFormat: -1 |
| | | textureCompression: 1 |
| | | compressionQuality: 50 |
| | | crunchedCompression: 0 |
| | | allowsAlphaSplitting: 0 |
| | | overridden: 0 |
| | | androidETC2FallbackOverride: 0 |
| | | forceMaximumCompressionQuality_BC6H_BC7: 0 |
| | | - serializedVersion: 3 |
| | | buildTarget: Standalone |
| | | maxTextureSize: 2048 |
| | | resizeAlgorithm: 0 |
| | | textureFormat: -1 |
| | | textureCompression: 1 |
| | | compressionQuality: 50 |
| | | crunchedCompression: 0 |
| | | allowsAlphaSplitting: 0 |
| | | overridden: 0 |
| | | androidETC2FallbackOverride: 0 |
| | | forceMaximumCompressionQuality_BC6H_BC7: 0 |
| | | spriteSheet: |
| | | serializedVersion: 2 |
| | | sprites: [] |
| | | outline: [] |
| | | physicsShape: [] |
| | | bones: [] |
| | | spriteID: |
| | | internalID: 0 |
| | | vertices: [] |
| | | indices: |
| | | edges: [] |
| | | weights: [] |
| | | secondaryTextures: [] |
| | | spritePackingTag: |
| | | pSDRemoveMatte: 0 |
| | | pSDShowRemoveMatteOption: 0 |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | second: |
| | | enabled: 1 |
| | | settings: {} |
| | | - first: |
| | | Editor: Editor |
| | | second: |
| | | enabled: 0 |
| | | settings: |
| | | DefaultValueInitialized: true |
| | | - first: |
| | | Windows Store Apps: WindowsStoreApps |
| | | second: |
| | | enabled: 0 |
| | | settings: |
| | | CPU: AnyCPU |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 82456dd283a56264d92902ae50e06456 |
| | | guid: 0c2f8d24849e5574898d03192b444bb6 |
| | | folderAsset: yes |
| | | DefaultImporter: |
| | | externalObjects: {} |
| | |
| | | fileFormatVersion: 2 |
| | | guid: e3bc83592a8aef948b12ab9dcb107545 |
| | | guid: 6cc564baab45349489ff49ce143f8c43 |
| | | TextScriptImporter: |
| | | externalObjects: {} |
| | | userData: |
File was renamed from Assets/GameAnalytics_SDK_Unity-master/Plugins/Android/SaaS_GameAnalytics_Android_SDK_V4.0.58.jar.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: add9cd1b03eb89c4c99bf8647a921ba9 |
| | | guid: d82934b38112c7d43a0adec8844ed447 |
| | | PluginImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections.Generic; |
| | | |
| | | public class TDAADemoScript : MonoBehaviour |
| | | { |
| | | private const int top = 100; |
| | | private const int left = 80; |
| | | private const int height = 50; |
| | | private readonly int width = Screen.width - (left * 2); |
| | | private const int step = 60; |
| | | private string deviceId; |
| | | private string oaid; |
| | | |
| | | private void OnGUI() |
| | | { |
| | | int i = 0; |
| | | GUI.Box(new Rect(10, 10, Screen.width - 20, Screen.height - 20), "Demo Menu"); |
| | | |
| | | GUI.Label(new Rect(left, top + (step * i++), width, height), deviceId); |
| | | if (GUI.Button(new Rect(left, top + (step * i++), width, height), "getDeviceId")) |
| | | { |
| | | deviceId = TalkingDataPlugin.GetDeviceId(); |
| | | } |
| | | |
| | | GUI.Label(new Rect(left, top + (step * i++), width, height), oaid); |
| | | if (GUI.Button(new Rect(left, top + (step * i++), width, height), "getOAID")) |
| | | { |
| | | oaid = TalkingDataPlugin.GetOAID(); |
| | | } |
| | | |
| | | if (GUI.Button(new Rect(left, top + (step * i++), width, height), "设置位置信息 纬度39.94 经度116.43")) |
| | | { |
| | | TalkingDataPlugin.SetLocation(39.94, 116.43); |
| | | } |
| | | |
| | | if (GUI.Button(new Rect(left, top + (step * i++), width, height), "OnRegister")) |
| | | { |
| | | TalkingDataPlugin.OnRegister("user01", TalkingDataAccountType.ANONYMOUS, "abc"); |
| | | } |
| | | |
| | | if (GUI.Button(new Rect(left, top + (step * i++), width, height), "OnLogin")) |
| | | { |
| | | TalkingDataPlugin.OnLogin("user01", TalkingDataAccountType.TYPE1, "abc"); |
| | | } |
| | | |
| | | //标准化事件 |
| | | #if TDAA_STANDARD |
| | | if (GUI.Button(new Rect(left, top + (step * i++), width, height), "OnViewItem")) |
| | | { |
| | | TalkingDataPlugin.OnViewItem("A1660", "手机", "iPhone 7", 538800); |
| | | } |
| | | |
| | | if (GUI.Button(new Rect(left, top + (step * i++), width, height), "OnAddItemToShoppingCart")) |
| | | { |
| | | TalkingDataPlugin.OnAddItemToShoppingCart("MLH12CH", "电脑", "MacBook Pro", 1388800, 1); |
| | | } |
| | | |
| | | if (GUI.Button(new Rect(left, top + step * i++, width, height), "OnViewShoppingCart")) |
| | | { |
| | | TalkingDataShoppingCart shoppingCart = TalkingDataShoppingCart.CreateShoppingCart(); |
| | | if (shoppingCart != null) |
| | | { |
| | | shoppingCart.AddItem("A1660", "手机", "iPhone 7", 538800, 2); |
| | | shoppingCart.AddItem("MLH12CH", "电脑", "MacBook Pro", 1388800, 1); |
| | | TalkingDataPlugin.OnViewShoppingCart(shoppingCart); |
| | | } |
| | | } |
| | | |
| | | if (GUI.Button(new Rect(left, top + (step * i++), width, height), "OnPlaceOrder")) |
| | | { |
| | | TalkingDataOrder order = TalkingDataOrder.CreateOrder("order01", 2466400, "CNY"); |
| | | order.AddItem("A1660", "手机", "iPhone 7", 538800, 2); |
| | | order.AddItem("MLH12CH", "电脑", "MacBook Pro", 1388800, 1); |
| | | TalkingDataPlugin.OnPlaceOrder("user01", order); |
| | | } |
| | | |
| | | if (GUI.Button(new Rect(left, top + (step * i++), width, height), "OnOrderPaySucc")) |
| | | { |
| | | TalkingDataOrder order = TalkingDataOrder.CreateOrder("order01", 2466400, "CNY"); |
| | | order.AddItem("A1660", "手机", "iPhone 7", 538800, 2); |
| | | order.AddItem("MLH12CH", "电脑", "MacBook Pro", 1388800, 1); |
| | | TalkingDataPlugin.OnOrderPaySucc("user01", "AliPay", order); |
| | | } |
| | | #endif |
| | | |
| | | //自定义事件 |
| | | #if TDAA_CUSTOM |
| | | if (GUI.Button(new Rect(left, top + (step * i++), width, height), "TrackEvent")) |
| | | { |
| | | TalkingDataPlugin.TrackEvent("action_id"); |
| | | } |
| | | |
| | | if (GUI.Button(new Rect(left, top + (step * i++), width, height), "TrackEventWithLabel")) |
| | | { |
| | | TalkingDataPlugin.TrackEventWithLabel("action_id", "action_label"); |
| | | } |
| | | |
| | | if (GUI.Button(new Rect(left, top + (step * i++), width, height), "TrackEventWithParameters")) |
| | | { |
| | | Dictionary<string, object> dic = new Dictionary<string, object> |
| | | { |
| | | { "StringValue", "Pi" }, |
| | | { "NumberValue", 3.14 } |
| | | }; |
| | | TalkingDataPlugin.TrackEventWithParameters("action_id", "action_label", dic); |
| | | } |
| | | |
| | | if (GUI.Button(new Rect(left, top + (step * i++), width, height), "首页推荐位点击")) |
| | | { |
| | | // 可定义eventId=点击首页推荐位;event_LABEL=具体的位置编号 |
| | | string recommandClick = "首页推荐位点击"; |
| | | Dictionary<string, object> dic = new Dictionary<string, object>(); |
| | | dic.Add("服装", "商品类别"); |
| | | dic.Add("5~10", "price"); |
| | | TalkingDataPlugin.TrackEventWithParameters(recommandClick, "第一广告位", dic); |
| | | Dictionary<string, object> dic2 = new Dictionary<string, object>(); |
| | | dic2.Add("家电", "商品类别"); |
| | | dic2.Add("500~1000", "price"); |
| | | TalkingDataPlugin.TrackEventWithParameters(recommandClick, "第三广告位", dic2); |
| | | } |
| | | if (GUI.Button(new Rect(left, top + (step * i++), width, height), "战斗失败")) |
| | | { |
| | | // 可定义eventId=战斗失败 |
| | | Dictionary<string, object> dic = new Dictionary<string, object>(); |
| | | dic.Add("20-30", "等级");//级别区间 |
| | | dic.Add("沼泽地阿卡村", "关卡名"); //关卡名称 |
| | | dic.Add("主动退出", "失败原因"); //失败原因 |
| | | dic.Add("10000~12000", "coin"); //携带金币数量 |
| | | TalkingDataPlugin.TrackEventWithParameters("战斗失败", null, dic); |
| | | } |
| | | #endif |
| | | |
| | | //页面统计 |
| | | #if TDAA_PAGE |
| | | if (GUI.Button(new Rect(left, top + (step * i++), width, height), "进入应用首页")) |
| | | { |
| | | TalkingDataPlugin.TrackPageBegin("应用首页");//传入的是页面名称 |
| | | } |
| | | |
| | | if (GUI.Button(new Rect(left, top + (step * i++), width, height), "离开应用首页")) |
| | | { |
| | | TalkingDataPlugin.TrackPageEnd("应用首页"); |
| | | } |
| | | #endif |
| | | } |
| | | |
| | | private void Start() |
| | | { |
| | | Debug.Log("Start"); |
| | | //TalkingDataPlugin.SetLogEnabled(false); |
| | | TalkingDataPlugin.BackgroundSessionEnabled(); |
| | | TalkingDataPlugin.SessionStarted("41F4DA3B72CF48D2ADAB761E6C17D12D", "1"); |
| | | TalkingDataPlugin.SetExceptionReportEnabled(true); |
| | | #if TDAA_PUSH |
| | | #if UNITY_IPHONE |
| | | UnityEngine.iOS.NotificationServices.RegisterForNotifications( |
| | | UnityEngine.iOS.NotificationType.Alert | |
| | | UnityEngine.iOS.NotificationType.Badge | |
| | | UnityEngine.iOS.NotificationType.Sound); |
| | | #endif |
| | | #endif |
| | | } |
| | | |
| | | private void Update() |
| | | { |
| | | if (Input.GetKey(KeyCode.Escape)) |
| | | { |
| | | Application.Quit(); |
| | | } |
| | | #if TDAA_PUSH |
| | | TalkingDataPlugin.SetDeviceToken(); |
| | | TalkingDataPlugin.HandlePushMessage(); |
| | | #endif |
| | | } |
| | | |
| | | private void OnDestroy() |
| | | { |
| | | Debug.Log("onDestroy"); |
| | | TalkingDataPlugin.SessionStoped(); |
| | | } |
| | | |
| | | private void Awake() |
| | | { |
| | | Debug.Log("Awake"); |
| | | } |
| | | |
| | | private void OnEnable() |
| | | { |
| | | Debug.Log("OnEnable"); |
| | | } |
| | | |
| | | private void OnDisable() |
| | | { |
| | | Debug.Log("OnDisable"); |
| | | } |
| | | } |
File was renamed from Assets/GameAnalytics_SDK_Unity-master/TalkingDataScripts/TDGADemoScript.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 7f8ff66103660e04096defa0bf88ae0b |
| | | guid: 4839422511da3f1499f47ec8702a09f6 |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using UnityEngine; |
| | | |
| | | |
| | | #if TDAA_STANDARD |
| | | public class TalkingDataOrder |
| | | { |
| | | #if UNITY_ANDROID |
| | | public AndroidJavaObject javaObj; |
| | | #endif |
| | | |
| | | #if UNITY_IPHONE |
| | | private string orderId; |
| | | private int total; |
| | | private string currencyType; |
| | | private string items = ""; |
| | | #endif |
| | | |
| | | public static TalkingDataOrder CreateOrder(string orderId, int total, string currencyType) |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | TalkingDataOrder order = new TalkingDataOrder(); |
| | | #if UNITY_ANDROID |
| | | AndroidJavaClass javaClass = new AndroidJavaClass("com.tendcloud.tenddata.Order"); |
| | | order.javaObj = javaClass.CallStatic<AndroidJavaObject>("createOrder", orderId, total, currencyType); |
| | | #endif |
| | | #if UNITY_IPHONE |
| | | order.orderId = orderId; |
| | | order.total = total; |
| | | order.currencyType = currencyType; |
| | | #endif |
| | | return order; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public TalkingDataOrder AddItem(string itemId, string category, string name, int unitPrice, int amount) |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_ANDROID |
| | | if (javaObj != null) |
| | | { |
| | | javaObj.Call<AndroidJavaObject>("addItem", itemId, category, name, unitPrice, amount); |
| | | } |
| | | #endif |
| | | #if UNITY_IPHONE |
| | | string item = "{\"itemId\":\"" + itemId + "\",\"category\":\"" + category + "\",\"name\":\"" + name + "\",\"unitPrice\":" + unitPrice + ",\"amount\":" + amount + "}"; |
| | | if (items.Length > 0) |
| | | { |
| | | items += ","; |
| | | } |
| | | items += item; |
| | | #endif |
| | | } |
| | | return this; |
| | | } |
| | | |
| | | #if UNITY_IPHONE |
| | | public override string ToString() |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | string orderStr = "{\"orderId\":\"" + orderId + "\",\"total\":" + total + ",\"currencyType\":\"" + currencyType + "\",\"items\":[" + items + "]}"; |
| | | return orderStr; |
| | | } |
| | | return null; |
| | | } |
| | | #endif |
| | | } |
| | | #endif |
copy from Assets/GameAnalytics_SDK_Unity-master/TalkingDataScripts/TDGAMission.cs.meta
copy to Assets/GameAnalytics_SDK_Unity-master/TalkingDataScripts/TalkingDataOrder.cs.meta
File was copied from Assets/GameAnalytics_SDK_Unity-master/TalkingDataScripts/TDGAMission.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1ab4657863462fb498c66c0c75a76abb |
| | | guid: 658eb5d78609fca419c10199e95fbdbf |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using UnityEngine; |
| | | using System.Collections.Generic; |
| | | #if UNITY_ANDROID |
| | | using System; |
| | | #endif |
| | | #if UNITY_IPHONE |
| | | using System.Runtime.InteropServices; |
| | | using System.Collections; |
| | | #endif |
| | | |
| | | |
| | | public enum TalkingDataAccountType |
| | | { |
| | | ANONYMOUS = 0, |
| | | REGISTERED = 1, |
| | | SINA_WEIBO = 2, |
| | | QQ = 3, |
| | | QQ_WEIBO = 4, |
| | | ND91 = 5, |
| | | WEIXIN = 6, |
| | | TYPE1 = 11, |
| | | TYPE2 = 12, |
| | | TYPE3 = 13, |
| | | TYPE4 = 14, |
| | | TYPE5 = 15, |
| | | TYPE6 = 16, |
| | | TYPE7 = 17, |
| | | TYPE8 = 18, |
| | | TYPE9 = 19, |
| | | TYPE10 = 20 |
| | | } |
| | | |
| | | |
| | | public static class TalkingDataPlugin |
| | | { |
| | | #if UNITY_ANDROID |
| | | private static readonly string APP_ANALYTICS_CLASS = "com.tendcloud.tenddata.TCAgent"; |
| | | private static AndroidJavaClass appAnalyticsClass; |
| | | private static AndroidJavaClass unityPlayerClass; |
| | | #endif |
| | | |
| | | #if UNITY_IPHONE |
| | | [DllImport("__Internal")] |
| | | private static extern string TDAAGetDeviceId(); |
| | | |
| | | [DllImport("__Internal")] |
| | | private static extern void TDAASetLogEnabled(bool enable); |
| | | |
| | | [DllImport("__Internal")] |
| | | private static extern void TDAABackgroundSessionEnabled(); |
| | | |
| | | [DllImport("__Internal")] |
| | | private static extern void TDAASessionStarted(string appId, string channelId); |
| | | |
| | | [DllImport("__Internal")] |
| | | private static extern void TDAASetExceptionReportEnabled(bool enable); |
| | | |
| | | [DllImport("__Internal")] |
| | | private static extern void TDAASetLocation(double latitude, double longitude); |
| | | |
| | | [DllImport("__Internal")] |
| | | private static extern void TDAAOnRegister(string accountId, int type, string name); |
| | | |
| | | [DllImport("__Internal")] |
| | | private static extern void TDAAOnLogin(string accountId, int type, string name); |
| | | |
| | | #if TDAA_STANDARD |
| | | [DllImport("__Internal")] |
| | | private static extern void TDAAOnViewItem(string itemId, string category, string name, int unitPrice); |
| | | |
| | | [DllImport("__Internal")] |
| | | private static extern void TDAAOnAddItemToShoppingCart(string item, string category, string name, int unitPrice, int amount); |
| | | |
| | | [DllImport("__Internal")] |
| | | private static extern void TDAAOnViewShoppingCart(string shoppingCartJson); |
| | | |
| | | [DllImport("__Internal")] |
| | | private static extern void TDAAOnPlaceOrder(string account, string orderJson); |
| | | |
| | | [DllImport("__Internal")] |
| | | private static extern void TDAAOnOrderPaySucc(string account, string payType, string orderJson); |
| | | #endif |
| | | |
| | | #if TDAA_CUSTOM |
| | | [DllImport("__Internal")] |
| | | private static extern void TDAATrackEvent(string eventId); |
| | | |
| | | [DllImport("__Internal")] |
| | | private static extern void TDAATrackEventLabel(string eventId, string eventLabel); |
| | | |
| | | [DllImport("__Internal")] |
| | | private static extern void TDAATrackEventParameters(string eventId, string eventLabel, string parameters); |
| | | #endif |
| | | |
| | | #if TDAA_PAGE |
| | | [DllImport("__Internal")] |
| | | private static extern void TDAATrackPageBegin(string pageName); |
| | | |
| | | [DllImport("__Internal")] |
| | | private static extern void TDAATrackPageEnd(string pageName); |
| | | #endif |
| | | |
| | | #if TDAA_PUSH |
| | | [DllImport("__Internal")] |
| | | private static extern void TDAASetDeviceToken(byte[] deviceToken, int length); |
| | | |
| | | [DllImport("__Internal")] |
| | | private static extern void TDAAHandlePushMessage(string message); |
| | | |
| | | private static bool hasTokenBeenObtained = false; |
| | | #endif |
| | | #endif |
| | | |
| | | #if UNITY_ANDROID |
| | | private static AndroidJavaObject GetCurrentActivity() |
| | | { |
| | | if (unityPlayerClass == null) |
| | | { |
| | | unityPlayerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); |
| | | } |
| | | AndroidJavaObject activity = unityPlayerClass.GetStatic<AndroidJavaObject>("currentActivity"); |
| | | return activity; |
| | | } |
| | | #endif |
| | | |
| | | private static string deviceId = null; |
| | | public static string GetDeviceId() |
| | | { |
| | | if (deviceId == null && Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_ANDROID |
| | | if (appAnalyticsClass == null) |
| | | { |
| | | appAnalyticsClass = new AndroidJavaClass(APP_ANALYTICS_CLASS); |
| | | } |
| | | deviceId = appAnalyticsClass.CallStatic<string>("getDeviceId", GetCurrentActivity()); |
| | | #endif |
| | | #if UNITY_IPHONE |
| | | deviceId = TDAAGetDeviceId(); |
| | | #endif |
| | | } |
| | | return deviceId; |
| | | } |
| | | |
| | | private static string oaid = null; |
| | | public static string GetOAID() |
| | | { |
| | | if (oaid == null && Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_ANDROID |
| | | if (appAnalyticsClass == null) |
| | | { |
| | | appAnalyticsClass = new AndroidJavaClass(APP_ANALYTICS_CLASS); |
| | | } |
| | | oaid = appAnalyticsClass.CallStatic<string>("getOAID", GetCurrentActivity()); |
| | | #endif |
| | | } |
| | | return oaid; |
| | | } |
| | | |
| | | public static void SetLogEnabled(bool enable) |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_ANDROID |
| | | if (appAnalyticsClass == null) |
| | | { |
| | | appAnalyticsClass = new AndroidJavaClass(APP_ANALYTICS_CLASS); |
| | | } |
| | | appAnalyticsClass.SetStatic("LOG_ON", enable); |
| | | #endif |
| | | #if UNITY_IPHONE |
| | | TDAASetLogEnabled(enable); |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | public static void BackgroundSessionEnabled() |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_IPHONE |
| | | TDAABackgroundSessionEnabled(); |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | public static void SessionStarted(string appId, string channelId) |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | Debug.Log("TalkingData App Analytics Unity SDK."); |
| | | #if UNITY_ANDROID |
| | | using (AndroidJavaClass dz = new AndroidJavaClass("com.tendcloud.tenddata.dz")) |
| | | { |
| | | dz.SetStatic("a", 2); |
| | | } |
| | | if (appAnalyticsClass == null) |
| | | { |
| | | appAnalyticsClass = new AndroidJavaClass(APP_ANALYTICS_CLASS); |
| | | } |
| | | AndroidJavaObject activity = GetCurrentActivity(); |
| | | appAnalyticsClass.CallStatic("init", activity, appId, channelId); |
| | | appAnalyticsClass.CallStatic("onResume", activity); |
| | | #endif |
| | | #if UNITY_IPHONE |
| | | TDAASessionStarted(appId, channelId); |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | public static void SessionStoped() |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_ANDROID |
| | | if (appAnalyticsClass != null) |
| | | { |
| | | appAnalyticsClass.CallStatic("onPause", GetCurrentActivity()); |
| | | appAnalyticsClass = null; |
| | | unityPlayerClass = null; |
| | | } |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | public static void SetExceptionReportEnabled(bool enable) |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_ANDROID |
| | | if (appAnalyticsClass != null) |
| | | { |
| | | appAnalyticsClass.CallStatic("setReportUncaughtExceptions", enable); |
| | | } |
| | | #endif |
| | | #if UNITY_IPHONE |
| | | TDAASetExceptionReportEnabled(enable); |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | public static void SetLocation(double latitude, double longitude) |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_IPHONE |
| | | TDAASetLocation(latitude, longitude); |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | public static void OnRegister(string accountId, TalkingDataAccountType type, string name) |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_ANDROID |
| | | if (appAnalyticsClass != null) |
| | | { |
| | | AndroidJavaClass enumClass = new AndroidJavaClass("com.tendcloud.tenddata.TDAccount$AccountType"); |
| | | AndroidJavaObject typeObj = enumClass.CallStatic<AndroidJavaObject>("valueOf", type.ToString()); |
| | | appAnalyticsClass.CallStatic("onRegister", accountId, typeObj, name); |
| | | enumClass.Dispose(); |
| | | } |
| | | #endif |
| | | #if UNITY_IPHONE |
| | | TDAAOnRegister(accountId, (int)type, name); |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | public static void OnLogin(string accountId, TalkingDataAccountType type, string name) |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_ANDROID |
| | | if (appAnalyticsClass != null) |
| | | { |
| | | AndroidJavaClass enumClass = new AndroidJavaClass("com.tendcloud.tenddata.TDAccount$AccountType"); |
| | | AndroidJavaObject typeObj = enumClass.CallStatic<AndroidJavaObject>("valueOf", type.ToString()); |
| | | appAnalyticsClass.CallStatic("onLogin", accountId, typeObj, name); |
| | | enumClass.Dispose(); |
| | | } |
| | | #endif |
| | | #if UNITY_IPHONE |
| | | TDAAOnLogin(accountId, (int)type, name); |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | #if TDAA_STANDARD |
| | | public static void OnViewItem(string itemId, string category, string name, int unitPrice) |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_ANDROID |
| | | if (appAnalyticsClass != null) |
| | | { |
| | | appAnalyticsClass.CallStatic("onViewItem", itemId, category, name, unitPrice); |
| | | } |
| | | #endif |
| | | #if UNITY_IPHONE |
| | | TDAAOnViewItem(itemId, category, name, unitPrice); |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | public static void OnAddItemToShoppingCart(string itemId, string category, string name, int unitPrice, int amount) |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_ANDROID |
| | | if (appAnalyticsClass != null) |
| | | { |
| | | appAnalyticsClass.CallStatic("onAddItemToShoppingCart", itemId, category, name, unitPrice, amount); |
| | | } |
| | | #endif |
| | | #if UNITY_IPHONE |
| | | TDAAOnAddItemToShoppingCart(itemId, category, name, unitPrice, amount); |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | public static void OnViewShoppingCart(TalkingDataShoppingCart shoppingCart) |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_ANDROID |
| | | if (appAnalyticsClass != null) |
| | | { |
| | | appAnalyticsClass.CallStatic("onViewShoppingCart", shoppingCart.javaObj); |
| | | } |
| | | #endif |
| | | #if UNITY_IPHONE |
| | | TDAAOnViewShoppingCart(shoppingCart.ToString()); |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | public static void OnPlaceOrder(string accountId, TalkingDataOrder order) |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_ANDROID |
| | | if (appAnalyticsClass != null) |
| | | { |
| | | appAnalyticsClass.CallStatic("onPlaceOrder", accountId, order.javaObj); |
| | | } |
| | | #endif |
| | | #if UNITY_IPHONE |
| | | TDAAOnPlaceOrder(accountId, order.ToString()); |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | public static void OnOrderPaySucc(string accountId, string payType, TalkingDataOrder order) |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_ANDROID |
| | | if (appAnalyticsClass != null) |
| | | { |
| | | appAnalyticsClass.CallStatic("onOrderPaySucc", accountId, payType, order.javaObj); |
| | | } |
| | | #endif |
| | | #if UNITY_IPHONE |
| | | TDAAOnOrderPaySucc(accountId, payType, order.ToString()); |
| | | #endif |
| | | } |
| | | } |
| | | #endif |
| | | |
| | | #if TDAA_CUSTOM |
| | | public static void TrackEvent(string eventId) |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_ANDROID |
| | | if (appAnalyticsClass != null) |
| | | { |
| | | appAnalyticsClass.CallStatic("onEvent", GetCurrentActivity(), eventId); |
| | | } |
| | | #endif |
| | | #if UNITY_IPHONE |
| | | TDAATrackEvent(eventId); |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | public static void TrackEventWithLabel(string eventId, string eventLabel) |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_ANDROID |
| | | if (appAnalyticsClass != null) |
| | | { |
| | | appAnalyticsClass.CallStatic("onEvent", GetCurrentActivity(), eventId, eventLabel); |
| | | } |
| | | #endif |
| | | #if UNITY_IPHONE |
| | | TDAATrackEventLabel(eventId, eventLabel); |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | public static void TrackEventWithParameters(string eventId, string eventLabel, Dictionary<string, object> parameters) |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_ANDROID |
| | | if (appAnalyticsClass != null) |
| | | { |
| | | if (parameters != null && parameters.Count > 0) |
| | | { |
| | | int count = parameters.Count; |
| | | AndroidJavaObject map = new AndroidJavaObject("java.util.HashMap", count); |
| | | IntPtr method_Put = AndroidJNIHelper.GetMethodID(map.GetRawClass(), "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); |
| | | object[] args = new object[2]; |
| | | foreach (KeyValuePair<string, object> kvp in parameters) |
| | | { |
| | | args[0] = new AndroidJavaObject("java.lang.String", kvp.Key); |
| | | args[1] = typeof(string).IsInstanceOfType(kvp.Value) |
| | | ? new AndroidJavaObject("java.lang.String", kvp.Value) |
| | | : new AndroidJavaObject("java.lang.Double", "" + kvp.Value); |
| | | AndroidJNI.CallObjectMethod(map.GetRawObject(), method_Put, AndroidJNIHelper.CreateJNIArgArray(args)); |
| | | } |
| | | appAnalyticsClass.CallStatic("onEvent", GetCurrentActivity(), eventId, eventLabel, map); |
| | | map.Dispose(); |
| | | } |
| | | else |
| | | { |
| | | appAnalyticsClass.CallStatic("onEvent", GetCurrentActivity(), eventId, eventLabel, null); |
| | | } |
| | | } |
| | | #endif |
| | | #if UNITY_IPHONE |
| | | if (parameters != null && parameters.Count > 0) |
| | | { |
| | | string parameterStr = "{"; |
| | | foreach (KeyValuePair<string, object> kvp in parameters) |
| | | { |
| | | if (kvp.Value is string) |
| | | { |
| | | parameterStr += "\"" + kvp.Key + "\":\"" + kvp.Value + "\","; |
| | | } |
| | | else |
| | | { |
| | | try |
| | | { |
| | | double tmp = System.Convert.ToDouble(kvp.Value); |
| | | parameterStr += "\"" + kvp.Key + "\":" + tmp + ","; |
| | | } |
| | | catch (System.Exception) |
| | | { |
| | | } |
| | | } |
| | | } |
| | | parameterStr = parameterStr.TrimEnd(','); |
| | | parameterStr += "}"; |
| | | TDAATrackEventParameters(eventId, eventLabel, parameterStr); |
| | | } |
| | | else |
| | | { |
| | | TDAATrackEventParameters(eventId, eventLabel, null); |
| | | } |
| | | #endif |
| | | } |
| | | } |
| | | #endif |
| | | |
| | | #if TDAA_PAGE |
| | | public static void TrackPageBegin(string pageName) |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_ANDROID |
| | | if (appAnalyticsClass != null) |
| | | { |
| | | appAnalyticsClass.CallStatic("onPageStart", GetCurrentActivity(), pageName); |
| | | } |
| | | #endif |
| | | #if UNITY_IPHONE |
| | | TDAATrackPageBegin(pageName); |
| | | #endif |
| | | } |
| | | } |
| | | |
| | | public static void TrackPageEnd(string pageName) |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_ANDROID |
| | | if (appAnalyticsClass != null) |
| | | { |
| | | appAnalyticsClass.CallStatic("onPageEnd", GetCurrentActivity(), pageName); |
| | | } |
| | | #endif |
| | | #if UNITY_IPHONE |
| | | TDAATrackPageEnd(pageName); |
| | | #endif |
| | | } |
| | | } |
| | | #endif |
| | | |
| | | #if TDAA_PUSH |
| | | public static void SetDeviceToken() |
| | | { |
| | | #if UNITY_IPHONE |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | if (!hasTokenBeenObtained) |
| | | { |
| | | byte[] deviceToken = UnityEngine.iOS.NotificationServices.deviceToken; |
| | | if (deviceToken != null) |
| | | { |
| | | TDAASetDeviceToken(deviceToken, deviceToken.Length); |
| | | hasTokenBeenObtained = true; |
| | | } |
| | | } |
| | | } |
| | | #endif |
| | | } |
| | | |
| | | public static void HandlePushMessage() |
| | | { |
| | | #if UNITY_IPHONE |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | UnityEngine.iOS.RemoteNotification[] notifications = UnityEngine.iOS.NotificationServices.remoteNotifications; |
| | | if (notifications != null) |
| | | { |
| | | UnityEngine.iOS.NotificationServices.ClearRemoteNotifications(); |
| | | foreach (UnityEngine.iOS.RemoteNotification rn in notifications) |
| | | { |
| | | foreach (DictionaryEntry de in rn.userInfo) |
| | | { |
| | | if (de.Key.ToString().Equals("sign")) |
| | | { |
| | | string sign = de.Value.ToString(); |
| | | TDAAHandlePushMessage(sign); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | #endif |
| | | } |
| | | #endif |
| | | } |
copy from Assets/GameAnalytics_SDK_Unity-master/TalkingDataScripts/TDGAMission.cs.meta
copy to Assets/GameAnalytics_SDK_Unity-master/TalkingDataScripts/TalkingDataPlugin.cs.meta
File was copied from Assets/GameAnalytics_SDK_Unity-master/TalkingDataScripts/TDGAMission.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1ab4657863462fb498c66c0c75a76abb |
| | | guid: 2e40b5e3cadfad048a452d87cc1d63ea |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
New file |
| | |
| | | using UnityEngine; |
| | | |
| | | |
| | | #if TDAA_STANDARD |
| | | public class TalkingDataShoppingCart |
| | | { |
| | | #if UNITY_ANDROID |
| | | public AndroidJavaObject javaObj; |
| | | #endif |
| | | |
| | | #if UNITY_IPHONE |
| | | private string items = ""; |
| | | #endif |
| | | |
| | | public static TalkingDataShoppingCart CreateShoppingCart() |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | TalkingDataShoppingCart shoppingCart = new TalkingDataShoppingCart(); |
| | | #if UNITY_ANDROID |
| | | AndroidJavaClass javaClass = new AndroidJavaClass("com.tendcloud.tenddata.ShoppingCart"); |
| | | shoppingCart.javaObj = javaClass.CallStatic<AndroidJavaObject>("createShoppingCart"); |
| | | #endif |
| | | return shoppingCart; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public TalkingDataShoppingCart AddItem(string itemId, string category, string name, int unitPrice, int amount) |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | #if UNITY_ANDROID |
| | | if (javaObj != null) |
| | | { |
| | | javaObj.Call<AndroidJavaObject>("addItem", itemId, category, name, unitPrice, amount); |
| | | } |
| | | #endif |
| | | #if UNITY_IPHONE |
| | | string item = "{\"itemId\":\"" + itemId + "\",\"category\":\"" + category + "\",\"name\":\"" + name + "\",\"unitPrice\":" + unitPrice + ",\"amount\":" + amount + "}"; |
| | | if (items.Length > 0) |
| | | { |
| | | items += ","; |
| | | } |
| | | items += item; |
| | | #endif |
| | | } |
| | | return this; |
| | | } |
| | | |
| | | #if UNITY_IPHONE |
| | | public override string ToString() |
| | | { |
| | | if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor) |
| | | { |
| | | string orderStr = "{\"items\":[" + items + "]}"; |
| | | return orderStr; |
| | | } |
| | | return null; |
| | | } |
| | | #endif |
| | | } |
| | | #endif |
File was renamed from Assets/GameAnalytics_SDK_Unity-master/TalkingDataScripts/TDGAMission.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1ab4657863462fb498c66c0c75a76abb |
| | | guid: 2d9a8f84c0025c249b83ae0b1c9b9a9d |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | - _OcclusionStrength: 1 |
| | | - _Parallax: 0.02 |
| | | - _Slider: 81.39478 |
| | | - _SliderX: 75 |
| | | - _SliderY: 80 |
| | | - _SliderX: 79 |
| | | - _SliderY: 265 |
| | | - _SmoothnessTextureChannel: 0 |
| | | - _SpecularHighlights: 1 |
| | | - _SrcBlend: 1 |
| | |
| | | - _UseUIAlphaClip: 0 |
| | | - _ZWrite: 1 |
| | | m_Colors: |
| | | - _Center: {r: 6, g: -198, b: 0, a: 0} |
| | | - _Center: {r: -145, g: 155, b: 0, a: 0} |
| | | - _Color: {r: 1, g: 1, b: 1, a: 1} |
| | | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} |
| | | m_BuildTextureStacks: [] |
| | |
| | | m_PrefabInstance: {fileID: 0} |
| | | m_PrefabAsset: {fileID: 0} |
| | | m_GameObject: {fileID: 501810470} |
| | | m_Enabled: 0 |
| | | m_Enabled: 1 |
| | | m_EditorHideFlags: 0 |
| | | m_Script: {fileID: 11500000, guid: 5671a738ca063f047a1619ba0c199f45, type: 3} |
| | | m_Name: |
| | |
| | | m_Father: {fileID: 0} |
| | | m_RootOrder: 1 |
| | | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} |
| | | --- !u!1 &987425173 |
| | | GameObject: |
| | | m_ObjectHideFlags: 0 |
| | | m_CorrespondingSourceObject: {fileID: 0} |
| | | m_PrefabInstance: {fileID: 0} |
| | | m_PrefabAsset: {fileID: 0} |
| | | serializedVersion: 6 |
| | | m_Component: |
| | | - component: {fileID: 987425174} |
| | | - component: {fileID: 987425177} |
| | | - component: {fileID: 987425176} |
| | | - component: {fileID: 987425175} |
| | | m_Layer: 5 |
| | | m_Name: Button (1) |
| | | m_TagString: Untagged |
| | | m_Icon: {fileID: 0} |
| | | m_NavMeshLayer: 0 |
| | | m_StaticEditorFlags: 0 |
| | | m_IsActive: 1 |
| | | --- !u!224 &987425174 |
| | | RectTransform: |
| | | m_ObjectHideFlags: 0 |
| | | m_CorrespondingSourceObject: {fileID: 0} |
| | | m_PrefabInstance: {fileID: 0} |
| | | m_PrefabAsset: {fileID: 0} |
| | | m_GameObject: {fileID: 987425173} |
| | | 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_Children: |
| | | - {fileID: 2127121675} |
| | | m_Father: {fileID: 1805855186} |
| | | m_RootOrder: 1 |
| | | 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: 86} |
| | | m_SizeDelta: {x: 209.28, y: 50} |
| | | m_Pivot: {x: 0.5, y: 0.5} |
| | | --- !u!114 &987425175 |
| | | MonoBehaviour: |
| | | m_ObjectHideFlags: 0 |
| | | m_CorrespondingSourceObject: {fileID: 0} |
| | | m_PrefabInstance: {fileID: 0} |
| | | m_PrefabAsset: {fileID: 0} |
| | | m_GameObject: {fileID: 987425173} |
| | | m_Enabled: 1 |
| | | m_EditorHideFlags: 0 |
| | | m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} |
| | | m_Name: |
| | | m_EditorClassIdentifier: |
| | | m_Navigation: |
| | | m_Mode: 3 |
| | | m_SelectOnUp: {fileID: 0} |
| | | m_SelectOnDown: {fileID: 0} |
| | | m_SelectOnLeft: {fileID: 0} |
| | | m_SelectOnRight: {fileID: 0} |
| | | m_Transition: 1 |
| | | m_Colors: |
| | | m_NormalColor: {r: 1, g: 1, b: 1, a: 1} |
| | | m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} |
| | | m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} |
| | | m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} |
| | | m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} |
| | | m_ColorMultiplier: 1 |
| | | m_FadeDuration: 0.1 |
| | | m_SpriteState: |
| | | m_HighlightedSprite: {fileID: 0} |
| | | m_PressedSprite: {fileID: 0} |
| | | m_SelectedSprite: {fileID: 0} |
| | | m_DisabledSprite: {fileID: 0} |
| | | m_AnimationTriggers: |
| | | m_NormalTrigger: Normal |
| | | m_HighlightedTrigger: Highlighted |
| | | m_PressedTrigger: Pressed |
| | | m_SelectedTrigger: Selected |
| | | m_DisabledTrigger: Disabled |
| | | m_Interactable: 1 |
| | | m_TargetGraphic: {fileID: 987425176} |
| | | m_OnClick: |
| | | m_PersistentCalls: |
| | | m_Calls: |
| | | - m_Target: {fileID: 501810470} |
| | | m_TargetAssemblyTypeName: |
| | | m_MethodName: |
| | | m_Mode: 1 |
| | | m_Arguments: |
| | | m_ObjectArgument: {fileID: 0} |
| | | m_ObjectArgumentAssemblyTypeName: |
| | | m_IntArgument: 0 |
| | | m_FloatArgument: 0 |
| | | m_StringArgument: |
| | | m_BoolArgument: 0 |
| | | m_CallState: 2 |
| | | --- !u!114 &987425176 |
| | | MonoBehaviour: |
| | | m_ObjectHideFlags: 0 |
| | | m_CorrespondingSourceObject: {fileID: 0} |
| | | m_PrefabInstance: {fileID: 0} |
| | | m_PrefabAsset: {fileID: 0} |
| | | m_GameObject: {fileID: 987425173} |
| | | m_Enabled: 1 |
| | | m_EditorHideFlags: 0 |
| | | m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, 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_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} |
| | | m_Type: 1 |
| | | m_PreserveAspect: 0 |
| | | m_FillCenter: 1 |
| | | m_FillMethod: 4 |
| | | m_FillAmount: 1 |
| | | m_FillClockwise: 1 |
| | | m_FillOrigin: 0 |
| | | m_UseSpriteMesh: 0 |
| | | m_PixelsPerUnitMultiplier: 1 |
| | | --- !u!222 &987425177 |
| | | CanvasRenderer: |
| | | m_ObjectHideFlags: 0 |
| | | m_CorrespondingSourceObject: {fileID: 0} |
| | | m_PrefabInstance: {fileID: 0} |
| | | m_PrefabAsset: {fileID: 0} |
| | | m_GameObject: {fileID: 987425173} |
| | | m_CullTransparentMesh: 0 |
| | | --- !u!1 &1121951090 |
| | | GameObject: |
| | | m_ObjectHideFlags: 0 |
| | |
| | | m_TargetGraphic: {fileID: 1495759454} |
| | | m_OnClick: |
| | | m_PersistentCalls: |
| | | m_Calls: [] |
| | | m_Calls: |
| | | - m_Target: {fileID: 501810470} |
| | | m_TargetAssemblyTypeName: |
| | | m_MethodName: |
| | | m_Mode: 1 |
| | | m_Arguments: |
| | | m_ObjectArgument: {fileID: 0} |
| | | m_ObjectArgumentAssemblyTypeName: |
| | | m_IntArgument: 0 |
| | | m_FloatArgument: 0 |
| | | m_StringArgument: |
| | | m_BoolArgument: 0 |
| | | m_CallState: 2 |
| | | --- !u!114 &1495759454 |
| | | MonoBehaviour: |
| | | m_ObjectHideFlags: 0 |
| | |
| | | m_LocalScale: {x: 1, y: 1, z: 1} |
| | | m_Children: |
| | | - {fileID: 1495759452} |
| | | - {fileID: 987425174} |
| | | m_Father: {fileID: 501810474} |
| | | m_RootOrder: 1 |
| | | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
| | |
| | | m_PrefabInstance: {fileID: 0} |
| | | m_PrefabAsset: {fileID: 0} |
| | | m_GameObject: {fileID: 2083383109} |
| | | m_Enabled: 1 |
| | | m_Enabled: 0 |
| | | m_EditorHideFlags: 0 |
| | | m_Script: {fileID: 11500000, guid: 1c3c4a281008bfb42a6882852b64f3b7, type: 3} |
| | | m_Name: |
| | | m_EditorClassIdentifier: |
| | | loadingTxt: {fileID: 295245704} |
| | | --- !u!1 &2127121674 |
| | | GameObject: |
| | | m_ObjectHideFlags: 0 |
| | | m_CorrespondingSourceObject: {fileID: 0} |
| | | m_PrefabInstance: {fileID: 0} |
| | | m_PrefabAsset: {fileID: 0} |
| | | serializedVersion: 6 |
| | | m_Component: |
| | | - component: {fileID: 2127121675} |
| | | - component: {fileID: 2127121677} |
| | | - component: {fileID: 2127121676} |
| | | m_Layer: 5 |
| | | m_Name: Text |
| | | m_TagString: Untagged |
| | | m_Icon: {fileID: 0} |
| | | m_NavMeshLayer: 0 |
| | | m_StaticEditorFlags: 0 |
| | | m_IsActive: 1 |
| | | --- !u!224 &2127121675 |
| | | RectTransform: |
| | | m_ObjectHideFlags: 0 |
| | | m_CorrespondingSourceObject: {fileID: 0} |
| | | m_PrefabInstance: {fileID: 0} |
| | | m_PrefabAsset: {fileID: 0} |
| | | m_GameObject: {fileID: 2127121674} |
| | | 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_Children: [] |
| | | m_Father: {fileID: 987425174} |
| | | m_RootOrder: 0 |
| | | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
| | | m_AnchorMin: {x: 0, y: 0} |
| | | m_AnchorMax: {x: 1, y: 1} |
| | | m_AnchoredPosition: {x: 0, y: 0} |
| | | m_SizeDelta: {x: 0, y: 0} |
| | | m_Pivot: {x: 0.5, y: 0.5} |
| | | --- !u!114 &2127121676 |
| | | MonoBehaviour: |
| | | m_ObjectHideFlags: 0 |
| | | m_CorrespondingSourceObject: {fileID: 0} |
| | | m_PrefabInstance: {fileID: 0} |
| | | m_PrefabAsset: {fileID: 0} |
| | | m_GameObject: {fileID: 2127121674} |
| | | m_Enabled: 1 |
| | | m_EditorHideFlags: 0 |
| | | m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} |
| | | m_Name: |
| | | m_EditorClassIdentifier: |
| | | m_Material: {fileID: 0} |
| | | m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, 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_FontData: |
| | | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} |
| | | m_FontSize: 22 |
| | | m_FontStyle: 0 |
| | | m_BestFit: 0 |
| | | m_MinSize: 10 |
| | | m_MaxSize: 40 |
| | | m_Alignment: 4 |
| | | m_AlignByGeometry: 0 |
| | | m_RichText: 1 |
| | | m_HorizontalOverflow: 0 |
| | | m_VerticalOverflow: 0 |
| | | m_LineSpacing: 1 |
| | | m_Text: "\u91CD\u7F6E\u6240\u6709\u6570\u636E" |
| | | --- !u!222 &2127121677 |
| | | CanvasRenderer: |
| | | m_ObjectHideFlags: 0 |
| | | m_CorrespondingSourceObject: {fileID: 0} |
| | | m_PrefabInstance: {fileID: 0} |
| | | m_PrefabAsset: {fileID: 0} |
| | | m_GameObject: {fileID: 2127121674} |
| | | m_CullTransparentMesh: 0 |
| | |
| | | m_Father: {fileID: 0} |
| | | m_RootOrder: 3 |
| | | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
| | | --- !u!224 &1053266676 stripped |
| | | RectTransform: |
| | | m_CorrespondingSourceObject: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | m_PrefabInstance: {fileID: 1480554795} |
| | | m_PrefabAsset: {fileID: 0} |
| | | --- !u!1001 &1480554795 |
| | | PrefabInstance: |
| | | m_ObjectHideFlags: 0 |
| | | serializedVersion: 2 |
| | | m_Modification: |
| | | m_TransformParent: {fileID: 1913359152602302188} |
| | | m_Modifications: |
| | | - target: {fileID: 4744861380638265637, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_SizeDelta.x |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 4822198964131571939, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_AnchorMin.y |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 4822198964131571939, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_AnchorMax.y |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 4822198964131571939, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_AnchoredPosition.x |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 4822198964131571939, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_AnchoredPosition.y |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_LocalPosition.x |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_LocalPosition.y |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_LocalPosition.z |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_LocalRotation.x |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_LocalRotation.y |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_LocalRotation.z |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_LocalRotation.w |
| | | value: 1 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_RootOrder |
| | | value: 1 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_LocalEulerAnglesHint.x |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_LocalEulerAnglesHint.y |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_LocalEulerAnglesHint.z |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_AnchoredPosition.x |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_AnchoredPosition.y |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_SizeDelta.x |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_SizeDelta.y |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_AnchorMin.x |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_AnchorMin.y |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_AnchorMax.x |
| | | value: 1 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_AnchorMax.y |
| | | value: 1 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_Pivot.x |
| | | value: 0.5 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_Pivot.y |
| | | value: 0.5 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 8495952805374218097, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_SizeDelta.y |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 8765142430134729489, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_Name |
| | | value: GuidePanel |
| | | objectReference: {fileID: 0} |
| | | m_RemovedComponents: [] |
| | | m_SourcePrefab: {fileID: 100100000, guid: b86ece8bb44d6764f898e696942f24ce, type: 3} |
| | | --- !u!1 &1607076652 |
| | | GameObject: |
| | | m_ObjectHideFlags: 0 |
| | |
| | | - component: {fileID: 1913359152602302190} |
| | | - component: {fileID: 1913359152602302191} |
| | | - component: {fileID: 1913359152602302162} |
| | | - component: {fileID: 1913359152602302163} |
| | | m_Layer: 5 |
| | | m_Name: MainUI |
| | | m_TagString: Untagged |
| | |
| | | m_Script: {fileID: 11500000, guid: 8e0f6a0258e46534888374305ccd5ead, type: 3} |
| | | m_Name: |
| | | m_EditorClassIdentifier: |
| | | --- !u!114 &1913359152602302163 |
| | | MonoBehaviour: |
| | | m_ObjectHideFlags: 0 |
| | | m_CorrespondingSourceObject: {fileID: 0} |
| | | m_PrefabInstance: {fileID: 0} |
| | | m_PrefabAsset: {fileID: 0} |
| | | m_GameObject: {fileID: 1913359152602302161} |
| | | m_Enabled: 1 |
| | | m_EditorHideFlags: 0 |
| | | m_Script: {fileID: 11500000, guid: 824268ee642dc804eb3abc27b6fa683e, type: 3} |
| | | m_Name: |
| | | m_EditorClassIdentifier: |
| | | --- !u!224 &1913359152602302188 |
| | | RectTransform: |
| | | m_ObjectHideFlags: 0 |
| | |
| | | m_LocalScale: {x: 0, y: 0, z: 0} |
| | | m_Children: |
| | | - {fileID: 1913359153707295861} |
| | | - {fileID: 1053266676} |
| | | - {fileID: 6188449807713933309} |
| | | m_Father: {fileID: 0} |
| | | m_RootOrder: 2 |
| | | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
| | |
| | | m_NavMeshLayer: 0 |
| | | m_StaticEditorFlags: 0 |
| | | m_IsActive: 1 |
| | | --- !u!1001 &6188449807713933308 |
| | | PrefabInstance: |
| | | m_ObjectHideFlags: 0 |
| | | serializedVersion: 2 |
| | | m_Modification: |
| | | m_TransformParent: {fileID: 1913359152602302188} |
| | | m_Modifications: |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_LocalPosition.x |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_LocalPosition.y |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_LocalPosition.z |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_LocalRotation.x |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_LocalRotation.y |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_LocalRotation.z |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_LocalRotation.w |
| | | value: 1 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_RootOrder |
| | | value: 1 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_LocalEulerAnglesHint.x |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_LocalEulerAnglesHint.y |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_LocalEulerAnglesHint.z |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_AnchoredPosition.x |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_AnchoredPosition.y |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_SizeDelta.x |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_SizeDelta.y |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_AnchorMin.x |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_AnchorMin.y |
| | | value: 0 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_AnchorMax.x |
| | | value: 1 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_AnchorMax.y |
| | | value: 1 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_Pivot.x |
| | | value: 0.5 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_Pivot.y |
| | | value: 0.5 |
| | | objectReference: {fileID: 0} |
| | | - target: {fileID: 8765142430134729489, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | propertyPath: m_Name |
| | | value: GuidePanel |
| | | objectReference: {fileID: 0} |
| | | m_RemovedComponents: [] |
| | | m_SourcePrefab: {fileID: 100100000, guid: b86ece8bb44d6764f898e696942f24ce, type: 3} |
| | | --- !u!224 &6188449807713933309 stripped |
| | | RectTransform: |
| | | m_CorrespondingSourceObject: {fileID: 5529930024907350475, guid: b86ece8bb44d6764f898e696942f24ce, |
| | | type: 3} |
| | | m_PrefabInstance: {fileID: 6188449807713933308} |
| | | m_PrefabAsset: {fileID: 0} |
| | |
| | | |
| | | for (int i = 0; i < waveData.Count; ++i) |
| | | { |
| | | ret += waveData[i].Config.amount; |
| | | int count = waveData[i].Config.amount; |
| | | endless_enemy enemyData = EndlessEnemyData.GetDataById(waveData[i].Config.enemy_id); |
| | | |
| | | // WTF... |
| | | if (enemyData.resource == 103) |
| | | count *= 2; |
| | | |
| | | ret += count; |
| | | } |
| | | |
| | | return ret; |
| | |
| | | |
| | | public string GetDeviceId() |
| | | { |
| | | return TalkingDataGA.GetDeviceId(); |
| | | //return TalkingDataGA.GetDeviceId(); |
| | | return ""; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | public void SDKInit(string channelId) |
| | | { |
| | | Debug.Log("Unity SDK init begin channelId:" + channelId); |
| | | TalkingDataGA.BackgroundSessionEnabled(); |
| | | TalkingDataGA.OnStart("B220F5C737384030947B202F19E32086", channelId);//appID是定死的 |
| | | //TalkingDataGA.BackgroundSessionEnabled(); |
| | | //TalkingDataGA.OnStart("B220F5C737384030947B202F19E32086", channelId);//appID是定死的 |
| | | Debug.Log("Unity SDK init completed "); |
| | | } |
| | | |
| | | TDGAAccount account;//当前账户 |
| | | //TDGAAccount account;//当前账户 |
| | | |
| | | /// <summary> |
| | | /// 登录,使用自定义的 |
| | |
| | | /// <param name="deviceID"></param> |
| | | public void Login(string deviceID) |
| | | { |
| | | account = TDGAAccount.SetAccount(TalkingDataGA.GetDeviceId()); |
| | | account.SetAccountType(AccountType.ANONYMOUS); |
| | | //account = TDGAAccount.SetAccount(TalkingDataGA.GetDeviceId()); |
| | | //account.SetAccountType(AccountType.ANONYMOUS); |
| | | } |
| | | |
| | | /* |
| | |
| | | private void OnDestroy() |
| | | { |
| | | Debug.Log("onDestroy"); |
| | | TalkingDataGA.OnEnd(); |
| | | //TalkingDataGA.OnEnd(); |
| | | } |
| | | } |
New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class TDAA_SDKManager : MonoBehaviour |
| | | { |
| | | private static TDAA_SDKManager _Ins; |
| | | public static TDAA_SDKManager Ins |
| | | { |
| | | get |
| | | { |
| | | return _Ins; |
| | | } |
| | | } |
| | | //用来记录是否首次登录 |
| | | bool isFirstStart; |
| | | string firstStart = "GemBattleFirstStart"; |
| | | |
| | | //漏斗流统计(去重) |
| | | int statisticsStep; |
| | | string statisticsStr = "GemBattleStatistics"; |
| | | |
| | | //新手引导 |
| | | int guideStep; |
| | | string guideStepStr = "GemBattleGuideStep"; |
| | | |
| | | int maxLevel;//达到的最大关 |
| | | int maxWave;//达到最大波次 |
| | | |
| | | string maxLevelStr = "GemBattleMaxLevelStr"; |
| | | string maxWaveStr = "GemBattleMaxWaveStr"; |
| | | |
| | | void Awake() |
| | | { |
| | | _Ins = this; |
| | | //PlayerPrefs.DeleteAll(); |
| | | //Debug.LogError("清除了数据"); |
| | | isFirstStart = PlayerPrefs.GetInt(firstStart) == 0; |
| | | statisticsStep = PlayerPrefs.GetInt(statisticsStr); |
| | | guideStep = PlayerPrefs.GetInt(guideStepStr); |
| | | |
| | | maxLevel = PlayerPrefs.GetInt(maxLevelStr); |
| | | maxWave = PlayerPrefs.GetInt(maxWaveStr); |
| | | } |
| | | |
| | | public void Reset() |
| | | { |
| | | Debug.LogError("清除了数据"); |
| | | //PlayerPrefs.DeleteAll(); |
| | | isFirstStart = PlayerPrefs.GetInt(firstStart) == 0; |
| | | statisticsStep = PlayerPrefs.GetInt(statisticsStr); |
| | | guideStep = PlayerPrefs.GetInt(guideStepStr); |
| | | |
| | | maxLevel = PlayerPrefs.GetInt(maxLevelStr); |
| | | maxWave = PlayerPrefs.GetInt(maxWaveStr); |
| | | } |
| | | |
| | | public string GetDeviceId() |
| | | { |
| | | return TalkingDataPlugin.GetDeviceId(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化 |
| | | /// </summary> |
| | | /// <param name="channelId">渠道id</param> |
| | | public void SDKInit(string channelId) |
| | | { |
| | | Debug.Log("Unity SDK init begin channelId:" + channelId); |
| | | TalkingDataPlugin.BackgroundSessionEnabled(); |
| | | TalkingDataPlugin.SessionStarted("41F4DA3B72CF48D2ADAB761E6C17D12D", channelId); |
| | | TalkingDataPlugin.SetExceptionReportEnabled(true); |
| | | Debug.Log("Unity SDK init completed "); |
| | | } |
| | | |
| | | //注册 |
| | | public void OnRegister() |
| | | { |
| | | TalkingDataPlugin.OnRegister(GetDeviceId(), TalkingDataAccountType.ANONYMOUS, "testwgname"); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 登录 |
| | | /// </summary> |
| | | public void Login() |
| | | { |
| | | TalkingDataPlugin.OnLogin(GetDeviceId(), TalkingDataAccountType.ANONYMOUS, "testwgname"); |
| | | } |
| | | |
| | | /* |
| | | 0.注册人数统计:以成功进入到战斗界面为注册成功 ---登录了就跳转页面 |
| | | |
| | | 1.启动漏斗流统计(去重) |
| | | (1)成功加载启动页的人数 |
| | | (2)成功加载登陆界面的人数 启动首页 |
| | | (3)点击登陆按钮的人数 点击登录 |
| | | (4)成功生成注册信息的人数 登录成功 |
| | | (5)成功加载游戏战斗界面的人数 跳转页面 |
| | | (6)成功进入到新手引导step_1的人数 新手引导1 |
| | | (7)成功完成step_1的人数 完成新手引导1 |
| | | |
| | | 2.引导步数统计 |
| | | (1)定义新手引导第n步 = step_n |
| | | (2)完成step_n,状态记为n |
| | | (3)需要统计每个玩家的n的值 |
| | | (4)可根据每一个n的值统计人数 |
| | | |
| | | 3.玩家每日的启动次数 |
| | | |
| | | 4.每次启动的游玩时长,按1min为1个区间,统计各区间每日玩家人数 |
| | | |
| | | 5.每次游玩过程中,点击【重新开始】按钮的次数,每次重新开始记做一轮 |
| | | |
| | | 7.每一轮游戏中成功使用技能宝石的次数 |
| | | |
| | | 8.每一轮游戏中成功开启的塔位置数量 |
| | | |
| | | 9.每一轮游戏中成功购买塔的数量 |
| | | |
| | | 10.玩家在结算界面点击【对pvp感兴趣】按钮次数 |
| | | |
| | | 11.玩家打到第x关y波的人数(去重) |
| | | |
| | | 12.玩家达到第x关y波的次数(不去重) |
| | | */ |
| | | |
| | | |
| | | |
| | | //0.注册人数统计:以成功进入到战斗界面为注册成功 |
| | | public void ArriveBattle() |
| | | { |
| | | if (isFirstStart) |
| | | { |
| | | OnRegister(); |
| | | |
| | | Debug.LogError("注册人数统计"); |
| | | //只记录一次 |
| | | Dictionary<string, object> dic = new Dictionary<string, object> |
| | | { |
| | | { "ArriveBattle", "Done"}, |
| | | }; |
| | | OnEvent("注册人数统计", dic); |
| | | isFirstStart = false; |
| | | PlayerPrefs.SetInt(firstStart, 1); |
| | | } |
| | | Login(); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 启动漏斗流统计(去重) |
| | | ///(1)成功加载登陆界面的人数 启动首页 |
| | | ///(2)点击登陆按钮的人数 点击登录 |
| | | ///(3)成功生成注册信息的人数 登录成功 |
| | | ///(4)成功加载游戏战斗界面的人数 跳转页面 |
| | | ///(5)成功进入到新手引导step_1的人数 新手引导1 |
| | | ///(6)成功完成step_1的人数 完成新手引导1 |
| | | /// </summary> |
| | | /// <param name="step"></param> |
| | | public void Statistics(int step) |
| | | { |
| | | if (step > statisticsStep) |
| | | { |
| | | string key = ""; |
| | | switch (step) |
| | | { |
| | | case 1: |
| | | key = "成功加载登陆界面的人数"; |
| | | break; |
| | | case 2: |
| | | key = "点击登陆按钮的人数"; |
| | | break; |
| | | case 3: |
| | | key = "成功生成注册信息的人数"; |
| | | break; |
| | | case 4: |
| | | key = "成功加载游戏战斗界面的人数"; |
| | | break; |
| | | case 5: |
| | | key = "成功进入到新手引导step_1的人数"; |
| | | break; |
| | | case 6: |
| | | key = "成功完成step_1的人数"; |
| | | break; |
| | | } |
| | | Dictionary<string, object> dic = new Dictionary<string, object> |
| | | { |
| | | { "已完成", 1} |
| | | }; |
| | | |
| | | // Dictionary<string, object> dic = new Dictionary<string, object> |
| | | // { |
| | | // { "成功加载登陆界面的人数", 0}, |
| | | // { "点击登陆按钮的人数", 0}, |
| | | // { "成功生成注册信息的人数", 0}, |
| | | // { "成功加载游戏战斗界面的人数", 0}, |
| | | // { "成功进入到新手引导step_1的人数", 0}, |
| | | // { "成功完成step_1的人数", 0} |
| | | // }; |
| | | //dic[key] = 1; |
| | | |
| | | Debug.LogError("漏斗流统计:" + key); |
| | | |
| | | OnEvent(key, dic); |
| | | statisticsStep = step; |
| | | PlayerPrefs.SetInt(statisticsStr, step); |
| | | } |
| | | } |
| | | |
| | | //单人统计一次 历史最高 |
| | | // 2.引导步数统计 |
| | | //(1)定义新手引导第n步 = step_n |
| | | //(2)完成step_n,状态记为n |
| | | //(3)需要统计每个玩家的n的值 |
| | | //(4)可根据每一个n的值统计人数 |
| | | public void GuideStep(int step) |
| | | { |
| | | if (step > guideStep) |
| | | { |
| | | Debug.LogError("引导步数统计:" + step); |
| | | Dictionary<string, object> dic = new Dictionary<string, object> |
| | | { |
| | | { "Guide", step.ToString()} |
| | | }; |
| | | OnEvent("引导步数统计", dic); |
| | | |
| | | guideStep = step; |
| | | PlayerPrefs.SetInt(guideStepStr, step); |
| | | } |
| | | } |
| | | |
| | | //5.每次游玩过程中,点击【重新开始】按钮的次数,每次重新开始记做一轮 |
| | | public void OnClickRestartBtn() |
| | | { |
| | | Debug.LogError("重新开始按钮次数"); |
| | | Dictionary<string, object> dic = new Dictionary<string, object> |
| | | { |
| | | { "OnClickRestartBtn", 1} |
| | | }; |
| | | OnEvent("重新开始按钮次数", dic); |
| | | } |
| | | |
| | | //7.每一轮游戏中成功使用技能宝石的次数 |
| | | public void OnUseSkill(int count) |
| | | { |
| | | Debug.LogError("每一轮游戏中成功使用技能宝石的次数:" + count); |
| | | Dictionary<string, object> dic = new Dictionary<string, object> |
| | | { |
| | | { "使用次数", count+"次"} |
| | | }; |
| | | OnEvent("每一轮游戏中成功使用技能宝石的次数", dic); |
| | | } |
| | | |
| | | //8.每一轮游戏中成功开启的塔位置数量 |
| | | public void OnOpenTower(int towerCount) |
| | | { |
| | | Debug.LogError("每一轮游戏中成功开启的塔位置数量:" + towerCount); |
| | | Dictionary<string, object> dic = new Dictionary<string, object> |
| | | { |
| | | { "购买次数", towerCount+"次"} |
| | | }; |
| | | OnEvent("每一轮游戏中成功开启的塔位置数量", dic); |
| | | } |
| | | |
| | | //9.每一轮游戏中成功购买塔的数量 |
| | | public void OnClickTowerBuyBtn(int buyCount) |
| | | { |
| | | Debug.LogError("每一轮游戏中成功购买塔的数量:" + buyCount); |
| | | Dictionary<string, object> dic = new Dictionary<string, object> |
| | | { |
| | | { "购买次数", buyCount+"次"} |
| | | }; |
| | | OnEvent("每一轮游戏中成功购买塔的数量", dic); |
| | | } |
| | | |
| | | //10.玩家在结算界面点击【对pvp感兴趣】按钮次数 |
| | | public void OnClickPVPBtn() |
| | | { |
| | | Debug.LogError("对pvp感兴趣"); |
| | | Dictionary<string, object> dic = new Dictionary<string, object> |
| | | { |
| | | { "OnClickPVPBtn", 1} |
| | | }; |
| | | OnEvent("对pvp感兴趣", dic); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 11.玩家打到第x关y波的人数(去重) 这里只穿最大值 |
| | | /// </summary> |
| | | /// <param name="level">第几关</param> |
| | | /// <param name="wave">第几波</param> |
| | | public void MaxWave(int level, int wave) |
| | | { |
| | | bool canSend = false; |
| | | if (level >= maxLevel) |
| | | { |
| | | if (level > maxLevel) |
| | | { |
| | | canSend = true; |
| | | } |
| | | else if (level == maxLevel && wave > maxWave) |
| | | { |
| | | canSend = true; |
| | | } |
| | | } |
| | | if (canSend) |
| | | { |
| | | Debug.LogError($"玩家最高打到第{level}关{wave}波"); |
| | | Dictionary<string, object> dic = new Dictionary<string, object> |
| | | { |
| | | { "MaxWave", $"第{level}关{wave}波"} |
| | | }; |
| | | OnEvent("玩家最高打到第x关y波",dic); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 12.玩家达到第x关y波的次数(不去重) |
| | | /// </summary> |
| | | /// <param name="level">第几关</param> |
| | | /// <param name="wave">第几波</param> |
| | | public void WaveDone(int level, int wave) |
| | | { |
| | | Debug.LogError($"玩家达到第{level}关{wave}波"); |
| | | Dictionary<string, object> dic = new Dictionary<string, object> |
| | | { |
| | | { $"第{level}关{wave}波", 1} |
| | | }; |
| | | OnEvent("玩家完成第x关y波的次数", dic); |
| | | } |
| | | |
| | | |
| | | /// 使用自定义事件 |
| | | /// </summary> |
| | | /// <param name="actionId">事件名称</param> |
| | | /// <param name="eventLabel">暂时没有找到什么作用</param> |
| | | /// <param name="dic">需要传递的值</param> |
| | | private void OnEvent(string actionId, Dictionary<string, object> dic, string eventLabel = "") |
| | | { |
| | | //示例: |
| | | // Dictionary<string, object> dic = new Dictionary<string, object> |
| | | // { |
| | | // { "StringValue", "Pi" }, |
| | | // { "NumberValue", 3.14 } |
| | | // }; |
| | | // TalkingDataGA.OnEvent("action_id", dic); |
| | | |
| | | //TalkingDataGA.OnEvent(actionId, dic); |
| | | TalkingDataPlugin.TrackEventWithParameters(actionId, null, dic); |
| | | } |
| | | |
| | | private void OnDestroy() |
| | | { |
| | | Debug.Log("onDestroy"); |
| | | TalkingDataPlugin.SessionStoped(); |
| | | } |
| | | } |
copy from Assets/GameAnalytics_SDK_Unity-master/TalkingDataScripts/TDGAMission.cs.meta
copy to Assets/Scripts/GameAnalytics_SDK/TDAA_SDKManager.cs.meta
File was copied from Assets/GameAnalytics_SDK_Unity-master/TalkingDataScripts/TDGAMission.cs.meta |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1ab4657863462fb498c66c0c75a76abb |
| | | guid: 824268ee642dc804eb3abc27b6fa683e |
| | | MonoImporter: |
| | | externalObjects: {} |
| | | serializedVersion: 2 |
| | |
| | | // Start is called before the first frame update |
| | | void Start() |
| | | { |
| | | GA_SDK_Manager.Ins.SDKInit(ChannelID.Gm.ToString()); |
| | | GA_SDK_Manager.Ins.Statistics(1);//成功加载登陆界面的人数 |
| | | TDAA_SDKManager.Ins.SDKInit(ChannelID.Gm.ToString()); |
| | | TDAA_SDKManager.Ins.Statistics(1);//成功加载登陆界面的人数 |
| | | isLogining = false; |
| | | |
| | | transform.Find("Panel/Button").GetComponent<Button>().onClick.AddListener(OnClickLoginBtn); |
| | | transform.Find("Panel/Button (1)").GetComponent<Button>().onClick.AddListener(OnClickResetBtn); |
| | | |
| | | if (Application.platform == RuntimePlatform.Android) |
| | | { |
| | | //GetetDeviceIMEI();//获取安卓手机IMEI |
| | | imei0 = GA_SDK_Manager.Ins.GetDeviceId();//使用设备ID |
| | | imei0 = TDAA_SDKManager.Ins.GetDeviceId();//使用设备ID |
| | | } |
| | | else if (Application.platform == RuntimePlatform.WindowsEditor) |
| | | { |
| | |
| | | |
| | | #endregion |
| | | |
| | | private void OnClickResetBtn(){ |
| | | Debug.LogError("清空了所有数据"); |
| | | PlayerPrefs.DeleteAll(); |
| | | TDAA_SDKManager.Ins.Reset(); |
| | | } |
| | | |
| | | |
| | | private void OnClickLoginBtn() |
| | | { |
| | | TDAA_SDKManager.Ins.Statistics(2);//埋点 |
| | | LoginRequest(); |
| | | GA_SDK_Manager.Ins.Statistics(2);//埋点 |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | Debug.Log("编辑器直接登录"); |
| | | |
| | | GA_SDK_Manager.Ins.Login(imei0); |
| | | GA_SDK_Manager.Ins.Statistics(3);//埋点 |
| | | //TDAA_SDKManager.Ins.Login(); |
| | | TDAA_SDKManager.Ins.Statistics(3);//埋点 |
| | | |
| | | //StartCoroutine(loginMy()); |
| | | StartCoroutine(LoadScene()); |
| | |
| | | Debug.Log("--------------------- 登录成功 ---------------------"); |
| | | //UserDataMsg userData = login.Userdata; |
| | | |
| | | GA_SDK_Manager.Ins.Login(imei0); |
| | | GA_SDK_Manager.Ins.Statistics(3);//埋点 |
| | | //TDAA_SDKManager.Ins.Login(); |
| | | TDAA_SDKManager.Ins.Statistics(3);//埋点 |
| | | |
| | | //StartCoroutine(loginMy()); |
| | | StartCoroutine(LoadScene()); |
| | |
| | | public delegate void CallBack(); |
| | | private Action callBack; |
| | | |
| | | RectTransform contentRect; |
| | | //RectTransform contentRect; |
| | | |
| | | Vector2 offsetV; |
| | | //Vector2 offsetV; |
| | | void Awake() |
| | | { |
| | | contentRect = transform.Find("Scroll View/Viewport/Content").GetComponent<RectTransform>(); |
| | | text = transform.Find("Scroll View/Viewport/Content/Text").GetComponent<Text>(); |
| | | offsetV = new Vector2(0, 20); |
| | | //contentRect = transform.Find("Scroll View/Viewport/Content").GetComponent<RectTransform>(); |
| | | //offsetV = new Vector2(0, 20); |
| | | text = transform.Find("Text").GetComponent<Text>(); |
| | | } |
| | | |
| | | public void StartShowWord(string str, Action cb) |
| | |
| | | word = str; |
| | | text.text = ""; |
| | | callBack = cb; |
| | | if (contentRect.anchoredPosition.y != 0) |
| | | { |
| | | contentRect.anchoredPosition = Vector2.zero; |
| | | } |
| | | // if (contentRect.anchoredPosition.y != 0) |
| | | // { |
| | | // contentRect.anchoredPosition = Vector2.zero; |
| | | // } |
| | | StartCoroutine("TypeText"); |
| | | } |
| | | |
| | |
| | | StopCoroutine("TypeText"); |
| | | text.text = ""; |
| | | char[] charArray = word.ToCharArray(); |
| | | length = 0; |
| | | //length = 0; |
| | | for (int i = 0; i < charArray.Length; i++) |
| | | { |
| | | if (charArray[i].Equals('$')) |
| | | { |
| | | text.text += GuideConfig.showWordsUBB[0]; |
| | | length += 19; |
| | | //length += 19; |
| | | } |
| | | else if (charArray[i].Equals('%')) |
| | | { |
| | | length += 19; |
| | | //length += 19; |
| | | text.text += GuideConfig.showWordsUBB[1]; |
| | | } |
| | | else if (charArray[i].Equals('`')) |
| | | { |
| | | length += 23; |
| | | //length += 23; |
| | | text.text += GuideConfig.showWordsUBB[2]; |
| | | } |
| | | else if (charArray[i].Equals('&')) |
| | | { |
| | | length += 19; |
| | | //length += 19; |
| | | text.text += GuideConfig.showWordsUBB[3]; |
| | | } |
| | | else if (charArray[i].Equals('*')) |
| | | { |
| | | length += 23; |
| | | //length += 23; |
| | | text.text += GuideConfig.showWordsUBB[4]; |
| | | } |
| | | else if (charArray[i].Equals('<')) |
| | | { |
| | | //length += 23; |
| | | text.text += GuideConfig.showWordsUBB[5]; |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | //text.text = word; |
| | | |
| | | if (text.text.Length - length >= 39 && contentRect.anchoredPosition != offsetV) |
| | | { |
| | | contentRect.anchoredPosition = offsetV; |
| | | } |
| | | else |
| | | { |
| | | contentRect.anchoredPosition = Vector2.zero; |
| | | } |
| | | // if (text.text.Length - length >= 39 && contentRect.anchoredPosition != offsetV) |
| | | // { |
| | | // contentRect.anchoredPosition = offsetV; |
| | | // } |
| | | // else |
| | | // { |
| | | // contentRect.anchoredPosition = Vector2.zero; |
| | | // } |
| | | if (callBack != null) |
| | | { |
| | | callBack(); |
| | |
| | | |
| | | } |
| | | |
| | | int length = 0; |
| | | //int length = 0; |
| | | private IEnumerator TypeText() |
| | | { |
| | | char[] charArray = word.ToCharArray(); |
| | | length = 0; |
| | | //length = 0; |
| | | for (int i = 0; i < charArray.Length; i++) |
| | | { |
| | | if (charArray[i].Equals('$')) |
| | | { |
| | | text.text += GuideConfig.showWordsUBB[0]; |
| | | length += 19; |
| | | //length += 19; |
| | | } |
| | | else if (charArray[i].Equals('%')) |
| | | { |
| | | length += 19; |
| | | //length += 19; |
| | | text.text += GuideConfig.showWordsUBB[1]; |
| | | } |
| | | else if (charArray[i].Equals('`')) |
| | | { |
| | | length += 23; |
| | | //length += 23; |
| | | text.text += GuideConfig.showWordsUBB[2]; |
| | | } |
| | | else if (charArray[i].Equals('&')) |
| | | { |
| | | length += 19; |
| | | //length += 19; |
| | | text.text += GuideConfig.showWordsUBB[3]; |
| | | } |
| | | else if (charArray[i].Equals('*')) |
| | | { |
| | | length += 23; |
| | | //length += 23; |
| | | text.text += GuideConfig.showWordsUBB[4]; |
| | | } |
| | | else if (charArray[i].Equals('<')) |
| | | { |
| | | //length += 23; |
| | | text.text += GuideConfig.showWordsUBB[5]; |
| | | } |
| | | else |
| | | { |
| | | text.text += charArray[i]; |
| | | } |
| | | |
| | | if (text.text.Length - length >= 39 && contentRect.anchoredPosition != offsetV) |
| | | { |
| | | contentRect.anchoredPosition = offsetV; |
| | | } |
| | | // if (text.text.Length - length >= 39 && contentRect.anchoredPosition != offsetV) |
| | | // { |
| | | // contentRect.anchoredPosition = offsetV; |
| | | // } |
| | | yield return new WaitForSeconds(letterPause); |
| | | } |
| | | |
| | |
| | | { |
| | | public static string[] showWords = new string[] |
| | | { |
| | | "训练师,终于等到你了,欢迎来到精灵世界,但是现在不是闲聊的时候,我需要你的帮助。", |
| | | //1 |
| | | "训练师,终于等到你了,欢迎来到精灵世界。", |
| | | "对面那个怪物在精灵世界为非作歹,快来帮我抵挡他的进攻吧。", |
| | | |
| | | //2 |
| | | "点击按钮购买宝石", |
| | | "再购买一个", |
| | | |
| | | "就是这样,不过因为其他小伙伴还没赶到战场,所以现在只能召唤出我来。", |
| | | "但是也不用担心,你可以通过合成来提升我的能力。快去试试吧。", |
| | | //3 |
| | | "但是现在只能召唤出我来。", |
| | | "你可以通过合成来提升我的能力。快去试试吧。", |
| | | |
| | | "长按宝石", |
| | | "拖动到相同等级宝石进行合成", |
| | | //4 |
| | | //"长按宝石", |
| | | //"拖动到相同等级宝石进行合成", |
| | | |
| | | //5 |
| | | "拖动宝石到防守区攻击怪物", |
| | | |
| | | "我的攻击会造成$,并且当我充能完毕后,我会短时间内%哦!", |
| | | //6 |
| | | "我的攻击会造成$,并且当我<后,我会短时间内%哦!", |
| | | "再坚持一下,其他小伙伴应该就要到达战场了!", |
| | | |
| | | //7 |
| | | "新的小伙伴马上到了,但是我们只有一个防御塔位。", |
| | | "还好刚刚的战斗让我们收获了不少金币,我们来为小伙伴开启一个新的防御塔位。", |
| | | "我们来为小伙伴开启一个新的防御塔位。", |
| | | |
| | | //8 |
| | | "点击解锁塔位", |
| | | |
| | | "这样就可以了,刚好水精灵也到达战场了。", |
| | | "他的攻击会使敌人`,快去召唤他试试吧。", |
| | | //9 |
| | | //"这样就可以了,刚好水精灵也到达战场了。", |
| | | "水精灵的攻击会使敌人`,快去召唤他试试吧。", |
| | | |
| | | "点击按钮购买宝石", |
| | | "拖动宝石到防守区攻击怪物", |
| | | //10 |
| | | //"点击按钮购买宝石", |
| | | //"拖动宝石到防守区攻击怪物", |
| | | |
| | | //11 |
| | | "不好不好,敌人快冲破防线了。", |
| | | "还好我留了一手,送你一个技能宝石,快用它来化解危机吧。", |
| | | |
| | | "点击技能宝石", |
| | | //12 |
| | | //"点击技能宝石", |
| | | "拖动到目标路径进行释放", |
| | | |
| | | "危机解除!技能宝石是一次性使用的,可以造成&或者*效果,释放时机可是特别重要的。", |
| | | "但我也就这一个技能宝石了,不过你在购买宝石的时候是有机会获得技能宝石的,所以也不用担心了。", |
| | | //13 |
| | | "技能宝石是一次性使用的,可以造成&或者*效果。", |
| | | //"但我也就这一个技能宝石了,不过你在购买宝石的时候是有机会获得技能宝石的,所以也不用担心了。", |
| | | "接下来我们一起努力对抗怪物吧,加油训练师!" |
| | | }; |
| | | |
| | |
| | | "<color=red>提升攻速</color>",//% |
| | | "<color=#4375F1>减速</color>",//` |
| | | "<color=red>大量伤害</color>",//& |
| | | "<color=#4375F1>异常状态</color>"//* |
| | | "<color=#4375F1>异常状态</color>",//* |
| | | "<color=red>充能完毕</color>",//< |
| | | }; |
| | | |
| | | } |
| | | |
| | | public enum GuideEnum{ |
| | | public enum GuideEnum |
| | | { |
| | | None, |
| | | Step0, |
| | | Step1, |
| | |
| | | EventCenter.Ins.Add((int)KTGMGemClient.EventType.GetOneTowerPos, GetOneTowerPos); |
| | | EventCenter.Ins.Add((int)KTGMGemClient.EventType.CreateWaterLv1, CreateWaterLv1); |
| | | EventCenter.Ins.Add((int)KTGMGemClient.EventType.SkillStep, SkillStep); |
| | | EventCenter.Ins.Add((int)KTGMGemClient.EventType.SkillRelease, SkillRelease); |
| | | EventCenter.Ins.Add((int)KTGMGemClient.EventType.SkillReleaseDone, SkillReleaseDone); |
| | | |
| | | } |
| | |
| | | EventCenter.Ins.Remove((int)KTGMGemClient.EventType.GetOneTowerPos, GetOneTowerPos); |
| | | EventCenter.Ins.Remove((int)KTGMGemClient.EventType.CreateWaterLv1, CreateWaterLv1); |
| | | EventCenter.Ins.Remove((int)KTGMGemClient.EventType.SkillStep, SkillStep); |
| | | EventCenter.Ins.Remove((int)KTGMGemClient.EventType.SkillRelease, SkillRelease); |
| | | EventCenter.Ins.Remove((int)KTGMGemClient.EventType.SkillReleaseDone, SkillReleaseDone); |
| | | |
| | | |
| | |
| | | allGuideDic.Add(GuideEnum.Step0, new string[] { GuideConfig.showWords[0], GuideConfig.showWords[1] }); |
| | | allGuideDic.Add(GuideEnum.Step1, new string[] { GuideConfig.showWords[2], GuideConfig.showWords[3] }); |
| | | allGuideDic.Add(GuideEnum.Step2, new string[] { GuideConfig.showWords[4], GuideConfig.showWords[5] }); |
| | | allGuideDic.Add(GuideEnum.Step3, new string[] { GuideConfig.showWords[6], GuideConfig.showWords[7] }); |
| | | allGuideDic.Add(GuideEnum.Step4, new string[] { GuideConfig.showWords[8] }); |
| | | allGuideDic.Add(GuideEnum.Step5, new string[] { GuideConfig.showWords[9], GuideConfig.showWords[10] }); |
| | | allGuideDic.Add(GuideEnum.Step6, new string[] { GuideConfig.showWords[11], GuideConfig.showWords[12] }); |
| | | allGuideDic.Add(GuideEnum.Step7, new string[] { GuideConfig.showWords[13] }); |
| | | allGuideDic.Add(GuideEnum.Step8, new string[] { GuideConfig.showWords[14], GuideConfig.showWords[15] }); |
| | | allGuideDic.Add(GuideEnum.Step9, new string[] { GuideConfig.showWords[16], GuideConfig.showWords[17] }); |
| | | allGuideDic.Add(GuideEnum.Step10, new string[] { GuideConfig.showWords[18], GuideConfig.showWords[19] }); |
| | | allGuideDic.Add(GuideEnum.Step11, new string[] { GuideConfig.showWords[20], GuideConfig.showWords[21] }); |
| | | allGuideDic.Add(GuideEnum.Step12, new string[] { GuideConfig.showWords[22], GuideConfig.showWords[23], GuideConfig.showWords[24] }); |
| | | allGuideDic.Add(GuideEnum.Step3, new string[] { }); |
| | | allGuideDic.Add(GuideEnum.Step4, new string[] { GuideConfig.showWords[6] }); |
| | | allGuideDic.Add(GuideEnum.Step5, new string[] { GuideConfig.showWords[7], GuideConfig.showWords[8] }); |
| | | allGuideDic.Add(GuideEnum.Step6, new string[] { GuideConfig.showWords[9], GuideConfig.showWords[10] }); |
| | | allGuideDic.Add(GuideEnum.Step7, new string[] { GuideConfig.showWords[11] }); |
| | | allGuideDic.Add(GuideEnum.Step8, new string[] { GuideConfig.showWords[12] }); |
| | | allGuideDic.Add(GuideEnum.Step9, new string[] { }); |
| | | allGuideDic.Add(GuideEnum.Step10, new string[] { GuideConfig.showWords[13], GuideConfig.showWords[14] }); |
| | | allGuideDic.Add(GuideEnum.Step11, new string[] { GuideConfig.showWords[15] }); |
| | | allGuideDic.Add(GuideEnum.Step12, new string[] { GuideConfig.showWords[16], GuideConfig.showWords[17] }); |
| | | |
| | | } |
| | | |
| | |
| | | if (currentIndex == -1)//初始化本步 |
| | | { |
| | | CommonDebugHelper.DebugError("第1步开始"); |
| | | GA_SDK_Manager.Ins.Statistics(5);//埋点 |
| | | TDAA_SDKManager.Ins.Statistics(5);//埋点 |
| | | |
| | | currentIndex = 0; |
| | | needIndex = 2; |
| | |
| | | if (currentIndex == -1) |
| | | { |
| | | CommonDebugHelper.DebugError("第2步开始"); |
| | | GA_SDK_Manager.Ins.Statistics(6);//埋点 |
| | | GA_SDK_Manager.Ins.GuideStep(1);//埋点 |
| | | TDAA_SDKManager.Ins.Statistics(6);//埋点 |
| | | TDAA_SDKManager.Ins.GuideStep(1);//埋点 |
| | | |
| | | currentIndex = 0; |
| | | needIndex = 2; |
| | |
| | | if (currentIndex == -1) |
| | | { |
| | | CommonDebugHelper.DebugError("第3步开始"); |
| | | GA_SDK_Manager.Ins.GuideStep(2);//埋点 |
| | | TDAA_SDKManager.Ins.GuideStep(2);//埋点 |
| | | |
| | | currentIndex = 0; |
| | | needIndex = 2; |
| | |
| | | if (currentIndex == -1) |
| | | { |
| | | CommonDebugHelper.DebugError("第4步开始"); |
| | | GA_SDK_Manager.Ins.GuideStep(3);//埋点 |
| | | TDAA_SDKManager.Ins.GuideStep(3);//埋点 |
| | | |
| | | currentIndex = 0; |
| | | needIndex = 2; |
| | | panel.Step3(currentIndex, allGuideDic[currentStep][currentIndex]); |
| | | panel.Step3(currentIndex, ""); |
| | | } |
| | | } |
| | | |
| | | //开始拖拽 |
| | | public void BeginDrag() |
| | | { |
| | | panel.Step3_2(allGuideDic[currentStep][1]); |
| | | panel.Step3_2(""); |
| | | } |
| | | |
| | | //结束推拽 没有合成,回到上一步 |
| | | public void EndDrag() |
| | | { |
| | | panel.Step3(0, allGuideDic[currentStep][0]); |
| | | panel.Step3(0, ""); |
| | | } |
| | | |
| | | //合成了卡牌,开始下一步 |
| | | private void AddCard() |
| | | { |
| | | currentIndex = -1; |
| | | panel.StopShowDragPath(false); |
| | | ChangeStep(GuideEnum.Step4); |
| | | } |
| | | |
| | |
| | | if (currentIndex == -1) |
| | | { |
| | | CommonDebugHelper.DebugError("第5步开始"); |
| | | GA_SDK_Manager.Ins.GuideStep(4);//埋点 |
| | | TDAA_SDKManager.Ins.GuideStep(4);//埋点 |
| | | |
| | | currentIndex = 0; |
| | | panel.StopShowDragPath(true); |
| | | panel.Step4(currentIndex, allGuideDic[currentStep][currentIndex]); |
| | | } |
| | | } |
| | |
| | | private void CreateFireLv2() |
| | | { |
| | | currentIndex = -1; |
| | | panel.StopShowDragPath(true); |
| | | ChangeStep(GuideEnum.Step5); |
| | | } |
| | | |
| | |
| | | if (currentIndex == -1) |
| | | { |
| | | CommonDebugHelper.DebugError("第6步开始"); |
| | | GA_SDK_Manager.Ins.GuideStep(5);//埋点 |
| | | TDAA_SDKManager.Ins.GuideStep(5);//埋点 |
| | | |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.CreateFirstWave); |
| | | panel.Step5(currentIndex, ""); |
| | |
| | | if (currentIndex == -1) |
| | | { |
| | | CommonDebugHelper.DebugError("第7步开始"); |
| | | GA_SDK_Manager.Ins.GuideStep(6);//埋点 |
| | | TDAA_SDKManager.Ins.GuideStep(6);//埋点 |
| | | |
| | | panel.SetGuideUI(false); |
| | | //恢复出怪 |
| | |
| | | if (currentIndex == -1) |
| | | { |
| | | CommonDebugHelper.DebugError("第8步开始"); |
| | | GA_SDK_Manager.Ins.GuideStep(7);//埋点 |
| | | TDAA_SDKManager.Ins.GuideStep(7);//埋点 |
| | | |
| | | currentIndex = 0; |
| | | needIndex = 1; |
| | |
| | | if (currentIndex == -1)//初始化本步 |
| | | { |
| | | CommonDebugHelper.DebugError("第9步开始"); |
| | | GA_SDK_Manager.Ins.GuideStep(8);//埋点 |
| | | TDAA_SDKManager.Ins.GuideStep(8);//埋点 |
| | | GameConfig.CanOpenNewTower = false; |
| | | |
| | | currentIndex = 0; |
| | | needIndex = 2; |
| | | needIndex = 1; |
| | | panel.Step8(); |
| | | |
| | | panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack); |
| | | } |
| | | else if (currentIndex == 1) |
| | | { |
| | | panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | private void Step9() |
| | | { |
| | | if (currentIndex == -1) |
| | | { |
| | | CommonDebugHelper.DebugError("第10步开始"); |
| | | GA_SDK_Manager.Ins.GuideStep(9);//埋点 |
| | | TDAA_SDKManager.Ins.GuideStep(9);//埋点 |
| | | |
| | | currentIndex = 0; |
| | | needIndex = 2; |
| | | panel.SetGuideUI(false); |
| | | panel.Step9(allGuideDic[currentStep][currentIndex], currentIndex, Step9_1); |
| | | panel.Step9("", currentIndex, Step9_1); |
| | | } |
| | | else if (currentIndex == 1) |
| | | { |
| | | panel.Step9(allGuideDic[currentStep][currentIndex], currentIndex, null); |
| | | panel.Step9("", currentIndex, null); |
| | | } |
| | | } |
| | | |
| | |
| | | private void CreateWaterLv1() |
| | | { |
| | | panel.CleanMask(); |
| | | panel.StopShowDragPath(true); |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.CreateSecondWave);//生成第二波小怪 |
| | | } |
| | | |
| | |
| | | if (currentIndex == -1)//初始化本步 |
| | | { |
| | | CommonDebugHelper.DebugError("第11步开始"); |
| | | GA_SDK_Manager.Ins.GuideStep(10);//埋点 |
| | | TDAA_SDKManager.Ins.GuideStep(10);//埋点 |
| | | |
| | | currentIndex = 0; |
| | | needIndex = 2; |
| | |
| | | if (currentIndex == -1) |
| | | { |
| | | CommonDebugHelper.DebugError("第12步开始"); |
| | | GA_SDK_Manager.Ins.GuideStep(11);//埋点 |
| | | TDAA_SDKManager.Ins.GuideStep(11);//埋点 |
| | | |
| | | currentIndex = 0; |
| | | needIndex = 1; |
| | |
| | | //开始拖拽 |
| | | public void BeginDrag11_1() |
| | | { |
| | | |
| | | panel.Step11(1, allGuideDic[currentStep][1]); |
| | | panel.Step11(1, ""); |
| | | } |
| | | |
| | | //结束推拽 没有合成,回到上一步 |
| | | public void EndDrag11_1() |
| | | { |
| | | panel.Step11(0, allGuideDic[currentStep][0]); |
| | | } |
| | | |
| | | private void SkillRelease() |
| | | { |
| | | panel.SkillRelease(); |
| | | } |
| | | |
| | | |
| | |
| | | if (currentIndex == -1)//初始化本步 |
| | | { |
| | | CommonDebugHelper.DebugError("第13步开始"); |
| | | GA_SDK_Manager.Ins.GuideStep(12);//埋点 |
| | | TDAA_SDKManager.Ins.GuideStep(12);//埋点 |
| | | |
| | | currentIndex = 0; |
| | | needIndex = 3; |
| | | needIndex = 2; |
| | | panel.Step12(); |
| | | |
| | | panel.StartShowWord(allGuideDic[currentStep][currentIndex], ShowWordCallBack); |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | private void Finish() |
| | | { |
| | | UnityEngine.Debug.Log("新手指导已经完成了"); |
| | | GA_SDK_Manager.Ins.GuideStep(13);//埋点 |
| | | TDAA_SDKManager.Ins.GuideStep(13);//埋点 |
| | | |
| | | GameConfig.CanOpenNewTower = true; |
| | | GameConfig.CanBuyNewTower = true; |
| | | |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.GuideFinish); |
| | | PlayerPrefs.SetInt("GemBattleGuide", 1); |
| | | Destroy(gameObject); |
| | | //gameObject.SetActive(false); |
| | | } |
| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using System; |
| | | |
| | | using DG.Tweening; |
| | | /// <summary> |
| | | /// 新手引导UI脚本 |
| | | /// </summary> |
| | |
| | | private RectGuidance maskObj; |
| | | |
| | | private RectTransform image_Rim_Rect;//边框 |
| | | private GameObject particle_1, particle_2;//使用粒子特效 |
| | | private RectTransform image_Tip_Rect;//可以移动的提示框 |
| | | private Text text_Tip;//可以移动的提示框文字 |
| | | |
| | |
| | | |
| | | Image backgroundImg;//用来接受空白点击事件的图片 |
| | | |
| | | RectTransform dragHandImg;//拖动标识手指 |
| | | /// <summary> |
| | | /// 关闭所有UI |
| | | /// </summary> |
| | |
| | | } |
| | | |
| | | image_Rim_Rect = transform.Find("Image_Rim").GetComponent<RectTransform>(); |
| | | particle_1 = image_Rim_Rect.transform.Find("Particle System Small").gameObject; |
| | | particle_2 = image_Rim_Rect.transform.Find("Particle System Big").gameObject; |
| | | |
| | | image_Tip_Rect = transform.Find("Image_Tip").GetComponent<RectTransform>(); |
| | | text_Tip = image_Tip_Rect.transform.Find("Text").GetComponent<Text>(); |
| | | image_SkillRim = transform.Find("Image_SkillRim").GetComponent<Image>(); |
| | |
| | | |
| | | skill = transform.Find("Image_Skill").GetComponent<ImageSkill>(); |
| | | skill.gameObject.SetActive(false); |
| | | |
| | | dragHandImg = transform.Find("ImageHand").GetComponent<RectTransform>(); |
| | | dragHandImg.gameObject.SetActive(false); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | Image btnImg = towerBuyBtn.GetComponent<Image>(); |
| | | InitRectGuidance(btnImg, 189, 73.5f); |
| | | SetRimPos(towerBuyBtn); |
| | | maskObj.ShowImmediately(); |
| | | //maskObj.ShowImmediately(); |
| | | |
| | | } |
| | | else if (currentIndex == 1) |
| | |
| | | fire2.gameObject.SetActive(true); |
| | | fire2.enabled = false; |
| | | DestoryButtonListener(towerBuyBtn); |
| | | SetRimActive(false); |
| | | CloseMask(); |
| | | //RemoveButtonListener(towerBuyBtn); |
| | | } |
| | | |
| | |
| | | { |
| | | backgroundImg.raycastTarget = true; |
| | | //RemoveButtonListener(towerBuyBtn); |
| | | SetRimActive(false); |
| | | CloseMask(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | if (currentIndex == 0) |
| | | { |
| | | |
| | | tmpMask.enabled = true; |
| | | |
| | | SetGuideUI(false); |
| | |
| | | SetRimPos(fire2.gameObject); |
| | | fire1.enabled = true; |
| | | fire2.enabled = true; |
| | | image_Tip_Rect.gameObject.SetActive(false); |
| | | ShowDragPath(fire2.GetStartP, fire1.GetRect); |
| | | StartCoroutine(ShowRimTip(str)); |
| | | } |
| | | } |
| | |
| | | public void Step3_2(string str) |
| | | { |
| | | SetRimPos(fire1.gameObject); |
| | | StartCoroutine(ShowRimTip(str)); |
| | | //StartCoroutine(ShowRimTip(str)); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | towerPos.enabled = true; |
| | | InitRectGuidance(btnImg, 75, 80); |
| | | SetRimPos(btnImg.gameObject); |
| | | maskObj.ShowImmediately(); |
| | | //maskObj.ShowImmediately(); |
| | | ShowDragPath(fire1.GetStartP, btnImg.rectTransform); |
| | | StartCoroutine(ShowRimTip(str)); |
| | | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 第六步,拖动造塔 |
| | | /// 第六步 |
| | | /// </summary> |
| | | public void Step5(int currentIndex, string str) |
| | | { |
| | |
| | | GameObject go = transform.Find("Image_TowerPos2").gameObject; |
| | | |
| | | Image btnImg = go.GetComponent<Image>(); |
| | | btnImg.raycastTarget=false; |
| | | btnImg.raycastTarget = false; |
| | | InitRectGuidance(btnImg, 75, 80); |
| | | SetRimPos(go); |
| | | maskObj.ShowImmediately(); |
| | | //maskObj.ShowImmediately(); |
| | | StartCoroutine(ShowRimTip(str)); |
| | | } |
| | | } |
| | |
| | | { |
| | | |
| | | SetRimActive(true); |
| | | |
| | | image_Tip_Rect.gameObject.SetActive(false); |
| | | //设置位置 |
| | | AddButtonListener(towerBuyBtn, ac); |
| | | |
| | | Image btnImg = towerBuyBtn.GetComponent<Image>(); |
| | | InitRectGuidance(btnImg, 189, 73.5f); |
| | | SetRimPos(towerBuyBtn); |
| | | maskObj.ShowImmediately(); |
| | | //maskObj.ShowImmediately(); |
| | | } |
| | | else if (currentIndex == 1) |
| | | { |
| | | GameObject go = transform.Find("Image_TowerPos2").gameObject; |
| | | Image btnImg = go.GetComponent<Image>(); |
| | | btnImg.raycastTarget=true; |
| | | btnImg.raycastTarget = true; |
| | | InitRectGuidance(btnImg, 75, 80); |
| | | SetRimPos(go); |
| | | maskObj.ShowImmediately(); |
| | | //maskObj.ShowImmediately(); |
| | | ShowDragPath(water1.GetStartP, btnImg.rectTransform); |
| | | } |
| | | |
| | | StartCoroutine(ShowRimTip(str)); |
| | | //StartCoroutine(ShowRimTip(str)); |
| | | } |
| | | |
| | | public void Step9_1() |
| | |
| | | if (currentIndex == 0) |
| | | { |
| | | tmpMask.enabled = true; |
| | | |
| | | tmpMask.color = new Color(1.0f, 1.0f, 1.0f, 0); |
| | | SetGuideUI(false); |
| | | SetRimActive(true); |
| | | SetRimPos(skill.gameObject); |
| | | StartCoroutine(ShowRimTip(str)); |
| | | image_Tip_Rect.gameObject.SetActive(false); |
| | | //StartCoroutine(ShowRimTip(str)); |
| | | |
| | | ShowDragPath(skill.GetStartP, image_SkillRim.rectTransform); |
| | | |
| | | InitRectGuidance(image_SkillRim, 79, 265); |
| | | |
| | | } |
| | | else if (currentIndex == 1) |
| | | { |
| | | SetRimPos(image_SkillRim.gameObject); |
| | | StartCoroutine(ShowRimTip(str)); |
| | | SetRimActive(false); |
| | | //SetRimPos(image_SkillRim.gameObject); |
| | | //StartCoroutine(ShowRimTip(str)); |
| | | } |
| | | } |
| | | |
| | | public void SkillRelease() |
| | | { |
| | | StopShowDragPath(true); |
| | | CloseMask(); |
| | | image_SkillRim.gameObject.SetActive(false); |
| | | tmpMask.enabled = false; |
| | | SetRimActive(false); |
| | | } |
| | | |
| | | public void Step12() |
| | | { |
| | | image_SkillRim.gameObject.SetActive(false); |
| | | tmpMask.enabled = false; |
| | | |
| | | |
| | | SetGuideUI(true); |
| | | SetRimActive(false); |
| | | } |
| | | |
| | | #region 按钮以及提示 |
| | |
| | | RectTransform rt = target.GetComponent<RectTransform>(); |
| | | image_Rim_Rect.anchoredPosition = rt.anchoredPosition; |
| | | image_Rim_Rect.sizeDelta = (rt.sizeDelta * rt.localScale) + rimOffset; |
| | | if (image_Rim_Rect.sizeDelta.x > 200) |
| | | { |
| | | particle_1.SetActive(false); |
| | | particle_2.SetActive(true); |
| | | } |
| | | else |
| | | { |
| | | particle_1.SetActive(true); |
| | | particle_2.SetActive(false); |
| | | } |
| | | |
| | | if (changeTipPos) |
| | | image_Tip_Rect.anchoredPosition = new Vector2(image_Rim_Rect.anchoredPosition.x, image_Rim_Rect.anchoredPosition.y + 74 / 2 + image_Rim_Rect.sizeDelta.y / 2); |
| | | |
| | |
| | | maskObj.gameObject.SetActive(true); |
| | | } |
| | | //maskObj.Init(target); |
| | | //maskObj.ShowImmediately(); |
| | | maskObj.InitForCamera(target, x, y); |
| | | |
| | | } |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region 拖动效果 |
| | | private float dragTimer = 1f; |
| | | private void ShowDragPath(Vector2 startP, RectTransform endP) |
| | | { |
| | | if (!dragHandImg.gameObject.activeSelf) |
| | | { |
| | | dragHandImg.gameObject.SetActive(true); |
| | | dragHandImg.anchoredPosition = startP; |
| | | dragHandImg.DOMove(endP.position, 1).SetEase(Ease.InCubic).SetLoops(-1); |
| | | } |
| | | } |
| | | |
| | | public void StopShowDragPath(bool isClose) |
| | | { |
| | | dragHandImg.DOKill(); |
| | | if (isClose) |
| | | dragHandImg.gameObject.SetActive(false); |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | } |
| | |
| | | GameObject level1, level2;//等级标志 |
| | | bool canDrag;//是否可以推拽 |
| | | RectTransform rectTransform;//自身Rect |
| | | |
| | | public RectTransform GetRect |
| | | { |
| | | get |
| | | { |
| | | return rectTransform; |
| | | } |
| | | } |
| | | GameObject target;//推拽到塔位置的标识 |
| | | Image tmpImage;//自身图片 |
| | | Vector2 pos;//初始坐标 |
| | | |
| | | //Vector3 startP; |
| | | public Vector2 GetStartP |
| | | { |
| | | get |
| | | { |
| | | return pos; |
| | | } |
| | | } |
| | | |
| | | // Start is called before the first frame update |
| | | void Start() |
| | | private void Awake() |
| | | { |
| | | |
| | | //startP = transform.position; |
| | | rectTransform = GetComponent<RectTransform>(); |
| | | |
| | | imageFire2 = transform.parent.Find("Image_Fire2").GetComponent<ImageFire2>(); |
| | |
| | | Vector2 pos; |
| | | |
| | | RectTransform rectTransform; |
| | | // Start is called before the first frame update |
| | | void Start() |
| | | //Vector3 startP; |
| | | public Vector2 GetStartP |
| | | { |
| | | get |
| | | { |
| | | return pos; |
| | | } |
| | | } |
| | | // Start is called before the first frame update |
| | | private void Awake() |
| | | { |
| | | //startP = transform.position; |
| | | |
| | | //imageFire1 = transform.parent.Find("Image_Fire1").GetComponent<ImageFire1>(); |
| | | tmpImage = GetComponent<Image>(); |
| | | rectTransform = GetComponent<RectTransform>(); |
| | |
| | | Image tmpImage; |
| | | |
| | | Vector2 pos; |
| | | |
| | | public Vector2 GetStartP |
| | | { |
| | | get |
| | | { |
| | | return pos; |
| | | } |
| | | } |
| | | RectTransform rectTransform; |
| | | |
| | | // Start is called before the first frame update |
| | | void Start() |
| | | private void Awake() |
| | | { |
| | | //imageFire1 = transform.parent.Find("Image_Fire1").GetComponent<ImageFire1>(); |
| | | tmpImage = GetComponent<Image>(); |
| | |
| | | GameObject target;//推拽到塔位置的标识 |
| | | Image tmpImage;//自身图片 |
| | | Vector2 pos;//初始坐标 |
| | | |
| | | public Vector2 GetStartP |
| | | { |
| | | get |
| | | { |
| | | return pos; |
| | | } |
| | | } |
| | | // Start is called before the first frame update |
| | | void Start() |
| | | private void Awake() |
| | | { |
| | | rectTransform = GetComponent<RectTransform>(); |
| | | pos = rectTransform.anchoredPosition; |
| | |
| | | //立刻显示阴影区域 |
| | | public void ShowImmediately() |
| | | { |
| | | return; |
| | | //return; |
| | | |
| | | float valueX = Mathf.SmoothDamp(currentOffsetX, targetOffsetX, ref shrinkVelocityX, 0); |
| | | float valueY = Mathf.SmoothDamp(currentOffsetY, targetOffsetY, ref shrinkVelocityY, 0); |
| | |
| | | { |
| | | gameObject.AddComponent<DoNotDestory>(); |
| | | gameObject.AddComponent<MasterSocket>(); |
| | | gameObject.AddComponent<GA_SDK_Manager>(); |
| | | gameObject.AddComponent<TDAA_SDKManager>(); |
| | | |
| | | //gameObject.AddComponent<ErrorLogOnGUIMyTools>(); |
| | | //gameObject.AddComponent<JsonDataReader>(); |
| | |
| | | using System; |
| | | using UnityEngine; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Core.Utilities; |
| | | using KTGMGemClient; |
| | |
| | | /// 生成agent |
| | | /// </summary> |
| | | /// <returns>Agent</returns> |
| | | protected virtual Agent SpawnAgent() |
| | | protected virtual void SpawnAgent() |
| | | { |
| | | int index = GetIndexByResId(waveData.EnemyData.resource); |
| | | // 木属性小怪需要同时生成两个,先这么写吧(WTF) |
| | | bool isDouble = waveData.EnemyData.resource == 103; |
| | | |
| | | Poolable agentPoolable = Poolable.TryGetPoolable<Poolable>(AgentConfigurationList[index].agentPrefab.gameObject); |
| | | Agent newAgent = agentPoolable.GetComponent<Agent>(); |
| | | |
| | | newAgent.transform.position = StartingNode.transform.position; |
| | | |
| | | if (isDouble) |
| | | { |
| | | Vector3 pos = newAgent.transform.position; |
| | | pos.x -= 2f; |
| | | newAgent.transform.position = pos; |
| | | } |
| | | |
| | | newAgent.transform.rotation = StartingNode.transform.rotation; |
| | | newAgent.SetNode(StartingNode, WaveLineId - 1); |
| | | newAgent.opponentAgent = false; |
| | |
| | | // 加入Manager统一管理. |
| | | AgentInsManager.instance.addAgent(newAgent); |
| | | |
| | | return newAgent; |
| | | |
| | | if (isDouble) |
| | | { |
| | | Poolable agentPoolable2 = Poolable.TryGetPoolable<Poolable>(AgentConfigurationList[index].agentPrefab.gameObject); |
| | | Agent doubleAgent = agentPoolable2.GetComponent<Agent>(); |
| | | doubleAgent.transform.position = StartingNode.transform.position; |
| | | |
| | | Vector3 pos = doubleAgent.transform.position; |
| | | pos.x += 2f; |
| | | doubleAgent.transform.position = pos; |
| | | |
| | | doubleAgent.transform.rotation = StartingNode.transform.rotation; |
| | | doubleAgent.SetNode(StartingNode, WaveLineId - 1); |
| | | doubleAgent.opponentAgent = false; |
| | | doubleAgent.Initialize(); |
| | | |
| | | doubleAgent.SetAgentData(hp, speed, gold); |
| | | doubleAgent.healthBar.SetHealthLevel(1); |
| | | AgentInsManager.instance.addAgent(doubleAgent); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 从Tower的AttributeId获取到怪物的数据 |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | protected List<int> GetMonsterDataFromAttributeId(int id) |
| | | { |
| | | geminfo tgem = new geminfo(); |
| | | if (JsonDataCenter.gemInfoDic.TryGetValue(id, out tgem)) |
| | | return tgem.summon; |
| | | else |
| | | { |
| | | Debug.Log("找不到对应ID的Gem:" + id); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | // Start is called before the first frame update |
| | | void Start() |
| | | { |
| | | if (GA_SDK_Manager.Ins == null) |
| | | gameObject.AddComponent<GA_SDK_Manager>(); |
| | | GA_SDK_Manager.Ins.ArriveBattle();//埋点 |
| | | GA_SDK_Manager.Ins.Statistics(4);//埋点 |
| | | if (TDAA_SDKManager.Ins == null) |
| | | gameObject.AddComponent<TDAA_SDKManager>(); |
| | | TDAA_SDKManager.Ins.ArriveBattle();//埋点 |
| | | TDAA_SDKManager.Ins.Statistics(4);//埋点 |
| | | |
| | | bVibrate = new bool[4]; |
| | | bVibrate[0] = bVibrate[1] = bVibrate[2] = bVibrate[3] = false; |
New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 68ede7dfdce062b4aa903707ba202075 |
| | | TextureImporter: |
| | | internalIDToNameTable: [] |
| | | externalObjects: {} |
| | | serializedVersion: 11 |
| | | 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 |
| | | isReadable: 0 |
| | | streamingMipmaps: 0 |
| | | streamingMipmapsPriority: 0 |
| | | vTOnly: 0 |
| | | grayScaleToAlpha: 0 |
| | | generateCubemap: 6 |
| | | cubemapConvolution: 0 |
| | | seamlessCubemap: 0 |
| | | textureFormat: 1 |
| | | maxTextureSize: 2048 |
| | | textureSettings: |
| | | serializedVersion: 2 |
| | | filterMode: -1 |
| | | aniso: -1 |
| | | mipBias: -100 |
| | | wrapU: 1 |
| | | wrapV: 1 |
| | | wrapW: -1 |
| | | 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 |
| | | maxTextureSizeSet: 0 |
| | | compressionQualitySet: 0 |
| | | textureFormatSet: 0 |
| | | ignorePngGamma: 0 |
| | | applyGammaDecoding: 0 |
| | | platformSettings: |
| | | - serializedVersion: 3 |
| | | buildTarget: DefaultTexturePlatform |
| | | maxTextureSize: 2048 |
| | | resizeAlgorithm: 0 |
| | | textureFormat: -1 |
| | | textureCompression: 1 |
| | | compressionQuality: 50 |
| | | crunchedCompression: 0 |
| | | allowsAlphaSplitting: 0 |
| | | overridden: 0 |
| | | androidETC2FallbackOverride: 0 |
| | | forceMaximumCompressionQuality_BC6H_BC7: 0 |
| | | - serializedVersion: 3 |
| | | buildTarget: Standalone |
| | | maxTextureSize: 2048 |
| | | resizeAlgorithm: 0 |
| | | textureFormat: -1 |
| | | textureCompression: 1 |
| | | compressionQuality: 50 |
| | | crunchedCompression: 0 |
| | | allowsAlphaSplitting: 0 |
| | | overridden: 0 |
| | | androidETC2FallbackOverride: 0 |
| | | forceMaximumCompressionQuality_BC6H_BC7: 0 |
| | | - serializedVersion: 3 |
| | | buildTarget: Android |
| | | maxTextureSize: 2048 |
| | | resizeAlgorithm: 0 |
| | | textureFormat: -1 |
| | | textureCompression: 1 |
| | | compressionQuality: 50 |
| | | crunchedCompression: 0 |
| | | allowsAlphaSplitting: 0 |
| | | overridden: 0 |
| | | androidETC2FallbackOverride: 0 |
| | | forceMaximumCompressionQuality_BC6H_BC7: 0 |
| | | spriteSheet: |
| | | serializedVersion: 2 |
| | | sprites: [] |
| | | outline: [] |
| | | physicsShape: [] |
| | | bones: [] |
| | | spriteID: 5e97eb03825dee720800000000000000 |
| | | internalID: 0 |
| | | vertices: [] |
| | | indices: |
| | | edges: [] |
| | | weights: [] |
| | | secondaryTextures: [] |
| | | spritePackingTag: |
| | | pSDRemoveMatte: 0 |
| | | pSDShowRemoveMatteOption: 0 |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | webGLDecompressionFallback: 0 |
| | | scriptingDefineSymbols: |
| | | 1: MOREMOUNTAINS_NICEVIBRATIONS;TDGA_CUSTOM |
| | | 7: MOREMOUNTAINS_NICEVIBRATIONS;TDGA_CUSTOM |
| | | 7: MOREMOUNTAINS_NICEVIBRATIONS;TDAA_CUSTOM |
| | | platformArchitecture: {} |
| | | scriptingBackend: {} |
| | | il2cppCompilerConfiguration: {} |