text
stringlengths
7
35.3M
id
stringlengths
11
185
metadata
dict
__index_level_0__
int64
0
2.14k
fileFormatVersion: 2 guid: 2e3c5cdf8baa7fb4d86ab8c89d18e80a labels: - CartoonFX - Toon - Particles - Hit NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs (Mobile)/Misc/Color Variants/CFXM3_Hit_Misc_D (Blue).prefab.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs (Mobile)/Misc/Color Variants/CFXM3_Hit_Misc_D (Blue).prefab.meta", "repo_id": "jynew", "token_count": 97 }
1,813
fileFormatVersion: 2 guid: 14a1bc858a0ece94397cfc0ee5120e6c labels: - CartoonFX - Toon - Particles - Nature NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs (Mobile)/Nature/Color Variants/CFXM3_FallingLeaves_Large (GreenBlue).prefab.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs (Mobile)/Nature/Color Variants/CFXM3_FallingLeaves_Large (GreenBlue).prefab.meta", "repo_id": "jynew", "token_count": 94 }
1,814
fileFormatVersion: 2 guid: aa4269943ca538a42b9f6120f411d86f labels: - CartoonFX - Toon - Particles - Nature - Magic NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs (Mobile)/Nature/Color Variants/CFXM3_Shield_Leaves_Raw (GreenBlue).prefab.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs (Mobile)/Nature/Color Variants/CFXM3_Shield_Leaves_Raw (GreenBlue).prefab.meta", "repo_id": "jynew", "token_count": 95 }
1,815
fileFormatVersion: 2 guid: 1a220dcd47d8e6241902fedb6c01497c labels: - CartoonFX - Toon - Particles - Smoke NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs/Environment/CFX3_SmokeColumn_Wind_Black.prefab.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs/Environment/CFX3_SmokeColumn_Wind_Black.prefab.meta", "repo_id": "jynew", "token_count": 93 }
1,816
fileFormatVersion: 2 guid: 2687d26678b65c140adac5314c8c59d1 labels: - CartoonFX - Toon - Particles - Fire - Hit - Ground NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs/Fire/CFX3_Hit_Fire_A_Ground.prefab.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs/Fire/CFX3_Hit_Fire_A_Ground.prefab.meta", "repo_id": "jynew", "token_count": 98 }
1,817
fileFormatVersion: 2 guid: 9c8fb30c1f622e744b0d502c95825d09 labels: - CartoonFX - Toon - Particles NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs/Light/CFX3_Hit_Light_C_Ground.prefab.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs/Light/CFX3_Hit_Light_C_Ground.prefab.meta", "repo_id": "jynew", "token_count": 93 }
1,818
fileFormatVersion: 2 guid: eb64187b202c4384cab85852d7f31e1c folderAsset: yes DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs/Light/Variants.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs/Light/Variants.meta", "repo_id": "jynew", "token_count": 70 }
1,819
fileFormatVersion: 2 guid: 7adba9fc29a2b9749aab3da48b1bffd1 labels: - CartoonFX - Toon - Particles - Dark - Magic - Aura NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs/Magic Dark/Color Variants/CFX3_DarkMagicAura_A (Red).prefab.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs/Magic Dark/Color Variants/CFX3_DarkMagicAura_A (Red).prefab.meta", "repo_id": "jynew", "token_count": 101 }
1,820
fileFormatVersion: 2 guid: 58c7457b93a02ed41b7ab4c6e07a7f97 labels: - CartoonFX - Toon - Particles - Magic - Aura NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs/Magic Misc/Color Variants/CFX3_MagicAura_B_Runic (Green).prefab.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs/Magic Misc/Color Variants/CFX3_MagicAura_B_Runic (Green).prefab.meta", "repo_id": "jynew", "token_count": 98 }
1,821
fileFormatVersion: 2 guid: 2516cabdceef6844b8622fef61c35a0a labels: - CartoonFX - Toon - Particles - Magic NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs/Magic Misc/Color Variants/CFX3_VortexTornado (Blue).prefab.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs/Magic Misc/Color Variants/CFX3_VortexTornado (Blue).prefab.meta", "repo_id": "jynew", "token_count": 93 }
1,822
fileFormatVersion: 2 guid: 7d011b3c45919da49a20addc24128fcc labels: - CartoonFX - Toon - Particles - Magic - Ground NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs/Magic Misc/Color Variants/CFX3_Vortex_Ground (Yellow).prefab.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs/Magic Misc/Color Variants/CFX3_Vortex_Ground (Yellow).prefab.meta", "repo_id": "jynew", "token_count": 94 }
1,823
fileFormatVersion: 2 guid: 7cc1d6cff2aa980478dc1b15e782fc52 labels: - CartoonFX - Toon - Particles - Hit NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs/Misc/Color Variants/CFX3_Hit_Misc_D (Blue).prefab.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs/Misc/Color Variants/CFX3_Hit_Misc_D (Blue).prefab.meta", "repo_id": "jynew", "token_count": 92 }
1,824
fileFormatVersion: 2 guid: 8709a96a43159954d932c0e413c3ec60 labels: - CartoonFX - Toon - Particles - Nature - Magic NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs/Nature/Color Variants/CFX3_Shield_Leaves_Raw (GreenBlue).prefab.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/CFX3 Prefabs/Nature/Color Variants/CFX3_Shield_Leaves_Raw (GreenBlue).prefab.meta", "repo_id": "jynew", "token_count": 96 }
1,825
fileFormatVersion: 2 guid: b968a6a0697ad574cae1a07543d11963 NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Demo/Assets/CFX_Demo_Water.mat.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Demo/Assets/CFX_Demo_Water.mat.meta", "repo_id": "jynew", "token_count": 72 }
1,826
fileFormatVersion: 2 guid: ed9d3b84730d3dd498effb7855f961a3 folderAsset: yes DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Materials (Mobile).meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Materials (Mobile).meta", "repo_id": "jynew", "token_count": 71 }
1,827
fileFormatVersion: 2 guid: 1823eba83580bbc439464a5ef374e5c8 NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Materials (Mobile)/Light/CFXM3_AuraRays MULT.mat.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Materials (Mobile)/Light/CFXM3_AuraRays MULT.mat.meta", "repo_id": "jynew", "token_count": 74 }
1,828
fileFormatVersion: 2 guid: 0053b65302e6f7649b1c013c4c41906b NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Materials (Mobile)/Light/CFXM3_GlowStar ADD.mat.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Materials (Mobile)/Light/CFXM3_GlowStar ADD.mat.meta", "repo_id": "jynew", "token_count": 74 }
1,829
fileFormatVersion: 2 guid: 2dbfe9974ba76bd46bd7352e84ccabfa NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Materials (Mobile)/Water/CFXM2_RainRipple.mat.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Materials (Mobile)/Water/CFXM2_RainRipple.mat.meta", "repo_id": "jynew", "token_count": 71 }
1,830
fileFormatVersion: 2 guid: 503ba37627ac18c4ebe9bbe73d6ea9ad NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Materials/Animated/CFX_Anim_Bubble_Add.mat.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Materials/Animated/CFX_Anim_Bubble_Add.mat.meta", "repo_id": "jynew", "token_count": 73 }
1,831
fileFormatVersion: 2 guid: c1b09b1ca8ba05d4682ccf6db6b1102d NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Materials/Misc/CFX2_ShinyStar Add.mat.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Materials/Misc/CFX2_ShinyStar Add.mat.meta", "repo_id": "jynew", "token_count": 76 }
1,832
fileFormatVersion: 2 guid: 25cbaca39ac0e3f47b4db172e11cb9aa NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Materials/Misc/CFX3_SmokePuff MULT.mat.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Materials/Misc/CFX3_SmokePuff MULT.mat.meta", "repo_id": "jynew", "token_count": 73 }
1,833
fileFormatVersion: 2 guid: c645dd2cc971a054290f4790c5754089 NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Materials/Symbols/CFX2_Frown Outline Add.mat.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Materials/Symbols/CFX2_Frown Outline Add.mat.meta", "repo_id": "jynew", "token_count": 72 }
1,834
fileFormatVersion: 2 guid: 219882489a1df4042823f03b5b903103 NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Materials/Symbols/CFX2_SkullStretched Add.mat.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Materials/Symbols/CFX2_SkullStretched Add.mat.meta", "repo_id": "jynew", "token_count": 72 }
1,835
fileFormatVersion: 2 guid: 30db71c1add78bc42a3d83af298a4f5a NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Materials/Symbols/CFX3_Skull ADDSOFT.mat.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Materials/Symbols/CFX3_Skull ADDSOFT.mat.meta", "repo_id": "jynew", "token_count": 74 }
1,836
fileFormatVersion: 2 guid: 33e6621d2756c044d88f4f9de1a55e7e ModelImporter: serializedVersion: 20200 internalIDToNameTable: - first: 1: 100000 second: //RootNode - first: 4: 400000 second: //RootNode - first: 23: 2300000 second: //RootNode - first: 33: 3300000 second: //RootNode - first: 43: 4300000 second: Cylinder01 - first: 43: 4300002 second: CFX_Circular - first: 111: 11100000 second: //RootNode externalObjects: {} materials: materialImportMode: 0 materialName: 1 materialSearch: 0 materialLocation: 0 animations: legacyGenerateAnimations: 4 bakeSimulation: 0 resampleCurves: 1 optimizeGameObjects: 0 motionNodeName: rigImportErrors: rigImportWarnings: animationImportErrors: animationImportWarnings: animationRetargetingWarnings: animationDoRetargetingWarnings: 0 importAnimatedCustomProperties: 0 importConstraints: 0 animationCompression: 1 animationRotationError: 0.5 animationPositionError: 0.5 animationScaleError: 0.5 animationWrapMode: 0 extraExposedTransformPaths: [] extraUserProperties: [] clipAnimations: [] isReadable: 1 meshes: lODScreenPercentages: [] globalScale: 0.01 meshCompression: 0 addColliders: 0 useSRGBMaterialColor: 1 sortHierarchyByName: 1 importVisibility: 0 importBlendShapes: 1 importCameras: 0 importLights: 0 fileIdsGeneration: 1 swapUVChannels: 0 generateSecondaryUV: 0 useFileUnits: 1 keepQuads: 0 weldVertices: 1 bakeAxisConversion: 0 preserveHierarchy: 0 skinWeightsMode: 0 maxBonesPerVertex: 4 minBoneWeight: 0.001 meshOptimizationFlags: -1 indexFormat: 1 secondaryUVAngleDistortion: 8 secondaryUVAreaDistortion: 15.000001 secondaryUVHardAngle: 88 secondaryUVMarginMethod: 0 secondaryUVMinLightmapResolution: 40 secondaryUVMinObjectScale: 1 secondaryUVPackMargin: 4 useFileScale: 0 tangentSpace: normalSmoothAngle: 60 normalImportMode: 0 tangentImportMode: 4 normalCalculationMode: 0 legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 1 blendShapeNormalImportMode: 1 normalSmoothingSource: 0 referencedClips: [] importAnimation: 1 humanDescription: serializedVersion: 3 human: [] skeleton: [] armTwist: 0.5 foreArmTwist: 0.5 upperLegTwist: 0.5 legTwist: 0.5 armStretch: 0.05 legStretch: 0.05 feetSpacing: 0 globalScale: 0.01 rootMotionBoneName: hasTranslationDoF: 0 hasExtraRoot: 0 skeletonHasParents: 0 lastHumanDescriptionAvatarSource: {instanceID: 0} autoGenerateAvatarMappingIfUnspecified: 1 animationType: 1 humanoidOversampling: 1 avatarSetup: 0 addHumanoidExtraRootOnlyWhenUsingAvatar: 0 additionalBone: 1 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Mesh/CFX_Mesh_Circular.FBX.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Mesh/CFX_Mesh_Circular.FBX.meta", "repo_id": "jynew", "token_count": 1189 }
1,837
using UnityEngine; using System.Collections; // Cartoon FX - (c) 2013, Jean Moreno // Automatically destroys the GameObject when there are no children left. public class CFX_AutodestructWhenNoChildren : MonoBehaviour { // Update is called once per frame void Update () { if( transform.childCount == 0) { GameObject.Destroy(this.gameObject); } } }
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Scripts/CFX_AutodestructWhenNoChildren.cs/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Scripts/CFX_AutodestructWhenNoChildren.cs", "repo_id": "jynew", "token_count": 118 }
1,838
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' // CartoonFX 3 Shader // (c) 2013, Jean Moreno Shader "Cartoon FX/Particle Multiply Colored" { Properties { _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5) _MainTex ("Particle Texture (alpha)", 2D) = "white" {} _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 } Category { Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } Blend DstColor Zero AlphaTest Greater .01 ColorMask RGB Cull Off Lighting Off ZWrite Off Fog { Color (0,0,0,0) } BindChannels { Bind "Color", color Bind "Vertex", vertex Bind "TexCoord", texcoord } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag #pragma fragmentoption ARB_precision_hint_fastest #pragma multi_compile_particles #include "UnityCG.cginc" sampler2D _MainTex; float4 _MainTex_ST; fixed4 _TintColor; sampler2D _CameraDepthTexture; float _InvFade; struct appdata_t { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; }; struct v2f { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; #ifdef SOFTPARTICLES_ON float4 projPos : TEXCOORD1; #endif }; v2f vert (appdata_t v) { v2f o; o.vertex = UnityObjectToClipPos(v.vertex); #ifdef SOFTPARTICLES_ON o.projPos = ComputeScreenPos (o.vertex); COMPUTE_EYEDEPTH(o.projPos.z); #endif o.color = v.color; o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); return o; } fixed4 frag (v2f i) : COLOR { #ifdef SOFTPARTICLES_ON float sceneZ = LinearEyeDepth (UNITY_SAMPLE_DEPTH(tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)))); float partZ = i.projPos.z; float fade = saturate (_InvFade * (sceneZ-partZ)); i.color.a *= fade; #endif fixed4 tex = tex2D(_MainTex, i.texcoord); // tex.rgb *= i.color.rgb * _TintColor.rgb * 2.0f; // tex = lerp(tex, fixed4(0.5,0.5,0.5,0.5), 1-tex * i.color.a); return lerp(fixed4(1,1,1,1), _TintColor * i.color, tex * i.color.a); // return 2.0f * i.color * _TintColor * lerp(fixed4(0,0,0,0), fixed4(1,1,1,1), tex2D(_MainTex, i.texcoord).a * i.color.a); } ENDCG } } } }
jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Shaders/CFX3 Multiply Color.shader/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/Cartoon FX/Shaders/CFX3 Multiply Color.shader", "repo_id": "jynew", "token_count": 1243 }
1,839
金庸群侠传3D重制版项目特殊授权声明文件 放置本文件的目录,表示本项目未取得该素材授权,如果您有异议,可以与我们联系。 而在任何其他场景使用的情况下,均与金庸群侠传3D重制版无关,请自行遵循版权规范。 以下是未授权资产声明:(如无,则默认是本目录及所有子目录内容)
jynew/jyx2/Assets/VFX/JMO Assets/UNAUTH_ASSETS_FOR_JYX2.md/0
{ "file_path": "jynew/jyx2/Assets/VFX/JMO Assets/UNAUTH_ASSETS_FOR_JYX2.md", "repo_id": "jynew", "token_count": 284 }
1,840
%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: Ice_01 m_Shader: {fileID: 10721, 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: 68e0565684aa24442a613d8ab974c702, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: [] m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: []
jynew/jyx2/Assets/VFX/Jyx2Effect/Materials/Ice_01.mat/0
{ "file_path": "jynew/jyx2/Assets/VFX/Jyx2Effect/Materials/Ice_01.mat", "repo_id": "jynew", "token_count": 373 }
1,841
%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: Retro Bit FX - Fire 001 ALPHA 1 m_Shader: {fileID: 10721, 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: 8bf41f141ac03964c920e789bffaf465, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: [] m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: []
jynew/jyx2/Assets/VFX/Jyx2Effect/Materials/Retro Bit FX - Fire 001 ALPHA 1.mat/0
{ "file_path": "jynew/jyx2/Assets/VFX/Jyx2Effect/Materials/Retro Bit FX - Fire 001 ALPHA 1.mat", "repo_id": "jynew", "token_count": 380 }
1,842
%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: WFX_M_SmokeScroll SoftMult m_Shader: {fileID: 4800000, guid: d07d6d0a86d4865468e58eacf94364ae, type: 3} 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: a222b3d2c604e1946af11e01d29efdee, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: - _InvFade: 1.0575 - _ScrollSpeed: 6 m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmisColor: {r: 0.2, g: 0.2, b: 0.2, a: 0} - _TintColor: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: []
jynew/jyx2/Assets/VFX/Jyx2Effect/Materials/WFX_M_SmokeScroll SoftMult.mat/0
{ "file_path": "jynew/jyx2/Assets/VFX/Jyx2Effect/Materials/WFX_M_SmokeScroll SoftMult.mat", "repo_id": "jynew", "token_count": 482 }
1,843
fileFormatVersion: 2 guid: 88686988ee57a6a4787f802523192931 NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/Jyx2Effect/Prefabs/eft000.prefab.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/Jyx2Effect/Prefabs/eft000.prefab.meta", "repo_id": "jynew", "token_count": 72 }
1,844
fileFormatVersion: 2 guid: fe960bead12df6b438de95a819f6396a PrefabImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/Jyx2Effect/Prefabs/eft007-fire2.prefab.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/Jyx2Effect/Prefabs/eft007-fire2.prefab.meta", "repo_id": "jynew", "token_count": 64 }
1,845
fileFormatVersion: 2 guid: a4f34bf351754a74b8b2c0c5bd6c811b folderAsset: yes DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/Jyx2Effect/Textures.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/Jyx2Effect/Textures.meta", "repo_id": "jynew", "token_count": 74 }
1,846
fileFormatVersion: 2 guid: d12401b1d083eb6488f5351de897facb NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/Jyx2Effect/Textures/No Name.mat.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/Jyx2Effect/Textures/No Name.mat.meta", "repo_id": "jynew", "token_count": 72 }
1,847
fileFormatVersion: 2 guid: 2163e751eb8100b4c9870871f6d9636f NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/Toon_Explosion_V1/Effect/_Material/Explode02_8x5_40.mat.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/Toon_Explosion_V1/Effect/_Material/Explode02_8x5_40.mat.meta", "repo_id": "jynew", "token_count": 73 }
1,848
fileFormatVersion: 2 guid: 6fc3fea949d089c40ac541cf605dc3f5 NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/Toon_Explosion_V1/Effect/_Material/FireBall_8x4_32.mat.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/Toon_Explosion_V1/Effect/_Material/FireBall_8x4_32.mat.meta", "repo_id": "jynew", "token_count": 73 }
1,849
fileFormatVersion: 2 guid: 9d86c934bf468e447bf88922e4050f3e folderAsset: yes DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/VFX/Toon_Explosion_V1/Example/_Model/Materials.meta/0
{ "file_path": "jynew/jyx2/Assets/VFX/Toon_Explosion_V1/Example/_Model/Materials.meta", "repo_id": "jynew", "token_count": 69 }
1,850
## Secondary development of the build engine xLua's build engine supports secondary development, and you can use it to generate some text files (for example, code and configuration files). The xLua's link.xml file is generated by the build engine plugin. Other application scenarios (such as generating a Lua IDE auto configuration file) can also be accomplished using this feature. ## Overview The plugin needs to provide two things: 1. a template for generated files, 2. a callback function that accepts the user configuration and returns the data that needs to be injected into the template and the output stream of the files. ## Template syntax The template syntax is simple, with only three elements: * eval: The syntax is <%=exp%>. Exp is an arbitrary expression that will calculate and output the value of exp as a string. * Code: The syntax is <% if true then end%>. The blue part is any Lua code that will be executed. * Literal: This contains the parts other than eval and code. Literal means output as it is. Example: ~~~xml <% require "TemplateCommon" %> <linker> <%ForEachCsList(assembly_infos, function(assembly_info)%> <assembly fullname="<%=assembly_info.FullName%>"> <%ForEachCsList(assembly_info.Types, function(type) %><type fullname="<%=type:ToString()%>" preserve="all"/> <%end)%> </assembly> <%end)%> </linker> ~~~ TemplateCommon has some predefined functions that can be used (for example ForEachCsList). You can search in TemplateCommon.lua.txt of the project to see which functions are available. For ordinary Lua, you can write one. ## API ~~~csharp public static void CSObjectWrapEditor.Generator.CustomGen(string template_src, GetTasks get_tasks) ~~~ * template_src: template source code * get_tasks: This is a callback function. The type is GetTasks. This function is used to accept the user configuration and return the data that needs to be injected into the template and the output stream of the files. ~~~csharp public delegate IEnumerable<CustomGenTask> GetTasks(LuaEnv lua_env, UserConfig user_cfg); ~~~ * lua_env: This is a LuaEnv object. Because the returned template data needs to be placed in LuaTable, LuaEnv.NewTable is required. * user_cfg: user configuration * return: Among the returned values, CustomGenTask represents a generated file, and IEnumerable type indicates that the same template can generate multiple files. ~~~csharp public struct UserConfig { public IEnumerable<Type> LuaCallCSharp; public IEnumerable<Type> CSharpCallLua; public IEnumerable<Type> ReflectionUse; } ~~~ ~~~csharp public struct CustomGenTask { public LuaTable Data; public TextWriter Output; } ~~~ Example: ~~~csharp public static IEnumerable<CustomGenTask> GetTasks(LuaEnv lua_env, UserConfig user_cfg) { LuaTable data = lua_env.NewTable(); var assembly_infos = (from type in user_cfg.ReflectionUse group type by type.Assembly.GetName().Name into assembly_info select new { FullName = assembly_info.Key, Types = assembly_info.ToList()}).ToList(); data.Set("assembly_infos", assembly_infos); yield return new CustomGenTask { Data = data, Output = new StreamWriter(GeneratorConfig.common_path + "/link.xml", false, Encoding.UTF8) }; } ~~~ * Only one file is generated here, so only one CustomGenTask is returned. * data is the data to be used in the template. There is an assembly_infos field included. See the template section for how to use this field. ## Tag Generally speaking, you can use MenuItem to create a menu to trigger a custom generate operation. However, sometimes you may want the generate operation to be triggered directly by the xLua "Generate Code" menu. In this situation, you will need to use CSObjectWrapEditor.GenCodeMenu Example: ~~~csharp [GenCodeMenu]//加到Generate Code菜单里头 public static void GenLinkXml() { Generator.CustomGen(ScriptableObject.CreateInstance<LinkXmlGen>().Template.text, GetTasks); } ~~~ PS: All the code related to the content above is in the XLua\Src\Editor\LinkXmlGen directory, which is also the implementation of the link.xml generation function that was explained at the beginning.
jynew/jyx2/Assets/XLua/Doc/Custom_Generate_EN.md/0
{ "file_path": "jynew/jyx2/Assets/XLua/Doc/Custom_Generate_EN.md", "repo_id": "jynew", "token_count": 1254 }
1,851
fileFormatVersion: 2 guid: 76e3df78477813b47bb62712878a2f62 timeCreated: 1529661499 licenseType: Pro DefaultImporter: userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/XLua/Doc/XLua_Tutorial_EN.md.meta/0
{ "file_path": "jynew/jyx2/Assets/XLua/Doc/XLua_Tutorial_EN.md.meta", "repo_id": "jynew", "token_count": 70 }
1,852
fileFormatVersion: 2 guid: 9d871df7bbc973d468622dd10b6f7ea9 timeCreated: 1518577405 licenseType: Pro DefaultImporter: userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/XLua/Doc/XLua教程.md.meta/0
{ "file_path": "jynew/jyx2/Assets/XLua/Doc/XLua教程.md.meta", "repo_id": "jynew", "token_count": 73 }
1,853
fileFormatVersion: 2 guid: 6a4f6da9af53d384d8228950f82ae562 folderAsset: yes DefaultImporter: userData:
jynew/jyx2/Assets/XLua/Examples/06_Coroutine.meta/0
{ "file_path": "jynew/jyx2/Assets/XLua/Examples/06_Coroutine.meta", "repo_id": "jynew", "token_count": 46 }
1,854
fileFormatVersion: 2 guid: 08ebe6e4959b8c34aad49a439411e429 folderAsset: yes timeCreated: 1482318804 licenseType: Pro DefaultImporter: userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/XLua/Examples/08_Hotfix.meta/0
{ "file_path": "jynew/jyx2/Assets/XLua/Examples/08_Hotfix.meta", "repo_id": "jynew", "token_count": 76 }
1,855
using System; using System.IO; using System.Collections.Generic; using UnityEngine; using XLua; namespace XLuaTest { [LuaCallCSharp] public class Foo1Parent { } [LuaCallCSharp] public class Foo2Parent { } [LuaCallCSharp] public class Foo1Child : Foo1Parent { } [LuaCallCSharp] public class Foo2Child : Foo2Parent { } [LuaCallCSharp] public class Foo { #region Supported methods public void Test1<T>(T a) where T : Foo1Parent { Debug.Log(string.Format("Test1<{0}>", typeof(T))); } public T1 Test2<T1, T2>(T1 a, T2 b, GameObject c) where T1 : Foo1Parent where T2 : Foo2Parent { Debug.Log(string.Format("Test2<{0},{1}>", typeof(T1), typeof(T2)), c); return a; } #endregion #region Unsupported methods /// <summary> /// 不支持生成lua的泛型方法(没有泛型约束) /// </summary> public void UnsupportedMethod1<T>(T a) { Debug.Log("UnsupportedMethod1"); } /// <summary> /// 不支持生成lua的泛型方法(缺少带约束的泛型参数) /// </summary> public void UnsupportedMethod2<T>() where T : Foo1Parent { Debug.Log(string.Format("UnsupportedMethod2<{0}>", typeof(T))); } /// <summary> /// 不支持生成lua的泛型方法(泛型约束必须为class) /// </summary> public void UnsupportedMethod3<T>(T a) where T : IDisposable { Debug.Log(string.Format("UnsupportedMethod3<{0}>", typeof(T))); } #endregion } [LuaCallCSharp] public static class FooExtension { public static void PlainExtension(this Foo1Parent a) { Debug.Log("PlainExtension"); } public static T Extension1<T>(this T a) where T : Foo1Parent { Debug.Log(string.Format("Extension1<{0}>", typeof(T))); return a; } public static T Extension2<T>(this T a, GameObject b) where T : Foo1Parent { Debug.Log(string.Format("Extension2<{0}>", typeof(T)), b); return a; } public static void Extension2<T1, T2>(this T1 a, T2 b) where T1 : Foo1Parent where T2 : Foo2Parent { Debug.Log(string.Format("Extension2<{0},{1}>", typeof(T1), typeof(T2))); } public static T UnsupportedExtension<T>(this GameObject obj) where T : Component { return obj.GetComponent<T>(); } } }
jynew/jyx2/Assets/XLua/Examples/09_GenericMethod/Foo.cs/0
{ "file_path": "jynew/jyx2/Assets/XLua/Examples/09_GenericMethod/Foo.cs", "repo_id": "jynew", "token_count": 1348 }
1,856
fileFormatVersion: 2 guid: 8771a42e51c869743bd8cbf0511b8afd timeCreated: 1489371350 licenseType: Pro DefaultImporter: userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/XLua/Examples/10_SignatureLoader/otherfiles/signatured3.lua.meta/0
{ "file_path": "jynew/jyx2/Assets/XLua/Examples/10_SignatureLoader/otherfiles/signatured3.lua.meta", "repo_id": "jynew", "token_count": 72 }
1,857
fileFormatVersion: 2 guid: cffb50bfe4f87494c8a4851450dfb340 timeCreated: 1501577402 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/XLua/Examples/12_ReImplementInLua/ReImplementInLua.cs.meta/0
{ "file_path": "jynew/jyx2/Assets/XLua/Examples/12_ReImplementInLua/ReImplementInLua.cs.meta", "repo_id": "jynew", "token_count": 100 }
1,858
/* * Tencent is pleased to support the open source community by making xLua available. * Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at * http://opensource.org/licenses/MIT * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #if USE_UNI_LUA using LuaAPI = UniLua.Lua; using RealStatePtr = UniLua.ILuaState; using LuaCSFunction = UniLua.CSharpFunctionDelegate; #else using LuaAPI = XLua.LuaDLL.Lua; using RealStatePtr = System.IntPtr; using LuaCSFunction = XLua.LuaDLL.lua_CSFunction; #endif using System; namespace XLua { public abstract class LuaBase : IDisposable { protected bool disposed; protected readonly int luaReference; protected readonly LuaEnv luaEnv; #if UNITY_EDITOR || XLUA_GENERAL protected int _errorFuncRef { get { return luaEnv.errorFuncRef; } } protected RealStatePtr _L { get { return luaEnv.L; } } protected ObjectTranslator _translator { get { return luaEnv.translator; } } #endif public LuaBase(int reference, LuaEnv luaenv) { luaReference = reference; luaEnv = luaenv; } ~LuaBase() { Dispose(false); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } public virtual void Dispose(bool disposeManagedResources) { if (!disposed) { if (luaReference != 0) { #if THREAD_SAFE || HOTFIX_ENABLE lock (luaEnv.luaEnvLock) { #endif bool is_delegate = this is DelegateBridgeBase; if (disposeManagedResources) { luaEnv.translator.ReleaseLuaBase(luaEnv.L, luaReference, is_delegate); } else //will dispse by LuaEnv.GC { luaEnv.equeueGCAction(new LuaEnv.GCAction { Reference = luaReference, IsDelegate = is_delegate }); } #if THREAD_SAFE || HOTFIX_ENABLE } #endif } disposed = true; } } public override bool Equals(object o) { if (o != null && this.GetType() == o.GetType()) { #if THREAD_SAFE || HOTFIX_ENABLE lock (luaEnv.luaEnvLock) { #endif LuaBase rhs = (LuaBase)o; var L = luaEnv.L; if (L != rhs.luaEnv.L) return false; int top = LuaAPI.lua_gettop(L); LuaAPI.lua_getref(L, rhs.luaReference); LuaAPI.lua_getref(L, luaReference); int equal = LuaAPI.lua_rawequal(L, -1, -2); LuaAPI.lua_settop(L, top); return (equal != 0); #if THREAD_SAFE || HOTFIX_ENABLE } #endif } else return false; } public override int GetHashCode() { LuaAPI.lua_getref(luaEnv.L, luaReference); var pointer = LuaAPI.lua_topointer(luaEnv.L, -1); LuaAPI.lua_pop(luaEnv.L, 1); return pointer.ToInt32(); } internal virtual void push(RealStatePtr L) { LuaAPI.lua_getref(L, luaReference); } } }
jynew/jyx2/Assets/XLua/Src/LuaBase.cs/0
{ "file_path": "jynew/jyx2/Assets/XLua/Src/LuaBase.cs", "repo_id": "jynew", "token_count": 1953 }
1,859
/* * Tencent is pleased to support the open source community by making xLua available. * Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at * http://opensource.org/licenses/MIT * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #if USE_UNI_LUA using LuaAPI = UniLua.Lua; using RealStatePtr = UniLua.ILuaState; using LuaCSFunction = UniLua.CSharpFunctionDelegate; #else using LuaAPI = XLua.LuaDLL.Lua; using RealStatePtr = System.IntPtr; using LuaCSFunction = XLua.LuaDLL.lua_CSFunction; #endif using System.Collections; using System.Collections.Generic; using System; using System.Reflection; namespace XLua { public delegate bool ObjectCheck(RealStatePtr L, int idx); public delegate object ObjectCast(RealStatePtr L, int idx, object target); // if target is null, will new one public class ObjectCheckers { Dictionary<Type, ObjectCheck> checkersMap = new Dictionary<Type, ObjectCheck>(); ObjectTranslator translator; public ObjectCheckers(ObjectTranslator translator) { this.translator = translator; checkersMap[typeof(sbyte)] = numberCheck; checkersMap[typeof(byte)] = numberCheck; checkersMap[typeof(short)] = numberCheck; checkersMap[typeof(ushort)] = numberCheck; checkersMap[typeof(int)] = numberCheck; checkersMap[typeof(uint)] = numberCheck; checkersMap[typeof(long)] = int64Check; checkersMap[typeof(ulong)] = uint64Check; checkersMap[typeof(double)] = numberCheck; checkersMap[typeof(char)] = numberCheck; checkersMap[typeof(float)] = numberCheck; checkersMap[typeof(decimal)] = decimalCheck; checkersMap[typeof(bool)] = boolCheck; checkersMap[typeof(string)] = strCheck; checkersMap[typeof(object)] = objectCheck; checkersMap[typeof(byte[])] = bytesCheck; checkersMap[typeof(IntPtr)] = intptrCheck; checkersMap[typeof(LuaTable)] = luaTableCheck; checkersMap[typeof(LuaFunction)] = luaFunctionCheck; } private static bool objectCheck(RealStatePtr L, int idx) { return true; } private bool luaTableCheck(RealStatePtr L, int idx) { return LuaAPI.lua_isnil(L, idx) || LuaAPI.lua_istable(L, idx) || (LuaAPI.lua_type(L, idx) == LuaTypes.LUA_TUSERDATA && translator.SafeGetCSObj(L, idx) is LuaTable); } private bool numberCheck(RealStatePtr L, int idx) { return LuaAPI.lua_type(L, idx) == LuaTypes.LUA_TNUMBER; } private bool decimalCheck(RealStatePtr L, int idx) { return LuaAPI.lua_type(L, idx) == LuaTypes.LUA_TNUMBER || translator.IsDecimal(L, idx); } private bool strCheck(RealStatePtr L, int idx) { return LuaAPI.lua_type(L, idx) == LuaTypes.LUA_TSTRING || LuaAPI.lua_isnil(L, idx); } private bool bytesCheck(RealStatePtr L, int idx) { return LuaAPI.lua_type(L, idx) == LuaTypes.LUA_TSTRING || LuaAPI.lua_isnil(L, idx) || (LuaAPI.lua_type(L, idx) == LuaTypes.LUA_TUSERDATA && translator.SafeGetCSObj(L, idx) is byte[]); } private bool boolCheck(RealStatePtr L, int idx) { return LuaAPI.lua_type(L, idx) == LuaTypes.LUA_TBOOLEAN; } private bool int64Check(RealStatePtr L, int idx) { return LuaAPI.lua_type(L, idx) == LuaTypes.LUA_TNUMBER || LuaAPI.lua_isint64(L, idx); } private bool uint64Check(RealStatePtr L, int idx) { return LuaAPI.lua_type(L, idx) == LuaTypes.LUA_TNUMBER || LuaAPI.lua_isuint64(L, idx); } private bool luaFunctionCheck(RealStatePtr L, int idx) { return LuaAPI.lua_isnil(L, idx) || LuaAPI.lua_isfunction(L, idx) || (LuaAPI.lua_type(L, idx) == LuaTypes.LUA_TUSERDATA && translator.SafeGetCSObj(L, idx) is LuaFunction); } private bool intptrCheck(RealStatePtr L, int idx) { return LuaAPI.lua_type(L, idx) == LuaTypes.LUA_TLIGHTUSERDATA; } private ObjectCheck genChecker(Type type) { ObjectCheck fixTypeCheck = (RealStatePtr L, int idx) => { if (LuaAPI.lua_type(L, idx) == LuaTypes.LUA_TUSERDATA) { object obj = translator.SafeGetCSObj(L, idx); if (obj != null) { return type.IsAssignableFrom(obj.GetType()); } else { Type type_of_obj = translator.GetTypeOf(L, idx); if (type_of_obj != null) return type.IsAssignableFrom(type_of_obj); } } return false; }; if (!type.IsAbstract() && typeof(Delegate).IsAssignableFrom(type)) { return (RealStatePtr L, int idx) => { return LuaAPI.lua_isnil(L, idx) || LuaAPI.lua_isfunction(L, idx) || fixTypeCheck(L, idx); }; } else if (type.IsEnum()) { return fixTypeCheck; } else if (type.IsInterface()) { return (RealStatePtr L, int idx) => { return LuaAPI.lua_isnil(L, idx) || LuaAPI.lua_istable(L, idx) || fixTypeCheck(L, idx); }; } else { if ((type.IsClass() && type.GetConstructor(System.Type.EmptyTypes) != null)) //class has default construtor { return (RealStatePtr L, int idx) => { return LuaAPI.lua_isnil(L, idx) || LuaAPI.lua_istable(L, idx) || fixTypeCheck(L, idx); }; } else if (type.IsValueType()) { return (RealStatePtr L, int idx) => { return LuaAPI.lua_istable(L, idx) || fixTypeCheck(L, idx); }; } else if (type.IsArray) { return (RealStatePtr L, int idx) => { return LuaAPI.lua_isnil(L, idx) || LuaAPI.lua_istable(L, idx) || fixTypeCheck(L, idx); }; } else { return (RealStatePtr L, int idx) => { return LuaAPI.lua_isnil(L, idx) || fixTypeCheck(L, idx); }; } } } public ObjectCheck genNullableChecker(ObjectCheck oc) { return (RealStatePtr L, int idx) => { return LuaAPI.lua_isnil(L, idx) || oc(L, idx); }; } public ObjectCheck GetChecker(Type type) { if (type.IsByRef) type = type.GetElementType(); Type underlyingType = Nullable.GetUnderlyingType(type); if (underlyingType != null) { return genNullableChecker(GetChecker(underlyingType)); } ObjectCheck oc; if (!checkersMap.TryGetValue(type, out oc)) { oc = genChecker(type); checkersMap.Add(type, oc); } return oc; } } public class ObjectCasters { Dictionary<Type, ObjectCast> castersMap = new Dictionary<Type, ObjectCast>(); ObjectTranslator translator; public ObjectCasters(ObjectTranslator translator) { this.translator = translator; castersMap[typeof(char)] = charCaster; castersMap[typeof(sbyte)] = sbyteCaster; castersMap[typeof(byte)] = byteCaster; castersMap[typeof(short)] = shortCaster; castersMap[typeof(ushort)] = ushortCaster; castersMap[typeof(int)] = intCaster; castersMap[typeof(uint)] = uintCaster; castersMap[typeof(long)] = longCaster; castersMap[typeof(ulong)] = ulongCaster; castersMap[typeof(double)] = getDouble; castersMap[typeof(float)] = floatCaster; castersMap[typeof(decimal)] = decimalCaster; castersMap[typeof(bool)] = getBoolean; castersMap[typeof(string)] = getString; castersMap[typeof(object)] = getObject; castersMap[typeof(byte[])] = getBytes; castersMap[typeof(IntPtr)] = getIntptr; //special type castersMap[typeof(LuaTable)] = getLuaTable; castersMap[typeof(LuaFunction)] = getLuaFunction; } private static object charCaster(RealStatePtr L, int idx, object target) { return (char)LuaAPI.xlua_tointeger(L, idx); } private static object sbyteCaster(RealStatePtr L, int idx, object target) { return (sbyte)LuaAPI.xlua_tointeger(L, idx); } private static object byteCaster(RealStatePtr L, int idx, object target) { return (byte)LuaAPI.xlua_tointeger(L, idx); } private static object shortCaster(RealStatePtr L, int idx, object target) { return (short)LuaAPI.xlua_tointeger(L, idx); } private static object ushortCaster(RealStatePtr L, int idx, object target) { return (ushort)LuaAPI.xlua_tointeger(L, idx); } private static object intCaster(RealStatePtr L, int idx, object target) { return LuaAPI.xlua_tointeger(L, idx); } private static object uintCaster(RealStatePtr L, int idx, object target) { return LuaAPI.xlua_touint(L, idx); } private static object longCaster(RealStatePtr L, int idx, object target) { return LuaAPI.lua_toint64(L, idx); } private static object ulongCaster(RealStatePtr L, int idx, object target) { return LuaAPI.lua_touint64(L, idx); } private static object getDouble(RealStatePtr L, int idx, object target) { return LuaAPI.lua_tonumber(L, idx); } private static object floatCaster(RealStatePtr L, int idx, object target) { return (float)LuaAPI.lua_tonumber(L, idx); } private object decimalCaster(RealStatePtr L, int idx, object target) { decimal ret; translator.Get(L, idx, out ret); return ret; } private static object getBoolean(RealStatePtr L, int idx, object target) { return LuaAPI.lua_toboolean(L, idx); } private static object getString(RealStatePtr L, int idx, object target) { return LuaAPI.lua_tostring(L, idx); } private object getBytes(RealStatePtr L, int idx, object target) { return LuaAPI.lua_type(L, idx) == LuaTypes.LUA_TSTRING ? LuaAPI.lua_tobytes(L, idx) : translator.SafeGetCSObj(L, idx) as byte[]; } private object getIntptr(RealStatePtr L, int idx, object target) { return LuaAPI.lua_touserdata(L, idx); } private object getObject(RealStatePtr L, int idx, object target) { //return translator.getObject(L, idx); //TODO: translator.getObject move to here?? LuaTypes type = (LuaTypes)LuaAPI.lua_type(L, idx); switch (type) { case LuaTypes.LUA_TNUMBER: { if (LuaAPI.lua_isint64(L, idx)) { return LuaAPI.lua_toint64(L, idx); } else if(LuaAPI.lua_isinteger(L, idx)) { return LuaAPI.xlua_tointeger(L, idx); } else { return LuaAPI.lua_tonumber(L, idx); } } case LuaTypes.LUA_TSTRING: { return LuaAPI.lua_tostring(L, idx); } case LuaTypes.LUA_TBOOLEAN: { return LuaAPI.lua_toboolean(L, idx); } case LuaTypes.LUA_TTABLE: { return getLuaTable(L, idx, null); } case LuaTypes.LUA_TFUNCTION: { return getLuaFunction(L, idx, null); } case LuaTypes.LUA_TUSERDATA: { if (LuaAPI.lua_isint64(L, idx)) { return LuaAPI.lua_toint64(L, idx); } else if(LuaAPI.lua_isuint64(L, idx)) { return LuaAPI.lua_touint64(L, idx); } else { object obj = translator.SafeGetCSObj(L, idx); return (obj is RawObject) ? (obj as RawObject).Target : obj; } } default: return null; } } private object getLuaTable(RealStatePtr L, int idx, object target) { if (LuaAPI.lua_type(L, idx) == LuaTypes.LUA_TUSERDATA) { object obj = translator.SafeGetCSObj(L, idx); return (obj != null && obj is LuaTable) ? obj : null; } if (!LuaAPI.lua_istable(L, idx)) { return null; } LuaAPI.lua_pushvalue(L, idx); return new LuaTable(LuaAPI.luaL_ref(L), translator.luaEnv); } private object getLuaFunction(RealStatePtr L, int idx, object target) { if (LuaAPI.lua_type(L, idx) == LuaTypes.LUA_TUSERDATA) { object obj = translator.SafeGetCSObj(L, idx); return (obj != null && obj is LuaFunction) ? obj : null; } if (!LuaAPI.lua_isfunction(L, idx)) { return null; } LuaAPI.lua_pushvalue(L, idx); return new LuaFunction(LuaAPI.luaL_ref(L), translator.luaEnv); } public void AddCaster(Type type, ObjectCast oc) { castersMap[type] = oc; } private ObjectCast genCaster(Type type) { ObjectCast fixTypeGetter = (RealStatePtr L, int idx, object target) => { if (LuaAPI.lua_type(L, idx) == LuaTypes.LUA_TUSERDATA) { object obj = translator.SafeGetCSObj(L, idx); return (obj != null && type.IsAssignableFrom(obj.GetType())) ? obj : null; } return null; }; if (typeof(Delegate).IsAssignableFrom(type)) { return (RealStatePtr L, int idx, object target) => { object obj = fixTypeGetter(L, idx, target); if (obj != null) return obj; if (!LuaAPI.lua_isfunction(L, idx)) { return null; } return translator.CreateDelegateBridge(L, type, idx); }; } else if (typeof(DelegateBridgeBase).IsAssignableFrom(type)) { return (RealStatePtr L, int idx, object target) => { object obj = fixTypeGetter(L, idx, target); if (obj != null) return obj; if (!LuaAPI.lua_isfunction(L, idx)) { return null; } return translator.CreateDelegateBridge(L, null, idx); }; } else if (type.IsInterface()) { return (RealStatePtr L, int idx, object target) => { object obj = fixTypeGetter(L, idx, target); if (obj != null) return obj; if (!LuaAPI.lua_istable(L, idx)) { return null; } return translator.CreateInterfaceBridge(L, type, idx); }; } else if (type.IsEnum()) { return (RealStatePtr L, int idx, object target) => { object obj = fixTypeGetter(L, idx, target); if (obj != null) return obj; LuaTypes lua_type = LuaAPI.lua_type(L, idx); if (lua_type == LuaTypes.LUA_TSTRING) { return Enum.Parse(type, LuaAPI.lua_tostring(L, idx)); } else if (lua_type == LuaTypes.LUA_TNUMBER) { return Enum.ToObject(type, LuaAPI.xlua_tointeger(L, idx)); } throw new InvalidCastException("invalid value for enum " + type); }; } else if (type.IsArray) { return (RealStatePtr L, int idx, object target) => { object obj = fixTypeGetter(L, idx, target); if (obj != null) return obj; if (!LuaAPI.lua_istable(L, idx)) { return null; } uint len = LuaAPI.xlua_objlen(L, idx); int n = LuaAPI.lua_gettop(L); idx = idx > 0 ? idx : LuaAPI.lua_gettop(L) + idx + 1;// abs of index Type et = type.GetElementType(); ObjectCast elementCaster = GetCaster(et); Array ary = target == null ? Array.CreateInstance(et, (int)len) : target as Array; if (!LuaAPI.lua_checkstack(L, 1)) { throw new Exception("stack overflow while cast to Array"); } for (int i = 0; i < len; ++i) { LuaAPI.lua_pushnumber(L, i + 1); LuaAPI.lua_rawget(L, idx); if (et.IsPrimitive()) { if (!StaticLuaCallbacks.TryPrimitiveArraySet(type, L, ary, i, n + 1)) { ary.SetValue(elementCaster(L, n + 1, null), i); } } else { if (InternalGlobals.genTryArraySetPtr == null || !InternalGlobals.genTryArraySetPtr(type, L, translator, ary, i, n + 1)) { ary.SetValue(elementCaster(L, n + 1, null), i); } } LuaAPI.lua_pop(L, 1); } return ary; }; } else if (typeof(IList).IsAssignableFrom(type) && type.IsGenericType()) { Type elementType = type.GetGenericArguments()[0]; ObjectCast elementCaster = GetCaster(elementType); return (RealStatePtr L, int idx, object target) => { object obj = fixTypeGetter(L, idx, target); if (obj != null) return obj; if (!LuaAPI.lua_istable(L, idx)) { return null; } obj = target == null ? Activator.CreateInstance(type) : target; int n = LuaAPI.lua_gettop(L); idx = idx > 0 ? idx : LuaAPI.lua_gettop(L) + idx + 1;// abs of index IList list = obj as IList; uint len = LuaAPI.xlua_objlen(L, idx); if (!LuaAPI.lua_checkstack(L, 1)) { throw new Exception("stack overflow while cast to IList"); } for (int i = 0; i < len; ++i) { LuaAPI.lua_pushnumber(L, i + 1); LuaAPI.lua_rawget(L, idx); if (i < list.Count && target != null) { if (translator.Assignable(L, n + 1, elementType)) { list[i] = elementCaster(L, n + 1, list[i]); ; } } else { if (translator.Assignable(L, n + 1, elementType)) { list.Add(elementCaster(L, n + 1, null)); } } LuaAPI.lua_pop(L, 1); } return obj; }; } else if (typeof(IDictionary).IsAssignableFrom(type) && type.IsGenericType()) { Type keyType = type.GetGenericArguments()[0]; ObjectCast keyCaster = GetCaster(keyType); Type valueType = type.GetGenericArguments()[1]; ObjectCast valueCaster = GetCaster(valueType); return (RealStatePtr L, int idx, object target) => { object obj = fixTypeGetter(L, idx, target); if (obj != null) return obj; if (!LuaAPI.lua_istable(L, idx)) { return null; } IDictionary dic = (target == null ? Activator.CreateInstance(type) : target) as IDictionary; int n = LuaAPI.lua_gettop(L); idx = idx > 0 ? idx : LuaAPI.lua_gettop(L) + idx + 1;// abs of index LuaAPI.lua_pushnil(L); if (!LuaAPI.lua_checkstack(L, 1)) { throw new Exception("stack overflow while cast to IDictionary"); } while (LuaAPI.lua_next(L, idx) != 0) { if (translator.Assignable(L, n + 1, keyType) && translator.Assignable(L, n + 2, valueType)) { object k = keyCaster(L, n + 1, null); dic[k] = valueCaster(L, n + 2, !dic.Contains(k) ? null : dic[k]); } LuaAPI.lua_pop(L, 1); // removes value, keeps key for next iteration } return dic; }; } else if ((type.IsClass() && type.GetConstructor(System.Type.EmptyTypes) != null) || (type.IsValueType() && !type.IsEnum())) //class has default construtor { return (RealStatePtr L, int idx, object target) => { object obj = fixTypeGetter(L, idx, target); if (obj != null) return obj; if (!LuaAPI.lua_istable(L, idx)) { return null; } obj = target == null ? Activator.CreateInstance(type) : target; int n = LuaAPI.lua_gettop(L); idx = idx > 0 ? idx : LuaAPI.lua_gettop(L) + idx + 1;// abs of index if (!LuaAPI.lua_checkstack(L, 1)) { throw new Exception("stack overflow while cast to " + type); } /*foreach (PropertyInfo prop in type.GetProperties()) { var _setMethod = prop.GetSetMethod(); if (_setMethod == null || _setMethod.IsPrivate) { continue; } LuaAPI.xlua_pushasciistring(L, prop.Name); LuaAPI.lua_rawget(L, idx); if (!LuaAPI.lua_isnil(L, -1)) { try { prop.SetValue(obj, GetCaster(prop.PropertyType)(L, n + 1, target == null || prop.PropertyType.IsPrimitive() || prop.PropertyType == typeof(string) ? null : prop.GetValue(obj, null)), null); } catch (Exception e) { throw new Exception("exception in tran " + prop.Name + ", msg=" + e.Message); } } LuaAPI.lua_pop(L, 1); }*/ foreach (FieldInfo field in type.GetFields()) { LuaAPI.xlua_pushasciistring(L, field.Name); LuaAPI.lua_rawget(L, idx); if (!LuaAPI.lua_isnil(L, -1)) { try { field.SetValue(obj, GetCaster(field.FieldType)(L, n + 1, target == null || field.FieldType.IsPrimitive() || field.FieldType == typeof(string) ? null : field.GetValue(obj))); } catch (Exception e) { throw new Exception("exception in tran " + field.Name + ", msg=" + e.Message); } } LuaAPI.lua_pop(L, 1); } return obj; }; } else { return fixTypeGetter; } } ObjectCast genNullableCaster(ObjectCast oc) { return (RealStatePtr L, int idx, object target) => { if (LuaAPI.lua_isnil(L, idx)) { return null; } else { return oc(L, idx, target); } }; } public ObjectCast GetCaster(Type type) { if (type.IsByRef) type = type.GetElementType(); Type underlyingType = Nullable.GetUnderlyingType(type); if (underlyingType != null) { return genNullableCaster(GetCaster(underlyingType)); } ObjectCast oc; if (!castersMap.TryGetValue(type, out oc)) { oc = genCaster(type); castersMap.Add(type, oc); } return oc; } } }
jynew/jyx2/Assets/XLua/Src/ObjectCasters.cs/0
{ "file_path": "jynew/jyx2/Assets/XLua/Src/ObjectCasters.cs", "repo_id": "jynew", "token_count": 16346 }
1,860
fileFormatVersion: 2 guid: d416b4da0b828854c8e997f0c1ae4072 MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData:
jynew/jyx2/Assets/XLua/Src/TemplateEngine/TemplateEngine.cs.meta/0
{ "file_path": "jynew/jyx2/Assets/XLua/Src/TemplateEngine/TemplateEngine.cs.meta", "repo_id": "jynew", "token_count": 72 }
1,861
fileFormatVersion: 2 guid: 1d426a45aa481124aaba409c3a9b3f7b timeCreated: 1455706566 licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/Assets/XLua/Tutorial/LoadLuaScript/ByFile/ByFile.cs.meta/0
{ "file_path": "jynew/jyx2/Assets/XLua/Tutorial/LoadLuaScript/ByFile/ByFile.cs.meta", "repo_id": "jynew", "token_count": 103 }
1,862
-nowarn:0162 -nowarn:0219 -nowarn:0612 -nowarn:0618 -nowarn:0414 -nowarn:0168 -nowarn:0649 -nowarn:0472 -nowarn:0420 -nowarn:0114 -nowarn:0108 -nowarn:1635 -nowarn:0642 -nowarn:0105 -nowarn:0436 -nowarn:0109 -nowarn:3021 -define:HSFRAMEWORK_NET_ABOVE_4_5 -define:UNITASK_ADDRESSABLE_SUPPORT
jynew/jyx2/Assets/csc.rsp/0
{ "file_path": "jynew/jyx2/Assets/csc.rsp", "repo_id": "jynew", "token_count": 154 }
1,863
{ "dependencies": { "com.unity.2d.sprite": "1.0.0", "com.unity.2d.tilemap": "1.0.0", "com.unity.ads": "3.7.5", "com.unity.analytics": "3.6.12", "com.unity.assetbundlebrowser": "https://gitee.com/ookk47oo/AssetBundles-Browser.git", "com.unity.cinemachine": "2.6.11", "com.unity.collab-proxy": "1.15.15", "com.unity.ide.rider": "2.0.7", "com.unity.ide.visualstudio": "2.0.14", "com.unity.ide.vscode": "1.2.5", "com.unity.nuget.newtonsoft-json": "3.0.2", "com.unity.postprocessing": "2.3.0", "com.unity.purchasing": "4.1.3", "com.unity.quicksearch": "2.0.2", "com.unity.sharp-zip-lib": "https://gitee.com/ookk47oo/com.unity.sharp-zip-lib.git", "com.unity.test-framework": "1.1.31", "com.unity.textmeshpro": "3.0.6", "com.unity.timeline": "1.4.8", "com.unity.ugui": "1.0.0", "com.unity.xr.legacyinputhelpers": "2.1.9", "com.yasirkula.simplefilebrowser": "https://gitee.com/ookk47oo/UnitySimpleFileBrowser.git", "com.unity.modules.ai": "1.0.0", "com.unity.modules.androidjni": "1.0.0", "com.unity.modules.animation": "1.0.0", "com.unity.modules.assetbundle": "1.0.0", "com.unity.modules.audio": "1.0.0", "com.unity.modules.cloth": "1.0.0", "com.unity.modules.director": "1.0.0", "com.unity.modules.imageconversion": "1.0.0", "com.unity.modules.imgui": "1.0.0", "com.unity.modules.jsonserialize": "1.0.0", "com.unity.modules.particlesystem": "1.0.0", "com.unity.modules.physics": "1.0.0", "com.unity.modules.physics2d": "1.0.0", "com.unity.modules.screencapture": "1.0.0", "com.unity.modules.terrain": "1.0.0", "com.unity.modules.terrainphysics": "1.0.0", "com.unity.modules.tilemap": "1.0.0", "com.unity.modules.ui": "1.0.0", "com.unity.modules.uielements": "1.0.0", "com.unity.modules.umbra": "1.0.0", "com.unity.modules.unityanalytics": "1.0.0", "com.unity.modules.unitywebrequest": "1.0.0", "com.unity.modules.unitywebrequestassetbundle": "1.0.0", "com.unity.modules.unitywebrequestaudio": "1.0.0", "com.unity.modules.unitywebrequesttexture": "1.0.0", "com.unity.modules.unitywebrequestwww": "1.0.0", "com.unity.modules.vehicles": "1.0.0", "com.unity.modules.video": "1.0.0", "com.unity.modules.vr": "1.0.0", "com.unity.modules.wind": "1.0.0", "com.unity.modules.xr": "1.0.0" } }
jynew/jyx2/Packages/manifest.json/0
{ "file_path": "jynew/jyx2/Packages/manifest.json", "repo_id": "jynew", "token_count": 1178 }
1,864
#import <Foundation/Foundation.h> #import "AntiAddictionAsyncHttp.h" NS_ASSUME_NONNULL_BEGIN extern NSString *ANTI_ADDICTION_HTTP_FINISH_NOTIFICATION; @interface AntiAddictionHttpManager : NSObject @property (nonatomic) NSString *unityVersion; + (NSInteger)httpTaskIndex; + (void)addHttpTask:(AntiAddictionAsyncHttp *)httpTask index:(NSInteger)taskIndex; + (AntiAddictionHttpManager *)shareInstance; @end NS_ASSUME_NONNULL_END
jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Plugins/iOS/AntiAddictionService.framework/Headers/AntiAddictionHttpManager.h/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Plugins/iOS/AntiAddictionService.framework/Headers/AntiAddictionHttpManager.h", "repo_id": "jynew", "token_count": 152 }
1,865
fileFormatVersion: 2 guid: 9541b920bcf404310a5926a8551b7606 DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Plugins/iOS/AntiAddictionService.framework/Modules/AntiAddictionService.swiftmodule/Project/i386-apple-ios-simulator.swiftsourceinfo.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Plugins/iOS/AntiAddictionService.framework/Modules/AntiAddictionService.swiftmodule/Project/i386-apple-ios-simulator.swiftsourceinfo.meta", "repo_id": "jynew", "token_count": 63 }
1,866
fileFormatVersion: 2 guid: c6b95108985ca4fda8587d89178cb7e5 DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Plugins/iOS/AntiAddictionService.framework/Modules/AntiAddictionService.swiftmodule/arm64-apple-ios.swiftinterface.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Plugins/iOS/AntiAddictionService.framework/Modules/AntiAddictionService.swiftmodule/arm64-apple-ios.swiftinterface.meta", "repo_id": "jynew", "token_count": 64 }
1,867
fileFormatVersion: 2 guid: 73b1557efed8848838137e5207581840 DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Plugins/iOS/AntiAddictionService.framework/Modules/AntiAddictionService.swiftmodule/armv7.swiftdoc.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Plugins/iOS/AntiAddictionService.framework/Modules/AntiAddictionService.swiftmodule/armv7.swiftdoc.meta", "repo_id": "jynew", "token_count": 60 }
1,868
fileFormatVersion: 2 guid: a44e6c3872ea24d72bcfc36d342718b4 DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Plugins/iOS/AntiAddictionService.framework/Modules/AntiAddictionService.swiftmodule/i386.swiftmodule.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Plugins/iOS/AntiAddictionService.framework/Modules/AntiAddictionService.swiftmodule/i386.swiftmodule.meta", "repo_id": "jynew", "token_count": 66 }
1,869
fileFormatVersion: 2 guid: 0c7bbb516e0bb401a923f9b83582c421 DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Plugins/iOS/Resource/AntiAdictionResources.bundle/[email protected]/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Plugins/iOS/Resource/AntiAdictionResources.bundle/[email protected]", "repo_id": "jynew", "token_count": 66 }
1,870
{"androidStore":"GooglePlay"}
jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Resources/BillingMode.json/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Resources/BillingMode.json", "repo_id": "jynew", "token_count": 7 }
1,871
fileFormatVersion: 2 guid: 9079365ae0661435c997a6b8b1638f77 PrefabImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Resources/Prefabs/Mobile/TapTapVietnamTimeSelectorPanel.prefab.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Resources/Prefabs/Mobile/TapTapVietnamTimeSelectorPanel.prefab.meta", "repo_id": "jynew", "token_count": 66 }
1,872
fileFormatVersion: 2 guid: 896cc143ca4714b32a9a2ab533f2454d folderAsset: yes DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Script.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Script.meta", "repo_id": "jynew", "token_count": 69 }
1,873
fileFormatVersion: 2 guid: f62dbac404d3c4c479411bf9e6ddb142 MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Script/Internal/Http/AntiAddictionHttpClient.cs.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Script/Internal/Http/AntiAddictionHttpClient.cs.meta", "repo_id": "jynew", "token_count": 95 }
1,874
fileFormatVersion: 2 guid: e83a7bd1d31384ce29a5a6668bb3ffc6 folderAsset: yes DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Script/Model.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Script/Model.meta", "repo_id": "jynew", "token_count": 71 }
1,875
fileFormatVersion: 2 guid: ac32d6e3163d54bcdb468466f8c5b3ae MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Script/Model/StartUpResult.cs.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Script/Model/StartUpResult.cs.meta", "repo_id": "jynew", "token_count": 95 }
1,876
using System; using System.Threading.Tasks; using TapTap.AntiAddiction.Internal; using TapTap.AntiAddiction.Model; using CheckPayResult = Plugins.AntiAddictionUIKit.CheckPayResult; namespace TapTap.AntiAddiction { public sealed class AntiAddictionNewJob : IAntiAddictionJob { private Action<int, string> _externalCallback; public Action<int, string> ExternalCallback { get => _externalCallback; } public int AgeRange { get { if (!Verification.IsVerified) return -1; return Verification.AgeLimit; } } /// <summary> /// 剩余时间(单位:秒) /// </summary> public int RemainingTime { get { if (TapTapAntiAddictionManager.CurrentRemainSeconds == null) return 0; return TapTapAntiAddictionManager.CurrentRemainSeconds.Value; } } public int RemainingTimeInMinutes { get { int seconds = RemainingTime; if (seconds <= 0) return 0; return UnityEngine.Mathf.CeilToInt(seconds / 60.0f); } } public string CurrentToken { get { if (!Verification.IsVerified) return ""; return Verification.GetCurrentToken(); } } public void Init(AntiAddictionConfig config, Action<int, string> callback) { TapTapAntiAddictionManager.Init(config); _externalCallback = callback; } /// <summary> /// Async Method /// </summary> /// <param name="userId"></param> public async void Startup(string userId) { var code = await TapTapAntiAddictionManager.StartUp(userId); // -1 代表因为错误而退出 if (code != StartUpResult.INTERNAL_ERROR) ExternalCallback?.Invoke(code, null); } public void Exit() { TapTapAntiAddictionManager.Logout(); _externalCallback?.Invoke(StartUpResult.EXITED, null); } public void EnterGame() { TapTapAntiAddictionManager.EnterGame(); } public void LeaveGame() { TapTapAntiAddictionManager.LeaveGame(); } public async void CheckPayLimit(long amount, Action<CheckPayResult> handleCheckPayLimit, Action<string> handleCheckPayLimitException) { try { var payResult = await TapTapAntiAddictionManager.CheckPayLimit(amount); handleCheckPayLimit?.Invoke(new CheckPayResult() { // status 为 1 时可以支付 status = payResult.Status ? 1 : 0, title = payResult.Title, description = payResult.Content }); } catch (Exception e) { handleCheckPayLimitException?.Invoke(e.Message); } } public async void SubmitPayResult(long amount, Action handleSubmitPayResult, Action<string> handleSubmitPayResultException) { try { await TapTapAntiAddictionManager.SubmitPayResult(amount); handleSubmitPayResult?.Invoke(); } catch (Exception e) { handleSubmitPayResultException?.Invoke(e.Message); } } public bool isStandalone() { var task = Task.Run(async () => await TapTapAntiAddictionManager.IsStandaloneEnabled()); return task.Result; } public void SetRegion(Region region) { TapTapAntiAddictionManager.SetRegion(region); } } }
jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Script/Wrapper/AntiAddictionNewJob.cs/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/Script/Wrapper/AntiAddictionNewJob.cs", "repo_id": "jynew", "token_count": 2066 }
1,877
fileFormatVersion: 2 guid: e81cbf0b29c9940f391c1324ba667ba7 TextScriptImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/package.json.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/AntiAddiction/package.json.meta", "repo_id": "jynew", "token_count": 65 }
1,878
using System; using System.Collections.Generic; using System.IO; using UnityEngine; namespace TapTap.Common.Editor { public class TapFileHelper : System.IDisposable { private string filePath; public TapFileHelper(string fPath) { filePath = fPath; if (!System.IO.File.Exists(filePath)) { Debug.LogError(filePath + "路径下文件不存在"); return; } } public void WriteBelow(string below, string text) { StreamReader streamReader = new StreamReader(filePath); string all = streamReader.ReadToEnd(); streamReader.Close(); int beginIndex = all.IndexOf(below, StringComparison.Ordinal); if (beginIndex == -1) { Debug.LogError(filePath + "中没有找到字符串" + below); return; } int endIndex = all.LastIndexOf("\n", beginIndex + below.Length, StringComparison.Ordinal); all = all.Substring(0, endIndex) + "\n" + text + "\n" + all.Substring(endIndex); StreamWriter streamWriter = new StreamWriter(filePath); streamWriter.Write(all); streamWriter.Close(); } public void Replace(string below, string newText) { StreamReader streamReader = new StreamReader(filePath); string all = streamReader.ReadToEnd(); streamReader.Close(); int beginIndex = all.IndexOf(below, StringComparison.Ordinal); if (beginIndex == -1) { Debug.LogError(filePath + "中没有找到字符串" + below); return; } all = all.Replace(below, newText); StreamWriter streamWriter = new StreamWriter(filePath); streamWriter.Write(all); streamWriter.Close(); } public void Dispose() { } public static void CopyAndReplaceDirectory(string srcPath, string dstPath) { if (Directory.Exists(dstPath)) Directory.Delete(dstPath, true); if (File.Exists(dstPath)) File.Delete(dstPath); Directory.CreateDirectory(dstPath); foreach (var file in Directory.GetFiles(srcPath)) File.Copy(file, Path.Combine(dstPath, Path.GetFileName(file))); foreach (var dir in Directory.GetDirectories(srcPath)) CopyAndReplaceDirectory(dir, Path.Combine(dstPath, Path.GetFileName(dir))); } public static void DeleteFileBySuffix(string dir, string[] suffix) { if (!Directory.Exists(dir)) { return; } foreach (var file in Directory.GetFiles(dir)) { foreach (var suffixName in suffix) { if (file.Contains(suffixName)) { File.Delete(file); } } } } public static string FilterFileByPrefix(string srcPath, string filterName) { if (!Directory.Exists(srcPath)) { return null; } foreach (var dir in Directory.GetDirectories(srcPath)) { string fileName = Path.GetFileName(dir); if (fileName.StartsWith(filterName)) { return Path.Combine(srcPath, Path.GetFileName(dir)); } } return null; } public static string FilterFileBySuffix(string srcPath, string suffix) { if (!Directory.Exists(srcPath)) { return null; } foreach (var dir in Directory.GetDirectories(srcPath)) { string fileName = Path.GetFileName(dir); if (fileName.StartsWith(suffix)) { return Path.Combine(srcPath, Path.GetFileName(dir)); } } return null; } public static FileInfo RecursionFilterFile(string dir, string fileName) { List<FileInfo> fileInfoList = new List<FileInfo>(); Director(dir, fileInfoList); foreach (FileInfo item in fileInfoList) { if (fileName.Equals(item.Name)) { return item; } } return null; } public static void Director(string dir, List<FileInfo> list) { DirectoryInfo d = new DirectoryInfo(dir); FileInfo[] files = d.GetFiles(); DirectoryInfo[] directs = d.GetDirectories(); foreach (FileInfo f in files) { list.Add(f); } foreach (DirectoryInfo dd in directs) { Director(dd.FullName, list); } } } }
jynew/jyx2/TapSdkFiles/TapTap/Common/Editor/TapFileHelper.cs/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Common/Editor/TapFileHelper.cs", "repo_id": "jynew", "token_count": 2693 }
1,879
{ "zh_hans":{ "network_error_click_retry":"网络异常,点击重试" }, "en":{ "network_error_click_retry":"Network error, click to retry" }, "zh_hant":{ "network_error_click_retry":"網路異常,點擊重試" }, "ja":{ "network_error_click_retry":"ネットワークエラーです。もう一度やり直してください" }, "ko":{ "network_error_click_retry":"네트워크 오류, 다시 시도하기" }, "th":{ "network_error_click_retry":"พบข้อผิดพลาดในการเชื่อมต่อ กรุณาลองอีกครั้ง" }, "id":{ "network_error_click_retry":"Jaringan error. Harap coba lagi." } }
jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/Resource/TapCommonResource.bundle/TapCommonLanguage.json/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/Resource/TapCommonResource.bundle/TapCommonLanguage.json", "repo_id": "jynew", "token_count": 445 }
1,880
fileFormatVersion: 2 guid: 4ef285809644943588a98cc1bad12d80 DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/Resource/TapCommonResource.bundle/images/[email protected]/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/Resource/TapCommonResource.bundle/images/[email protected]", "repo_id": "jynew", "token_count": 61 }
1,881
fileFormatVersion: 2 guid: 678f7cca204504b5dbd4a1b5da388c90 DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/ComponentMessageDelegate.h.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/ComponentMessageDelegate.h.meta", "repo_id": "jynew", "token_count": 66 }
1,882
fileFormatVersion: 2 guid: 7ffa1b9cc3b5c40a7b2955f523576c57 DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/NSError+Ext.h.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/NSError+Ext.h.meta", "repo_id": "jynew", "token_count": 67 }
1,883
fileFormatVersion: 2 guid: 37c827614a375425dbe4840dbb1ad14a DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/PlatformXUA.h.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/PlatformXUA.h.meta", "repo_id": "jynew", "token_count": 63 }
1,884
fileFormatVersion: 2 guid: 828f5c1c8ec4446ff85b28c7d30a86a0 DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeCallback.h.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/TDSBridgeCallback.h.meta", "repo_id": "jynew", "token_count": 68 }
1,885
fileFormatVersion: 2 guid: d6e17d8f308784cf09df2af80b91b1e0 DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonDialogView.h.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/TDSCommonDialogView.h.meta", "repo_id": "jynew", "token_count": 66 }
1,886
fileFormatVersion: 2 guid: 0533d7a95ee3940aa9c753fcf9fa46af DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHandleUrl.h.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/TDSHandleUrl.h.meta", "repo_id": "jynew", "token_count": 64 }
1,887
fileFormatVersion: 2 guid: 08d4c1ff90cd9473da5c7e702ddd2a2e DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLabel.h.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/TDSLabel.h.meta", "repo_id": "jynew", "token_count": 67 }
1,888
fileFormatVersion: 2 guid: 5c45f557e97c046fbbc4fc1f74741098 DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/TDSModelHelper.h.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/TDSModelHelper.h.meta", "repo_id": "jynew", "token_count": 64 }
1,889
fileFormatVersion: 2 guid: 0e60dbe4caea94205b3b0f643797df44 DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/TDSReachability.h.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/TDSReachability.h.meta", "repo_id": "jynew", "token_count": 65 }
1,890
fileFormatVersion: 2 guid: a0b296c5e7fe64bf5a9c9d6ba402c49a DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerEvent.h.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/TDSTrackerEvent.h.meta", "repo_id": "jynew", "token_count": 68 }
1,891
fileFormatVersion: 2 guid: 20dd461312ced4b6e8e56040c4996737 DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebViewJavascriptBridgeBase.h.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/TDSWebViewJavascriptBridgeBase.h.meta", "repo_id": "jynew", "token_count": 63 }
1,892
fileFormatVersion: 2 guid: e301a25443561474bbcb6e150a7514a1 DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/TapConfig.h.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/TapConfig.h.meta", "repo_id": "jynew", "token_count": 63 }
1,893
fileFormatVersion: 2 guid: 99b273fc7e4c54376bd7a36626942911 DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/UserModel.h.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Common/Plugins/iOS/TapCommonSDK.framework/Headers/UserModel.h.meta", "repo_id": "jynew", "token_count": 63 }
1,894
fileFormatVersion: 2 guid: 26890ca09bbde4a6c9cfa1f0ec5c66c5 folderAsset: yes DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/Common/UI.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Common/UI.meta", "repo_id": "jynew", "token_count": 72 }
1,895
// ----------------------------------------------------------------------- // <copyright file="ScrollView.cs" company="AillieoTech"> // Copyright (c) AillieoTech. All rights reserved. // </copyright> // ----------------------------------------------------------------------- namespace TapSDK.UI.AillieoTech { using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Serialization; using UnityEngine.UI; [RequireComponent(typeof(RectTransform))] [DisallowMultipleComponent] public class ScrollView : ScrollRect { [Tooltip("默认item尺寸")] public Vector2 defaultItemSize; [Tooltip("item的模板")] public RectTransform itemTemplate; // 0001 protected const int flagScrollDirection = 1; [SerializeField] [FormerlySerializedAs("m_layoutType")] protected ItemLayoutType layoutType = ItemLayoutType.Vertical; // 只保存4个临界index protected int[] criticalItemIndex = new int[4]; // callbacks for items protected Action<int, RectTransform> updateFunc; protected Func<int, Vector2> itemSizeFunc; protected Func<int> itemCountFunc; protected Func<int, RectTransform> itemGetFunc; protected Action<RectTransform> itemRecycleFunc; private readonly List<ScrollItemWithRect> managedItems = new List<ScrollItemWithRect>(); private Rect refRect; // resource management private SimpleObjPool<RectTransform> itemPool = null; private int dataCount = 0; [Tooltip("初始化时池内item数量")] [SerializeField] private int poolSize; // status private bool initialized = false; private int willUpdateData = 0; private Vector3[] viewWorldConers = new Vector3[4]; private Vector3[] rectCorners = new Vector3[2]; // for hide and show public enum ItemLayoutType { // 最后一位表示滚动方向 Vertical = 0b0001, // 0001 Horizontal = 0b0010, // 0010 VerticalThenHorizontal = 0b0100, // 0100 HorizontalThenVertical = 0b0101, // 0101 } public virtual void SetUpdateFunc(Action<int, RectTransform> func) { this.updateFunc = func; } public virtual void SetItemSizeFunc(Func<int, Vector2> func) { this.itemSizeFunc = func; } public virtual void SetItemCountFunc(Func<int> func) { this.itemCountFunc = func; } public void SetItemGetAndRecycleFunc(Func<int, RectTransform> getFunc, Action<RectTransform> recycleFunc) { if (getFunc != null && recycleFunc != null) { this.itemGetFunc = getFunc; this.itemRecycleFunc = recycleFunc; } else { this.itemGetFunc = null; this.itemRecycleFunc = null; } } public void ResetAllDelegates() { this.SetUpdateFunc(null); this.SetItemSizeFunc(null); this.SetItemCountFunc(null); this.SetItemGetAndRecycleFunc(null, null); } public void UpdateData(bool immediately = true) { if (immediately) { this.willUpdateData |= 3; // 0011 this.InternalUpdateData(); } else { if (this.willUpdateData == 0 && this.IsActive()) { this.StartCoroutine(this.DelayUpdateData()); } this.willUpdateData |= 3; } } public void UpdateDataIncrementally(bool immediately = true) { if (immediately) { this.willUpdateData |= 1; // 0001 this.InternalUpdateData(); } else { if (this.willUpdateData == 0) { this.StartCoroutine(this.DelayUpdateData()); } this.willUpdateData |= 1; } } public void ScrollTo(int index) { this.InternalScrollTo(index); } protected override void OnEnable() { base.OnEnable(); if (this.willUpdateData != 0) { this.StartCoroutine(this.DelayUpdateData()); } } protected override void OnDisable() { this.initialized = false; base.OnDisable(); } protected virtual void InternalScrollTo(int index) { index = Mathf.Clamp(index, 0, this.dataCount - 1); this.EnsureItemRect(index); Rect r = this.managedItems[index].rect; var dir = (int)this.layoutType & flagScrollDirection; if (dir == 1) { // vertical var value = 1 - (-r.yMax / (this.content.sizeDelta.y - this.refRect.height)); this.SetNormalizedPosition(value, 1); } else { // horizontal var value = r.xMin / (this.content.sizeDelta.x - this.refRect.width); this.SetNormalizedPosition(value, 0); } } protected override void SetContentAnchoredPosition(Vector2 position) { base.SetContentAnchoredPosition(position); this.UpdateCriticalItems(); } protected override void SetNormalizedPosition(float value, int axis) { base.SetNormalizedPosition(value, axis); this.ResetCriticalItems(); } protected void EnsureItemRect(int index) { if (!this.managedItems[index].rectDirty) { // 已经是干净的了 return; } ScrollItemWithRect firstItem = this.managedItems[0]; if (firstItem.rectDirty) { Vector2 firstSize = this.GetItemSize(0); firstItem.rect = CreateWithLeftTopAndSize(Vector2.zero, firstSize); firstItem.rectDirty = false; } // 当前item之前的最近的已更新的rect var nearestClean = 0; for (var i = index; i >= 0; --i) { if (!this.managedItems[i].rectDirty) { nearestClean = i; break; } } // 需要更新 从 nearestClean 到 index 的尺寸 Rect nearestCleanRect = this.managedItems[nearestClean].rect; Vector2 curPos = GetLeftTop(nearestCleanRect); Vector2 size = nearestCleanRect.size; this.MovePos(ref curPos, size); for (var i = nearestClean + 1; i <= index; i++) { size = this.GetItemSize(i); this.managedItems[i].rect = CreateWithLeftTopAndSize(curPos, size); this.managedItems[i].rectDirty = false; this.MovePos(ref curPos, size); } var range = new Vector2(Mathf.Abs(curPos.x), Mathf.Abs(curPos.y)); switch (this.layoutType) { case ItemLayoutType.VerticalThenHorizontal: range.x += size.x; range.y = this.refRect.height; break; case ItemLayoutType.HorizontalThenVertical: range.x = this.refRect.width; if (curPos.x != 0) { range.y += size.y; } break; default: break; } this.content.sizeDelta = range; } protected override void OnDestroy() { if (this.itemPool != null) { this.itemPool.Purge(); } } protected Rect GetItemLocalRect(int index) { if (index >= 0 && index < this.dataCount) { this.EnsureItemRect(index); return this.managedItems[index].rect; } return (Rect)default; } #if UNITY_EDITOR protected override void OnValidate() { var dir = (int)this.layoutType & flagScrollDirection; if (dir == 1) { // vertical if (this.horizontalScrollbar != null) { this.horizontalScrollbar.gameObject.SetActive(false); this.horizontalScrollbar = null; } } else { // horizontal if (this.verticalScrollbar != null) { this.verticalScrollbar.gameObject.SetActive(false); this.verticalScrollbar = null; } } base.OnValidate(); } #endif private static Vector2 GetLeftTop(Rect rect) { Vector2 ret = rect.position; ret.y += rect.size.y; return ret; } private static Rect CreateWithLeftTopAndSize(Vector2 leftTop, Vector2 size) { Vector2 leftBottom = leftTop - new Vector2(0, size.y); return new Rect(leftBottom, size); } private IEnumerator DelayUpdateData() { yield return new WaitForEndOfFrame(); this.InternalUpdateData(); } private void InternalUpdateData() { if (!this.IsActive()) { this.willUpdateData |= 3; return; } if (!this.initialized) { this.InitScrollView(); } var newDataCount = 0; var keepOldItems = (this.willUpdateData & 2) == 0; if (this.itemCountFunc != null) { newDataCount = this.itemCountFunc(); } if (newDataCount != this.managedItems.Count) { if (this.managedItems.Count < newDataCount) { // 增加 if (!keepOldItems) { foreach (var itemWithRect in this.managedItems) { // 重置所有rect itemWithRect.rectDirty = true; } } while (this.managedItems.Count < newDataCount) { this.managedItems.Add(new ScrollItemWithRect()); } } else { // 减少 保留空位 避免GC for (int i = 0, count = this.managedItems.Count; i < count; ++i) { if (i < newDataCount) { // 重置所有rect if (!keepOldItems) { this.managedItems[i].rectDirty = true; } if (i == newDataCount - 1) { this.managedItems[i].rectDirty = true; } } // 超出部分 清理回收item if (i >= newDataCount) { this.managedItems[i].rectDirty = true; if (this.managedItems[i].item != null) { this.RecycleOldItem(this.managedItems[i].item); this.managedItems[i].item = null; } } } } } else { if (!keepOldItems) { for (int i = 0, count = this.managedItems.Count; i < count; ++i) { // 重置所有rect this.managedItems[i].rectDirty = true; } } } this.dataCount = newDataCount; this.ResetCriticalItems(); this.willUpdateData = 0; } private void ResetCriticalItems() { bool hasItem, shouldShow; int firstIndex = -1, lastIndex = -1; for (var i = 0; i < this.dataCount; i++) { hasItem = this.managedItems[i].item != null; shouldShow = this.ShouldItemSeenAtIndex(i); if (shouldShow) { if (firstIndex == -1) { firstIndex = i; } lastIndex = i; } if (hasItem && shouldShow) { // 应显示且已显示 this.SetDataForItemAtIndex(this.managedItems[i].item, i); continue; } if (hasItem == shouldShow) { // 不应显示且未显示 // if (firstIndex != -1) // { // // 已经遍历完所有要显示的了 后边的先跳过 // break; // } continue; } if (hasItem && !shouldShow) { // 不该显示 但是有 this.RecycleOldItem(this.managedItems[i].item); this.managedItems[i].item = null; continue; } if (shouldShow && !hasItem) { // 需要显示 但是没有 RectTransform item = this.GetNewItem(i); this.OnGetItemForDataIndex(item, i); this.managedItems[i].item = item; continue; } } // content.localPosition = Vector2.zero; this.criticalItemIndex[CriticalItemType.UpToHide] = firstIndex; this.criticalItemIndex[CriticalItemType.DownToHide] = lastIndex; this.criticalItemIndex[CriticalItemType.UpToShow] = Mathf.Max(firstIndex - 1, 0); this.criticalItemIndex[CriticalItemType.DownToShow] = Mathf.Min(lastIndex + 1, this.dataCount - 1); } private RectTransform GetCriticalItem(int type) { var index = this.criticalItemIndex[type]; if (index >= 0 && index < this.dataCount) { return this.managedItems[index].item; } return null; } private void UpdateCriticalItems() { var dirty = true; while (dirty) { dirty = false; for (int i = CriticalItemType.UpToHide; i <= CriticalItemType.DownToShow; i++) { if (i <= CriticalItemType.DownToHide) { // 隐藏离开可见区域的item dirty = dirty || this.CheckAndHideItem(i); } else { // 显示进入可见区域的item dirty = dirty || this.CheckAndShowItem(i); } } } } private bool CheckAndHideItem(int criticalItemType) { RectTransform item = this.GetCriticalItem(criticalItemType); var criticalIndex = this.criticalItemIndex[criticalItemType]; if (item != null && !this.ShouldItemSeenAtIndex(criticalIndex)) { this.RecycleOldItem(item); this.managedItems[criticalIndex].item = null; if (criticalItemType == CriticalItemType.UpToHide) { // 最上隐藏了一个 this.criticalItemIndex[criticalItemType + 2] = Mathf.Max(criticalIndex, this.criticalItemIndex[criticalItemType + 2]); this.criticalItemIndex[criticalItemType]++; } else { // 最下隐藏了一个 this.criticalItemIndex[criticalItemType + 2] = Mathf.Min(criticalIndex, this.criticalItemIndex[criticalItemType + 2]); this.criticalItemIndex[criticalItemType]--; } this.criticalItemIndex[criticalItemType] = Mathf.Clamp(this.criticalItemIndex[criticalItemType], 0, this.dataCount - 1); if (this.criticalItemIndex[CriticalItemType.UpToHide] > this.criticalItemIndex[CriticalItemType.DownToHide]) { // 偶然的情况 拖拽超出一屏 this.ResetCriticalItems(); return false; } return true; } return false; } private bool CheckAndShowItem(int criticalItemType) { RectTransform item = this.GetCriticalItem(criticalItemType); var criticalIndex = this.criticalItemIndex[criticalItemType]; if (item == null && this.ShouldItemSeenAtIndex(criticalIndex)) { RectTransform newItem = this.GetNewItem(criticalIndex); this.OnGetItemForDataIndex(newItem, criticalIndex); this.managedItems[criticalIndex].item = newItem; if (criticalItemType == CriticalItemType.UpToShow) { // 最上显示了一个 this.criticalItemIndex[criticalItemType - 2] = Mathf.Min(criticalIndex, this.criticalItemIndex[criticalItemType - 2]); this.criticalItemIndex[criticalItemType]--; } else { // 最下显示了一个 this.criticalItemIndex[criticalItemType - 2] = Mathf.Max(criticalIndex, this.criticalItemIndex[criticalItemType - 2]); this.criticalItemIndex[criticalItemType]++; } this.criticalItemIndex[criticalItemType] = Mathf.Clamp(this.criticalItemIndex[criticalItemType], 0, this.dataCount - 1); if (this.criticalItemIndex[CriticalItemType.UpToShow] >= this.criticalItemIndex[CriticalItemType.DownToShow]) { // 偶然的情况 拖拽超出一屏 this.ResetCriticalItems(); return false; } return true; } return false; } private bool ShouldItemSeenAtIndex(int index) { if (index < 0 || index >= this.dataCount) { return false; } this.EnsureItemRect(index); return new Rect(this.refRect.position - this.content.anchoredPosition, this.refRect.size).Overlaps(this.managedItems[index].rect); } private bool ShouldItemFullySeenAtIndex(int index) { if (index < 0 || index >= this.dataCount) { return false; } this.EnsureItemRect(index); return this.IsRectContains(new Rect(this.refRect.position - this.content.anchoredPosition, this.refRect.size), this.managedItems[index].rect); } private bool IsRectContains(Rect outRect, Rect inRect, bool bothDimensions = false) { if (bothDimensions) { var xContains = (outRect.xMax >= inRect.xMax) && (outRect.xMin <= inRect.xMin); var yContains = (outRect.yMax >= inRect.yMax) && (outRect.yMin <= inRect.yMin); return xContains && yContains; } else { var dir = (int)this.layoutType & flagScrollDirection; if (dir == 1) { // 垂直滚动 只计算y向 return (outRect.yMax >= inRect.yMax) && (outRect.yMin <= inRect.yMin); } else { // = 0 // 水平滚动 只计算x向 return (outRect.xMax >= inRect.xMax) && (outRect.xMin <= inRect.xMin); } } } private void InitPool() { var poolNode = new GameObject("POOL"); poolNode.SetActive(false); poolNode.transform.SetParent(this.transform, false); this.itemPool = new SimpleObjPool<RectTransform>( this.poolSize, (RectTransform item) => { item.transform.SetParent(poolNode.transform, false); }, () => { GameObject itemObj = Instantiate(this.itemTemplate.gameObject); RectTransform item = itemObj.GetComponent<RectTransform>(); itemObj.transform.SetParent(poolNode.transform, false); item.anchorMin = Vector2.up; item.anchorMax = Vector2.up; item.pivot = Vector2.zero; itemObj.SetActive(true); return item; }); } private void OnGetItemForDataIndex(RectTransform item, int index) { this.SetDataForItemAtIndex(item, index); item.transform.SetParent(this.content, false); } private void SetDataForItemAtIndex(RectTransform item, int index) { if (this.updateFunc != null) { this.updateFunc(index, item); } this.SetPosForItemAtIndex(item, index); } private void SetPosForItemAtIndex(RectTransform item, int index) { this.EnsureItemRect(index); Rect r = this.managedItems[index].rect; item.localPosition = r.position; item.sizeDelta = r.size; } private Vector2 GetItemSize(int index) { if (index >= 0 && index <= this.dataCount) { if (this.itemSizeFunc != null) { return this.itemSizeFunc(index); } } return this.defaultItemSize; } private RectTransform GetNewItem(int index) { RectTransform item; if (this.itemGetFunc != null) { item = this.itemGetFunc(index); } else { item = this.itemPool.Get(); } return item; } private void RecycleOldItem(RectTransform item) { if (this.itemRecycleFunc != null) { this.itemRecycleFunc(item); } else { this.itemPool.Recycle(item); } } private void InitScrollView() { this.initialized = true; // 根据设置来控制原ScrollRect的滚动方向 var dir = (int)this.layoutType & flagScrollDirection; this.vertical = dir == 1; this.horizontal = dir == 0; this.content.pivot = Vector2.up; this.content.anchorMin = Vector2.up; this.content.anchorMax = Vector2.up; this.content.anchoredPosition = Vector2.zero; this.InitPool(); this.UpdateRefRect(); } // refRect是在Content节点下的 viewport的 rect private void UpdateRefRect() { /* * WorldCorners * * 1 ------- 2 * | | * | | * 0 ------- 3 * */ if (!CanvasUpdateRegistry.IsRebuildingLayout()) { Canvas.ForceUpdateCanvases(); } this.viewRect.GetWorldCorners(this.viewWorldConers); this.rectCorners[0] = this.content.transform.InverseTransformPoint(this.viewWorldConers[0]); this.rectCorners[1] = this.content.transform.InverseTransformPoint(this.viewWorldConers[2]); this.refRect = new Rect((Vector2)this.rectCorners[0] - this.content.anchoredPosition, this.rectCorners[1] - this.rectCorners[0]); } private void MovePos(ref Vector2 pos, Vector2 size) { // 注意 所有的rect都是左下角为基准 switch (this.layoutType) { case ItemLayoutType.Vertical: // 垂直方向 向下移动 pos.y -= size.y; break; case ItemLayoutType.Horizontal: // 水平方向 向右移动 pos.x += size.x; break; case ItemLayoutType.VerticalThenHorizontal: pos.y -= size.y; if (pos.y <= -this.refRect.height) { pos.y = 0; pos.x += size.x; } break; case ItemLayoutType.HorizontalThenVertical: pos.x += size.x; if (pos.x >= this.refRect.width) { pos.x = 0; pos.y -= size.y; } break; default: break; } } // const int 代替 enum 减少 (int)和(CriticalItemType)转换 protected static class CriticalItemType { public static byte UpToHide = 0; public static byte DownToHide = 1; public static byte UpToShow = 2; public static byte DownToShow = 3; } private class ScrollItemWithRect { // scroll item 身上的 RectTransform组件 public RectTransform item; // scroll item 在scrollview中的位置 public Rect rect; // rect 是否需要更新 public bool rectDirty = true; } } }
jynew/jyx2/TapSdkFiles/TapTap/Common/UI/Scripts/ScrollViewEx/ScrollView/ScrollView.cs/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Common/UI/Scripts/ScrollViewEx/ScrollView/ScrollView.cs", "repo_id": "jynew", "token_count": 15242 }
1,896
# ChangeLog ## 3.13.0 ### Fixed Bugs - Android & iOS: 支持新的 scope (basic_info & email) - Android: 修复一些情况下的错误崩溃 - iOS: 支持更安全的有端授权协议 ## 3.11.1 ### Fixed Bugs - iOS: 修复登录模块对系统 URL 回调的使用方式 ### Dependencies - TapTap.Common v3.11.1 ## 3.11.0 ### Dependencies - TapTap.Common v3.11.0 ## 3.10.0 ### Dependencies - TapTap.Common v3.10.0 ## 3.9.0 ### Dependencies - TapTap.Common v3.9.0 ## 3.8.0 ### Dependencies - TapTap.Common v3.8.0 ## 3.7.1 ### Dependencies - TapTap.Common v3.7.1 ## 3.7.0 ### Optimization and fixed bugs - 添加获取互关列表接口 ### Dependencies - TapTap.Common v3.7.0 ## 3.6.3 ### Optimization and fixed bugs - Android 尝试修复静态变量丢失的问题 ### Dependencies - TapTap.Common v3.6.3 ## 3.6.1 ### Optimization and fixed bugs - UI 优化 ### Dependencies - TapTap.Common v3.6.1 ## 3.6.0 ### Optimization and fixed bugs - 优化未安装 iOS Support 时 Editor 编译问题 ### Dependencies - TapTap.Common v3.6.0 ## 3.5.2 ### New Feature - 新增 PC Web 授权登录 ### Dependencies - TapTap.Common v3.5.2 ## 3.5.0 ### Optimization and fixed bugs - 内嵌 web 登录页面支持异形刘海屏的正常展示 ### Dependencies - TapTap.Common v3.5.0 ## 3.4.0 ### Dependencies - TapTap.Common v3.4.0 ## 3.3.0 ### Optimization and fixed bugs - 优化 iOS Plist.info 修改方式,防止覆盖工程原有配置。 ### Dependencies - TapTap.Common v3.3.0 ## 3.2.1 ### New Feature - 新增 TapTap 登录权限配置范围 ### Dependencies - TapTap.Common v3.2.0 ## 3.2.0 ### New Feature - 支持 PC 端使用 TapTap 登录 ### Dependencies - TapTap.Common v3.2.0 ## 3.1.0 ### Dependencies - TapTap.Common v3.1.0 ## 3.0.0 ### New Feature - 新增 TapTap OAuth 相关接口 ``` // 登陆 TapLogin.Login(); // 登出 TapLogin.Logout(); ``` - 新增篝火测试资格 ``` var boolean = await TapLogin.GetTestQualification(); ``` ### Dependencies - TapTap.Common v3.0.0 ## 2.1.7 ### Optimization - 更新 iOS 拦截 openUrl 方式 ### Dependencies - TapTap.Common v2.1.7 ### 2.1.6 ### Optimization and fixed bugs - 修复 TapTap 授权登录的一些 UI 问题 ### Dependencies - TapTap.Common v2.1.6 ### 2.1.5 ### New Feature - 云玩内唤起 TapTap 客户端登陆 ### 2.1.4 ### Dependencies - TapTap.Common v2.1.4 ### 2.1.3 ### Dependencies - TapTap.Common v2.1.3 ### 2.1.2 ### Dependencies - TapTap.Common v2.1.2 ## 2.1.1 ### Dependencies - TapTap.Common v2.1.1 ## 2.0.0 ### Feature * TapTap Login
jynew/jyx2/TapSdkFiles/TapTap/Login/CHANGELOG.md/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Login/CHANGELOG.md", "repo_id": "jynew", "token_count": 1345 }
1,897
// // TTSDKProfile.h // TapTapSDK // // Created by TapTap on 2017/10/27. // Copyright © 2017年 易玩. All rights reserved. // #import <Foundation/Foundation.h> /** * @brief TapTap用户信息封装类 * * 该类封装了所有用户信息提供的返回数据 */ @interface TTSDKProfile : NSObject /// 用户名 @property (nonatomic, readonly, strong) NSString *name; /// 用户头像 @property (nonatomic, readonly, strong) NSString *avatar; /// open id @property (nonatomic, readonly, strong) NSString *openid; /// union id @property (nonatomic, readonly, strong) NSString *unionid; @property (nonatomic, readonly, strong) NSString *email; @property (nonatomic, readonly, assign, getter = isEmailVerified) BOOL emailVerified; - (instancetype)initWithJSON:(NSDictionary *)json; /** * @brief 获取当前用户信息 * * 该用户信息会优先读取本地缓存,不存在时将会返回nil */ + (TTSDKProfile *)currentProfile; + (void)fetchProfileForCurrentAccessToken:(void (^)(TTSDKProfile *profile, NSError *error))handler; - (NSString *)toJsonString; @end
jynew/jyx2/TapSdkFiles/TapTap/Login/Plugins/iOS/TapLoginSDK.framework/Headers/TTSDKProfile.h/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Login/Plugins/iOS/TapLoginSDK.framework/Headers/TTSDKProfile.h", "repo_id": "jynew", "token_count": 462 }
1,898
fileFormatVersion: 2 guid: bd988c6c77a3e4863aed0ffc56c7bb3c DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
jynew/jyx2/TapSdkFiles/TapTap/Login/Plugins/iOS/TapLoginSDK.framework/TapLoginSDK.meta/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Login/Plugins/iOS/TapLoginSDK.framework/TapLoginSDK.meta", "repo_id": "jynew", "token_count": 68 }
1,899
{ "name": "com.taptap.tds.login", "displayName": "TapTap Login", "description": "TapTap Develop Service", "version": "3.16.5", "unity": "2018.3", "license": "MIT", "dependencies": { "com.taptap.tds.common": "https://github.com/TapTap/TapCommon-Unity.git#3.16.5" } }
jynew/jyx2/TapSdkFiles/TapTap/Login/package.json/0
{ "file_path": "jynew/jyx2/TapSdkFiles/TapTap/Login/package.json", "repo_id": "jynew", "token_count": 122 }
1,900
pytest_gpu: name: Pytest GPU agent: type: Unity::VM::GPU image: ml-agents/ml-agents-ubuntu-18.04:latest flavor: b1.large commands: - | eval "$($HOME/anaconda/bin/conda shell.bash hook)" conda activate python3.10 python3 -m pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple python3 -u -m ml-agents.tests.yamato.setup_venv python3 -m pip install --progress-bar=off -r test_requirements.txt --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple python3 -m pip install torch==2.2.1+cu118 --index-url https://download.pytorch.org/whl/cu118 if python -c "exec('import torch \nif not torch.cuda.is_available(): raise')" &> /dev/null; then echo 'all good' else echo 'cuda device not available!' exit 1 fi python3 -m pytest -m "not slow" --junitxml=junit/test-results.xml -p no:warnings triggers: cancel_old_ci: true expression: | (push.branch eq "main" OR push.branch eq "develop" OR push.branch match "release.+") AND push.changes.any match "ml-agents/**" AND NOT push.changes.all match "**/*.md" artifacts: logs: paths: - "artifacts/standalone_build.txt"
ml-agents/.yamato/pytest-gpu.yml/0
{ "file_path": "ml-agents/.yamato/pytest-gpu.yml", "repo_id": "ml-agents", "token_count": 560 }
1,901
using System; using System.IO; using System.Linq; using System.Reflection; using NUnit.Framework; using UnityEditor; using UnityEngine; using Unity.MLAgents; using Unity.MLAgents.Editor; namespace MLAgentsExamples.Tests.Settings { [TestFixture] public class MLAgentsSettingsTests { string EditorBuildSettingsConfigKey = MLAgentsSettingsManager.EditorBuildSettingsConfigKey; string tempSettingsRootPath = "Assets/ML-Agents/Scripts/Tests/Editor/MLAgentsSettings"; MLAgentsSettings storedConfigObject; [SetUp] public void SetUp() { if (EditorBuildSettings.TryGetConfigObject(EditorBuildSettingsConfigKey, out MLAgentsSettings settingsAsset)) { if (settingsAsset != null) { storedConfigObject = settingsAsset; EditorBuildSettings.RemoveConfigObject(EditorBuildSettingsConfigKey); } } MLAgentsSettingsManager.Destroy(); ClearSettingsAssets(); } [TearDown] public void TearDown() { if (storedConfigObject != null) { EditorBuildSettings.AddConfigObject(EditorBuildSettingsConfigKey, storedConfigObject, true); storedConfigObject = null; } MLAgentsSettingsManager.Destroy(); ClearSettingsAssets(); } internal void ClearSettingsAssets() { var assetsGuids = AssetDatabase.FindAssets("t:MLAgentsSettings", new string[] { tempSettingsRootPath }); foreach (var guid in assetsGuids) { var path = AssetDatabase.GUIDToAssetPath(guid); AssetDatabase.DeleteAsset(path); } } [Test] public void TestMLAgentsSettingsManager() { Assert.AreNotEqual(null, MLAgentsSettingsManager.Settings); Assert.AreEqual(5004, MLAgentsSettingsManager.Settings.EditorPort); // default port MLAgentsSettingsManager.Settings.EditorPort = 6000; Assert.AreEqual(6000, MLAgentsSettingsManager.Settings.EditorPort); var settingsObject = ScriptableObject.CreateInstance<MLAgentsSettings>(); settingsObject.EditorPort = 7000; var tempSettingsAssetPath = tempSettingsRootPath + "/test.mlagents.settings.asset"; AssetDatabase.CreateAsset(settingsObject, tempSettingsAssetPath); EditorBuildSettings.AddConfigObject(EditorBuildSettingsConfigKey, settingsObject, true); // destroy manager instantiated as a side effect by accessing MLAgentsSettings directly without manager MLAgentsSettingsManager.Destroy(); Assert.AreEqual(7000, MLAgentsSettingsManager.Settings.EditorPort); } // A mock class that can invoke private methods/fields in MLAgentsSettingsProvider internal class MockSettingsProvider { public MLAgentsSettingsProvider Instance { get { return (MLAgentsSettingsProvider)typeof(MLAgentsSettingsProvider).GetField("s_Instance", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null); } } public MLAgentsSettings Settings { get { return (MLAgentsSettings)typeof(MLAgentsSettingsProvider).GetField("m_Settings", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(Instance); } } public void CreateMLAgentsSettingsProvider() { MLAgentsSettingsProvider.CreateMLAgentsSettingsProvider(); } public void Reinitialize() { var method = typeof(MLAgentsSettingsProvider).GetMethod("Reinitialize", BindingFlags.Instance | BindingFlags.NonPublic); method.Invoke(Instance, null); } public string[] FindSettingsInProject() { var method = typeof(MLAgentsSettingsProvider).GetMethod("FindSettingsInProject", BindingFlags.Static | BindingFlags.NonPublic); return (string[])method.Invoke(null, null); } public void CreateNewSettingsAsset(string relativePath) { var method = typeof(MLAgentsSettingsProvider).GetMethod("CreateNewSettingsAsset", BindingFlags.Static | BindingFlags.NonPublic); method.Invoke(null, new object[] { relativePath }); } } [Test] public void TestMLAgentsSettingsProviderCreateAsset() { var mockProvider = new MockSettingsProvider(); mockProvider.CreateMLAgentsSettingsProvider(); Assert.AreNotEqual(null, mockProvider.Instance); // mimic MLAgentsSettingsProvider.OnActivate() MLAgentsSettingsManager.OnSettingsChange += mockProvider.Reinitialize; mockProvider.Instance.InitializeWithCurrentSettings(); Assert.AreEqual(0, mockProvider.FindSettingsInProject().Length); var tempSettingsAssetPath1 = tempSettingsRootPath + "/test.mlagents.settings.asset"; mockProvider.CreateNewSettingsAsset(tempSettingsAssetPath1); Assert.AreEqual(1, mockProvider.FindSettingsInProject().Length); Assert.AreEqual(5004, mockProvider.Settings.EditorPort); MLAgentsSettingsManager.Settings.EditorPort = 6000; // change to something not default // callback should update the field in provider Assert.AreEqual(6000, mockProvider.Settings.EditorPort); var tempSettingsAssetPath2 = tempSettingsRootPath + "/test2.mlagents.settings.asset"; mockProvider.CreateNewSettingsAsset(tempSettingsAssetPath2); Assert.AreEqual(2, mockProvider.FindSettingsInProject().Length); // manager should set to the new (default) one, not the previous modified one Assert.AreEqual(5004, MLAgentsSettingsManager.Settings.EditorPort); // mimic MLAgentsSettingsProvider.OnDeactivate() MLAgentsSettingsManager.OnSettingsChange -= mockProvider.Reinitialize; mockProvider.Instance.Dispose(); } [Test] public void TestMLAgentsSettingsProviderLoadAsset() { var mockProvider = new MockSettingsProvider(); var tempSettingsAssetPath1 = tempSettingsRootPath + "/test.mlagents.settings.asset"; mockProvider.CreateNewSettingsAsset(tempSettingsAssetPath1); MLAgentsSettingsManager.Settings.EditorPort = 8000; // change to something not default mockProvider.Instance?.Dispose(); MLAgentsSettingsManager.Destroy(); mockProvider.CreateMLAgentsSettingsProvider(); Assert.AreEqual(8000, MLAgentsSettingsManager.Settings.EditorPort); } } }
ml-agents/DevProject/Assets/ML-Agents/Scripts/Tests/Editor/MLAgentsSettings/MLAgentsSettingsTests.cs/0
{ "file_path": "ml-agents/DevProject/Assets/ML-Agents/Scripts/Tests/Editor/MLAgentsSettings/MLAgentsSettingsTests.cs", "repo_id": "ml-agents", "token_count": 3045 }
1,902
{ "dependencies": { "com.unity.ai.navigation": { "version": "2.0.0", "depth": 0, "source": "registry", "dependencies": { "com.unity.modules.ai": "1.0.0" }, "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" }, "com.unity.burst": { "version": "1.8.12", "depth": 2, "source": "registry", "dependencies": { "com.unity.mathematics": "1.2.1", "com.unity.modules.jsonserialize": "1.0.0" }, "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" }, "com.unity.coding": { "version": "0.1.0-preview.13", "depth": 0, "source": "registry", "dependencies": { "nuget.moq": "1.0.0" }, "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" }, "com.unity.ext.nunit": { "version": "2.0.5", "depth": 1, "source": "registry", "dependencies": {}, "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" }, "com.unity.inputsystem": { "version": "1.7.0", "depth": 0, "source": "registry", "dependencies": { "com.unity.modules.uielements": "1.0.0" }, "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" }, "com.unity.mathematics": { "version": "1.2.6", "depth": 3, "source": "registry", "dependencies": {}, "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" }, "com.unity.ml-agents": { "version": "file:../../com.unity.ml-agents", "depth": 0, "source": "local", "dependencies": { "com.unity.sentis": "1.3.0-pre.3", "com.unity.modules.imageconversion": "1.0.0", "com.unity.modules.jsonserialize": "1.0.0", "com.unity.modules.physics": "1.0.0" } }, "com.unity.ml-agents.extensions": { "version": "file:../../com.unity.ml-agents.extensions", "depth": 0, "source": "local", "dependencies": { "com.unity.ml-agents": "3.0.0-exp.1", "com.unity.modules.physics": "1.0.0" } }, "com.unity.nuget.mono-cecil": { "version": "1.11.4", "depth": 1, "source": "registry", "dependencies": {}, "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" }, "com.unity.nuget.newtonsoft-json": { "version": "3.2.1", "depth": 1, "source": "registry", "dependencies": {}, "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" }, "com.unity.package-manager-doctools": { "version": "3.0.0-preview", "depth": 0, "source": "registry", "dependencies": { "com.unity.package-validation-suite": "0.57.0-preview", "com.unity.nuget.newtonsoft-json": "2.0.0-preview", "com.unity.sharp-zip-lib": "1.2.2-preview" }, "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" }, "com.unity.package-validation-suite": { "version": "0.59.0-preview", "depth": 0, "source": "registry", "dependencies": { "com.unity.nuget.mono-cecil": "0.1.6-preview.2" }, "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" }, "com.unity.sentis": { "version": "1.3.0-pre.3", "depth": 1, "source": "registry", "dependencies": { "com.unity.burst": "1.8.10", "com.unity.modules.jsonserialize": "1.0.0", "com.unity.modules.imageconversion": "1.0.0" }, "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" }, "com.unity.settings-manager": { "version": "2.0.1", "depth": 1, "source": "registry", "dependencies": {}, "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" }, "com.unity.sharp-zip-lib": { "version": "1.2.2-preview", "depth": 1, "source": "registry", "dependencies": {}, "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" }, "com.unity.test-framework": { "version": "1.3.9", "depth": 0, "source": "registry", "dependencies": { "com.unity.ext.nunit": "2.0.3", "com.unity.modules.imgui": "1.0.0", "com.unity.modules.jsonserialize": "1.0.0" }, "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" }, "com.unity.test-framework.performance": { "version": "3.0.3", "depth": 0, "source": "registry", "dependencies": { "com.unity.test-framework": "1.1.31", "com.unity.modules.jsonserialize": "1.0.0" }, "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" }, "com.unity.testtools.codecoverage": { "version": "1.2.5", "depth": 0, "source": "registry", "dependencies": { "com.unity.test-framework": "1.0.16", "com.unity.settings-manager": "1.0.1" }, "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" }, "nuget.castle-core": { "version": "2.0.0", "depth": 2, "source": "registry", "dependencies": {}, "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" }, "nuget.moq": { "version": "2.0.0", "depth": 1, "source": "registry", "dependencies": { "nuget.castle-core": "2.0.0" }, "url": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates" }, "com.unity.modules.accessibility": { "version": "1.0.0", "depth": 0, "source": "builtin", "dependencies": {} }, "com.unity.modules.ai": { "version": "1.0.0", "depth": 1, "source": "builtin", "dependencies": {} }, "com.unity.modules.hierarchycore": { "version": "1.0.0", "depth": 1, "source": "builtin", "dependencies": {} }, "com.unity.modules.imageconversion": { "version": "1.0.0", "depth": 0, "source": "builtin", "dependencies": {} }, "com.unity.modules.imgui": { "version": "1.0.0", "depth": 1, "source": "builtin", "dependencies": {} }, "com.unity.modules.jsonserialize": { "version": "1.0.0", "depth": 1, "source": "builtin", "dependencies": {} }, "com.unity.modules.physics": { "version": "1.0.0", "depth": 0, "source": "builtin", "dependencies": {} }, "com.unity.modules.physics2d": { "version": "1.0.0", "depth": 0, "source": "builtin", "dependencies": {} }, "com.unity.modules.ui": { "version": "1.0.0", "depth": 0, "source": "builtin", "dependencies": {} }, "com.unity.modules.uielements": { "version": "1.0.0", "depth": 0, "source": "builtin", "dependencies": { "com.unity.modules.ui": "1.0.0", "com.unity.modules.imgui": "1.0.0", "com.unity.modules.jsonserialize": "1.0.0", "com.unity.modules.hierarchycore": "1.0.0" } }, "com.unity.modules.unityanalytics": { "version": "1.0.0", "depth": 0, "source": "builtin", "dependencies": { "com.unity.modules.unitywebrequest": "1.0.0", "com.unity.modules.jsonserialize": "1.0.0" } }, "com.unity.modules.unitywebrequest": { "version": "1.0.0", "depth": 1, "source": "builtin", "dependencies": {} } } }
ml-agents/DevProject/Packages/packages-lock.json/0
{ "file_path": "ml-agents/DevProject/Packages/packages-lock.json", "repo_id": "ml-agents", "token_count": 4096 }
1,903
fileFormatVersion: 2 guid: 58064fb0cc77d4eeaa9210f2f05610e9 folderAsset: yes DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
ml-agents/PerformanceProject/Assets/Scenes.meta/0
{ "file_path": "ml-agents/PerformanceProject/Assets/Scenes.meta", "repo_id": "ml-agents", "token_count": 69 }
1,904
%YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!19 &1 Physics2DSettings: m_ObjectHideFlags: 0 serializedVersion: 4 m_Gravity: {x: 0, y: -9.81} m_DefaultMaterial: {fileID: 0} m_VelocityIterations: 8 m_PositionIterations: 3 m_VelocityThreshold: 1 m_MaxLinearCorrection: 0.2 m_MaxAngularCorrection: 8 m_MaxTranslationSpeed: 100 m_MaxRotationSpeed: 360 m_BaumgarteScale: 0.2 m_BaumgarteTimeOfImpactScale: 0.75 m_TimeToSleep: 0.5 m_LinearSleepTolerance: 0.01 m_AngularSleepTolerance: 2 m_DefaultContactOffset: 0.01 m_JobOptions: serializedVersion: 2 useMultithreading: 0 useConsistencySorting: 0 m_InterpolationPosesPerJob: 100 m_NewContactsPerJob: 30 m_CollideContactsPerJob: 100 m_ClearFlagsPerJob: 200 m_ClearBodyForcesPerJob: 200 m_SyncDiscreteFixturesPerJob: 50 m_SyncContinuousFixturesPerJob: 50 m_FindNearestContactsPerJob: 100 m_UpdateTriggerContactsPerJob: 100 m_IslandSolverCostThreshold: 100 m_IslandSolverBodyCostScale: 1 m_IslandSolverContactCostScale: 10 m_IslandSolverJointCostScale: 10 m_IslandSolverBodiesPerJob: 50 m_IslandSolverContactsPerJob: 50 m_AutoSimulation: 1 m_QueriesHitTriggers: 1 m_QueriesStartInColliders: 1 m_CallbacksOnDisable: 1 m_ReuseCollisionCallbacks: 1 m_AutoSyncTransforms: 0 m_AlwaysShowColliders: 0 m_ShowColliderSleep: 1 m_ShowColliderContacts: 0 m_ShowColliderAABB: 0 m_ContactArrowScale: 0.2 m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ml-agents/PerformanceProject/ProjectSettings/Physics2DSettings.asset/0
{ "file_path": "ml-agents/PerformanceProject/ProjectSettings/Physics2DSettings.asset", "repo_id": "ml-agents", "token_count": 831 }
1,905
fileFormatVersion: 2 guid: 5c324397e98ed45d28d29fd1056c6df0 folderAsset: yes DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
ml-agents/Project/Assets/ML-Agents/Editor/Tests.meta/0
{ "file_path": "ml-agents/Project/Assets/ML-Agents/Editor/Tests.meta", "repo_id": "ml-agents", "token_count": 69 }
1,906
fileFormatVersion: 2 guid: 0d8ebd51939eb45c88531e9d444bca28 NativeFormatImporter: externalObjects: {} mainObjectFileID: 100100000 userData: assetBundleName: assetBundleVariant:
ml-agents/Project/Assets/ML-Agents/Examples/3DBall/Prefabs/3DBallHard.prefab.meta/0
{ "file_path": "ml-agents/Project/Assets/ML-Agents/Examples/3DBall/Prefabs/3DBallHard.prefab.meta", "repo_id": "ml-agents", "token_count": 75 }
1,907
%YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!29 &1 OcclusionCullingSettings: m_ObjectHideFlags: 0 serializedVersion: 2 m_OcclusionBakeSettings: smallestOccluder: 5 smallestHole: 0.25 backfaceThreshold: 100 m_SceneGUID: 00000000000000000000000000000000 m_OcclusionCullingData: {fileID: 0} --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 serializedVersion: 9 m_Fog: 0 m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 m_FogDensity: 0.01 m_LinearFogStart: 0 m_LinearFogEnd: 300 m_AmbientSkyColor: {r: 0.8, g: 0.8, b: 0.8, a: 1} m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 3 m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 m_HaloTexture: {fileID: 0} m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} m_DefaultReflectionMode: 0 m_DefaultReflectionResolution: 128 m_ReflectionBounces: 1 m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} m_IndirectSpecularColor: {r: 0.44971168, g: 0.4997775, b: 0.57563686, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 serializedVersion: 12 m_GIWorkflowMode: 1 m_GISettings: serializedVersion: 2 m_BounceScale: 1 m_IndirectOutputScale: 1 m_AlbedoBoost: 1 m_EnvironmentLightingMode: 0 m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 1 m_LightmapEditorSettings: serializedVersion: 12 m_Resolution: 2 m_BakeResolution: 40 m_AtlasSize: 1024 m_AO: 0 m_AOMaxDistance: 1 m_CompAOExponent: 1 m_CompAOExponentDirect: 0 m_ExtractAmbientOcclusion: 0 m_Padding: 2 m_LightmapParameters: {fileID: 0} m_LightmapsBakeMode: 1 m_TextureCompression: 1 m_FinalGather: 0 m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 256 m_ReflectionCompression: 2 m_MixedBakeMode: 2 m_BakeBackend: 0 m_PVRSampling: 1 m_PVRDirectSampleCount: 32 m_PVRSampleCount: 500 m_PVRBounces: 2 m_PVREnvironmentSampleCount: 500 m_PVREnvironmentReferencePointCount: 2048 m_PVRFilteringMode: 2 m_PVRDenoiserTypeDirect: 0 m_PVRDenoiserTypeIndirect: 0 m_PVRDenoiserTypeAO: 0 m_PVRFilterTypeDirect: 0 m_PVRFilterTypeIndirect: 0 m_PVRFilterTypeAO: 0 m_PVREnvironmentMIS: 0 m_PVRCulling: 1 m_PVRFilteringGaussRadiusDirect: 1 m_PVRFilteringGaussRadiusIndirect: 5 m_PVRFilteringGaussRadiusAO: 2 m_PVRFilteringAtrousPositionSigmaDirect: 0.5 m_PVRFilteringAtrousPositionSigmaIndirect: 2 m_PVRFilteringAtrousPositionSigmaAO: 1 m_ExportTrainingData: 0 m_TrainingDataDestination: TrainingData m_LightProbeSampleCountMultiplier: 4 m_LightingDataAsset: {fileID: 0} m_LightingSettings: {fileID: 948122188} --- !u!196 &4 NavMeshSettings: serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: serializedVersion: 2 agentTypeID: 0 agentRadius: 0.5 agentHeight: 2 agentSlope: 45 agentClimb: 0.4 ledgeDropHeight: 0 maxJumpAcrossDistance: 0 minRegionArea: 2 manualCellSize: 0 cellSize: 0.16666667 manualTileSize: 0 tileSize: 256 accuratePlacement: 0 maxJobWorkers: 0 preserveTilesOutsideBounds: 0 debug: m_Flags: 0 m_NavMeshData: {fileID: 0} --- !u!1001 &68436829 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: m_TransformParent: {fileID: 0} m_Modifications: - target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3} propertyPath: m_RootOrder value: 1 objectReference: {fileID: 0} - target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3} propertyPath: m_LocalPosition.x value: 106.38621 objectReference: {fileID: 0} - target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3} propertyPath: m_LocalPosition.y value: 38.840767 objectReference: {fileID: 0} - target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3} propertyPath: m_LocalPosition.z value: 34.72934 objectReference: {fileID: 0} - target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3} propertyPath: m_LocalRotation.w value: 0.8681629 objectReference: {fileID: 0} - target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3} propertyPath: m_LocalRotation.x value: 0.31598538 objectReference: {fileID: 0} - target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3} propertyPath: m_LocalRotation.y value: -0.3596048 objectReference: {fileID: 0} - target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3} propertyPath: m_LocalRotation.z value: 0.13088542 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3} --- !u!850595691 &948122188 LightingSettings: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: Settings.lighting serializedVersion: 4 m_GIWorkflowMode: 1 m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 1 m_RealtimeEnvironmentLighting: 1 m_BounceScale: 1 m_AlbedoBoost: 1 m_IndirectOutputScale: 1 m_UsingShadowmask: 1 m_BakeBackend: 0 m_LightmapMaxSize: 1024 m_BakeResolution: 40 m_Padding: 2 m_LightmapCompression: 3 m_AO: 0 m_AOMaxDistance: 1 m_CompAOExponent: 1 m_CompAOExponentDirect: 0 m_ExtractAO: 0 m_MixedBakeMode: 2 m_LightmapsBakeMode: 1 m_FilterMode: 1 m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} m_ExportTrainingData: 0 m_TrainingDataDestination: TrainingData m_RealtimeResolution: 2 m_ForceWhiteAlbedo: 0 m_ForceUpdates: 0 m_FinalGather: 0 m_FinalGatherRayCount: 256 m_FinalGatherFiltering: 1 m_PVRCulling: 1 m_PVRSampling: 1 m_PVRDirectSampleCount: 32 m_PVRSampleCount: 500 m_PVREnvironmentSampleCount: 500 m_PVREnvironmentReferencePointCount: 2048 m_LightProbeSampleCountMultiplier: 4 m_PVRBounces: 2 m_PVRMinBounces: 2 m_PVREnvironmentMIS: 0 m_PVRFilteringMode: 2 m_PVRDenoiserTypeDirect: 0 m_PVRDenoiserTypeIndirect: 0 m_PVRDenoiserTypeAO: 0 m_PVRFilterTypeDirect: 0 m_PVRFilterTypeIndirect: 0 m_PVRFilterTypeAO: 0 m_PVRFilteringGaussRadiusDirect: 1 m_PVRFilteringGaussRadiusIndirect: 5 m_PVRFilteringGaussRadiusAO: 2 m_PVRFilteringAtrousPositionSigmaDirect: 0.5 m_PVRFilteringAtrousPositionSigmaIndirect: 2 m_PVRFilteringAtrousPositionSigmaAO: 1 m_PVRTiledBaking: 0 --- !u!1001 &1502457254 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: m_TransformParent: {fileID: 0} m_Modifications: - target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3} propertyPath: m_Pivot.x value: 0 objectReference: {fileID: 0} - target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3} propertyPath: m_Pivot.y value: 0 objectReference: {fileID: 0} - target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3} propertyPath: m_RootOrder value: 3 objectReference: {fileID: 0} - target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3} propertyPath: m_AnchorMax.x value: 0 objectReference: {fileID: 0} - target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3} propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} - target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3} propertyPath: m_AnchorMin.x value: 0 objectReference: {fileID: 0} - target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3} propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} - target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3} propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} - target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3} propertyPath: m_SizeDelta.y value: 0 objectReference: {fileID: 0} - target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3} propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3} propertyPath: m_AnchoredPosition.x value: 0 objectReference: {fileID: 0} - target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3} propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3} --- !u!1 &1715640920 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 1715640925} - component: {fileID: 1715640924} - component: {fileID: 1715640922} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!124 &1715640922 Behaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1715640920} m_Enabled: 1 --- !u!20 &1715640924 Camera: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1715640920} m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 2 m_BackGroundColor: {r: 0.46666667, g: 0.5647059, b: 0.60784316, a: 1} m_projectionMatrixMode: 1 m_GateFitMode: 2 m_FOVAxisMode: 0 m_SensorSize: {x: 36, y: 24} m_LensShift: {x: 0, y: 0} m_FocalLength: 50 m_NormalizedViewPortRect: serializedVersion: 2 x: 0 y: 0 width: 1 height: 1 near clip plane: 0.3 far clip plane: 1000 field of view: 50 orthographic: 0 orthographic size: 5 m_Depth: -1 m_CullingMask: serializedVersion: 2 m_Bits: 4294967295 m_RenderingPath: -1 m_TargetTexture: {fileID: 0} m_TargetDisplay: 0 m_TargetEye: 3 m_HDR: 1 m_AllowMSAA: 1 m_AllowDynamicResolution: 0 m_ForceIntoRT: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 --- !u!4 &1715640925 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1715640920} m_LocalRotation: {x: 0.2588191, y: 0, z: 0, w: 0.9659258} m_LocalPosition: {x: 0, y: 7.33, z: -13.89} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 30, y: 0, z: 0} --- !u!1001 &1783603361 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: m_TransformParent: {fileID: 0} m_Modifications: - target: {fileID: 4748436652256066, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3} propertyPath: m_RootOrder value: 2 objectReference: {fileID: 0} - target: {fileID: 4748436652256066, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3} propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - target: {fileID: 4748436652256066, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - target: {fileID: 4748436652256066, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - target: {fileID: 4748436652256066, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - target: {fileID: 4748436652256066, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3} propertyPath: m_LocalRotation.x value: 0 objectReference: {fileID: 0} - target: {fileID: 4748436652256066, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3} propertyPath: m_LocalRotation.y value: 0 objectReference: {fileID: 0} - target: {fileID: 4748436652256066, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3} propertyPath: m_LocalRotation.z value: 0 objectReference: {fileID: 0} - target: {fileID: 4939386490834352, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3} propertyPath: m_LocalScale.z value: 6.270299 objectReference: {fileID: 0} - target: {fileID: 114502619508238574, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3} propertyPath: m_Model value: objectReference: {fileID: 5022602860645237092, guid: 097099e8be3e74ae08b694b59d393074, type: 3} - target: {fileID: 114502619508238574, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3} propertyPath: m_BrainParameters.VectorObservationSize value: 0 objectReference: {fileID: 0} - target: {fileID: 114502619508238574, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3} propertyPath: m_BrainParameters.vectorObservationSize value: 0 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3} --- !u!1 &1889211226 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 1889211228} - component: {fileID: 1889211227} m_Layer: 0 m_Name: BasicSettings m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!114 &1889211227 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1889211226} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: ec51f47c5ed0478080c449c74fd9c154, type: 3} m_Name: m_EditorClassIdentifier: gravityMultiplier: 1 fixedDeltaTime: 0.02 maximumDeltaTime: 0.33333334 solverIterations: 6 solverVelocityIterations: 1 reuseCollisionCallbacks: 1 --- !u!4 &1889211228 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1889211226} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
ml-agents/Project/Assets/ML-Agents/Examples/Basic/Scenes/Basic.unity/0
{ "file_path": "ml-agents/Project/Assets/ML-Agents/Examples/Basic/Scenes/Basic.unity", "repo_id": "ml-agents", "token_count": 7692 }
1,908
fileFormatVersion: 2 guid: c9cb9a4fa201d4f579ff66de92b0317f folderAsset: yes timeCreated: 1508478093 licenseType: Free DefaultImporter: userData: assetBundleName: assetBundleVariant:
ml-agents/Project/Assets/ML-Agents/Examples/Crawler/Prefabs.meta/0
{ "file_path": "ml-agents/Project/Assets/ML-Agents/Examples/Crawler/Prefabs.meta", "repo_id": "ml-agents", "token_count": 77 }
1,909
fileFormatVersion: 2 guid: d1aeac7dad8bb42fb92cfa7dc7bc3d3f folderAsset: yes DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
ml-agents/Project/Assets/ML-Agents/Examples/DungeonEscape/Scripts.meta/0
{ "file_path": "ml-agents/Project/Assets/ML-Agents/Examples/DungeonEscape/Scripts.meta", "repo_id": "ml-agents", "token_count": 71 }
1,910
using UnityEngine; using Unity.MLAgents; using Unity.MLAgents.Actuators; using Unity.MLAgents.Sensors; using Random = UnityEngine.Random; public class FoodCollectorAgent : Agent { FoodCollectorSettings m_FoodCollecterSettings; public GameObject area; FoodCollectorArea m_MyArea; bool m_Frozen; bool m_Poisoned; bool m_Satiated; bool m_Shoot; float m_FrozenTime; float m_EffectTime; Rigidbody m_AgentRb; float m_LaserLength; // Speed of agent rotation. public float turnSpeed = 300; // Speed of agent movement. public float moveSpeed = 2; public Material normalMaterial; public Material badMaterial; public Material goodMaterial; public Material frozenMaterial; public GameObject myLaser; public bool contribute; public bool useVectorObs; [Tooltip("Use only the frozen flag in vector observations. If \"Use Vector Obs\" " + "is checked, this option has no effect. This option is necessary for the " + "VisualFoodCollector scene.")] public bool useVectorFrozenFlag; EnvironmentParameters m_ResetParams; public override void Initialize() { m_AgentRb = GetComponent<Rigidbody>(); m_MyArea = area.GetComponent<FoodCollectorArea>(); m_FoodCollecterSettings = FindObjectOfType<FoodCollectorSettings>(); m_ResetParams = Academy.Instance.EnvironmentParameters; SetResetParameters(); } public override void CollectObservations(VectorSensor sensor) { if (useVectorObs) { var localVelocity = transform.InverseTransformDirection(m_AgentRb.velocity); sensor.AddObservation(localVelocity.x); sensor.AddObservation(localVelocity.z); sensor.AddObservation(m_Frozen); sensor.AddObservation(m_Shoot); } else if (useVectorFrozenFlag) { sensor.AddObservation(m_Frozen); } } public Color32 ToColor(int hexVal) { var r = (byte)((hexVal >> 16) & 0xFF); var g = (byte)((hexVal >> 8) & 0xFF); var b = (byte)(hexVal & 0xFF); return new Color32(r, g, b, 255); } public void MoveAgent(ActionBuffers actionBuffers) { m_Shoot = false; if (Time.time > m_FrozenTime + 4f && m_Frozen) { Unfreeze(); } if (Time.time > m_EffectTime + 0.5f) { if (m_Poisoned) { Unpoison(); } if (m_Satiated) { Unsatiate(); } } var dirToGo = Vector3.zero; var rotateDir = Vector3.zero; var continuousActions = actionBuffers.ContinuousActions; var discreteActions = actionBuffers.DiscreteActions; if (!m_Frozen) { var forward = Mathf.Clamp(continuousActions[0], -1f, 1f); var right = Mathf.Clamp(continuousActions[1], -1f, 1f); var rotate = Mathf.Clamp(continuousActions[2], -1f, 1f); dirToGo = transform.forward * forward; dirToGo += transform.right * right; rotateDir = -transform.up * rotate; var shootCommand = discreteActions[0] > 0; if (shootCommand) { m_Shoot = true; dirToGo *= 0.5f; m_AgentRb.velocity *= 0.75f; } m_AgentRb.AddForce(dirToGo * moveSpeed, ForceMode.VelocityChange); transform.Rotate(rotateDir, Time.fixedDeltaTime * turnSpeed); } if (m_AgentRb.velocity.sqrMagnitude > 25f) // slow it down { m_AgentRb.velocity *= 0.95f; } if (m_Shoot) { var myTransform = transform; myLaser.transform.localScale = new Vector3(1f, 1f, m_LaserLength); var rayDir = 25.0f * myTransform.forward; Debug.DrawRay(myTransform.position, rayDir, Color.red, 0f, true); RaycastHit hit; if (Physics.SphereCast(transform.position, 2f, rayDir, out hit, 25f)) { if (hit.collider.gameObject.CompareTag("agent")) { hit.collider.gameObject.GetComponent<FoodCollectorAgent>().Freeze(); } } } else { myLaser.transform.localScale = new Vector3(0f, 0f, 0f); } } void Freeze() { gameObject.tag = "frozenAgent"; m_Frozen = true; m_FrozenTime = Time.time; gameObject.GetComponentInChildren<Renderer>().material = frozenMaterial; } void Unfreeze() { m_Frozen = false; gameObject.tag = "agent"; gameObject.GetComponentInChildren<Renderer>().material = normalMaterial; } void Poison() { m_Poisoned = true; m_EffectTime = Time.time; gameObject.GetComponentInChildren<Renderer>().material = badMaterial; } void Unpoison() { m_Poisoned = false; gameObject.GetComponentInChildren<Renderer>().material = normalMaterial; } void Satiate() { m_Satiated = true; m_EffectTime = Time.time; gameObject.GetComponentInChildren<Renderer>().material = goodMaterial; } void Unsatiate() { m_Satiated = false; gameObject.GetComponentInChildren<Renderer>().material = normalMaterial; } public override void OnActionReceived(ActionBuffers actionBuffers) { MoveAgent(actionBuffers); } public override void Heuristic(in ActionBuffers actionsOut) { var continuousActionsOut = actionsOut.ContinuousActions; if (Input.GetKey(KeyCode.D)) { continuousActionsOut[2] = 1; } if (Input.GetKey(KeyCode.W)) { continuousActionsOut[0] = 1; } if (Input.GetKey(KeyCode.A)) { continuousActionsOut[2] = -1; } if (Input.GetKey(KeyCode.S)) { continuousActionsOut[0] = -1; } var discreteActionsOut = actionsOut.DiscreteActions; discreteActionsOut[0] = Input.GetKey(KeyCode.Space) ? 1 : 0; } public override void OnEpisodeBegin() { Unfreeze(); Unpoison(); Unsatiate(); m_Shoot = false; m_AgentRb.velocity = Vector3.zero; myLaser.transform.localScale = new Vector3(0f, 0f, 0f); transform.position = new Vector3(Random.Range(-m_MyArea.range, m_MyArea.range), 2f, Random.Range(-m_MyArea.range, m_MyArea.range)) + area.transform.position; transform.rotation = Quaternion.Euler(new Vector3(0f, Random.Range(0, 360))); SetResetParameters(); } void OnCollisionEnter(Collision collision) { if (collision.gameObject.CompareTag("food")) { Satiate(); collision.gameObject.GetComponent<FoodLogic>().OnEaten(); AddReward(1f); if (contribute) { m_FoodCollecterSettings.totalScore += 1; } } if (collision.gameObject.CompareTag("badFood")) { Poison(); collision.gameObject.GetComponent<FoodLogic>().OnEaten(); AddReward(-1f); if (contribute) { m_FoodCollecterSettings.totalScore -= 1; } } } public void SetLaserLengths() { m_LaserLength = m_ResetParams.GetWithDefault("laser_length", 1.0f); } public void SetAgentScale() { float agentScale = m_ResetParams.GetWithDefault("agent_scale", 1.0f); gameObject.transform.localScale = new Vector3(agentScale, agentScale, agentScale); } public void SetResetParameters() { SetLaserLengths(); SetAgentScale(); } }
ml-agents/Project/Assets/ML-Agents/Examples/FoodCollector/Scripts/FoodCollectorAgent.cs/0
{ "file_path": "ml-agents/Project/Assets/ML-Agents/Examples/FoodCollector/Scripts/FoodCollectorAgent.cs", "repo_id": "ml-agents", "token_count": 3771 }
1,911
fileFormatVersion: 2 guid: 334ae08b3f6dd45b0a1ac913bea6edac folderAsset: yes DefaultImporter: externalObjects: {} userData: assetBundleName: assetBundleVariant:
ml-agents/Project/Assets/ML-Agents/Examples/GridWorld/Demos.meta/0
{ "file_path": "ml-agents/Project/Assets/ML-Agents/Examples/GridWorld/Demos.meta", "repo_id": "ml-agents", "token_count": 71 }
1,912