Showing
58 changed files
with
2366 additions
and
0 deletions
.gitignore
0 → 100644
1 | +# This .gitignore file should be placed at the root of your Unity project directory | ||
2 | +# | ||
3 | +# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore | ||
4 | +# | ||
5 | +# =============== # | ||
6 | + | ||
7 | +# Unity generated # | ||
8 | + | ||
9 | +# =============== # | ||
10 | + | ||
11 | +Temp/ | ||
12 | + | ||
13 | +Obj/ | ||
14 | + | ||
15 | +UnityGenerated/ | ||
16 | + | ||
17 | +Library/ | ||
18 | + | ||
19 | +## | ||
20 | +/[Ll]ibrary/ | ||
21 | +/[Tt]emp/ | ||
22 | +/[Oo]bj/ | ||
23 | +/[Bb]uild/ | ||
24 | +/[Bb]uilds/ | ||
25 | +/[Ll]ogs/ | ||
26 | +/[Uu]ser[Ss]ettings/ | ||
27 | + | ||
28 | +# MemoryCaptures can get excessive in size. | ||
29 | +# They also could contain extremely sensitive data | ||
30 | +/[Mm]emoryCaptures/ | ||
31 | + | ||
32 | +# Asset meta data should only be ignored when the corresponding asset is also ignored | ||
33 | +!/[Aa]ssets/**/*.meta | ||
34 | + | ||
35 | +# Uncomment this line if you wish to ignore the asset store tools plugin | ||
36 | +# /[Aa]ssets/AssetStoreTools* | ||
37 | + | ||
38 | +# Autogenerated Jetbrains Rider plugin | ||
39 | +/[Aa]ssets/Plugins/Editor/JetBrains* | ||
40 | + | ||
41 | +# Visual Studio cache directory | ||
42 | +.vs/ | ||
43 | + | ||
44 | +# Gradle cache directory | ||
45 | +.gradle/ | ||
46 | + | ||
47 | +# Autogenerated VS/MD/Consulo solution and project files | ||
48 | +ExportedObj/ | ||
49 | +.consulo/ | ||
50 | +*.csproj | ||
51 | +*.unityproj | ||
52 | +*.sln | ||
53 | +*.suo | ||
54 | +*.tmp | ||
55 | +*.user | ||
56 | +*.userprefs | ||
57 | +*.pidb | ||
58 | +*.booproj | ||
59 | +*.svd | ||
60 | +*.pdb | ||
61 | +*.mdb | ||
62 | +*.opendb | ||
63 | +*.VC.db | ||
64 | + | ||
65 | +# Unity3D generated meta files | ||
66 | +*.pidb.meta | ||
67 | +*.pdb.meta | ||
68 | +*.mdb.meta | ||
69 | + | ||
70 | +# Unity3D generated file on crash reports | ||
71 | +sysinfo.txt | ||
72 | + | ||
73 | +# Builds | ||
74 | +*.apk | ||
75 | +*.aab | ||
76 | +*.unitypackage | ||
77 | + | ||
78 | +# Crashlytics generated file | ||
79 | +crashlytics-build.properties | ||
80 | + | ||
81 | +# Packed Addressables | ||
82 | +/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* | ||
83 | + | ||
84 | +# Temporary auto-generated Android Assets | ||
85 | +/[Aa]ssets/[Ss]treamingAssets/aa.meta | ||
86 | +/[Aa]ssets/[Ss]treamingAssets/aa/* | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
프로젝트/NewAndFurious/Assets/AYAYA.jpg
0 → 100644
27.7 KB
프로젝트/NewAndFurious/Assets/AYAYA.jpg.meta
0 → 100644
1 | +fileFormatVersion: 2 | ||
2 | +guid: 9ee754493e5ea2e4d8ddbf602631f850 | ||
3 | +TextureImporter: | ||
4 | + internalIDToNameTable: [] | ||
5 | + externalObjects: {} | ||
6 | + serializedVersion: 11 | ||
7 | + mipmaps: | ||
8 | + mipMapMode: 0 | ||
9 | + enableMipMap: 1 | ||
10 | + sRGBTexture: 1 | ||
11 | + linearTexture: 0 | ||
12 | + fadeOut: 0 | ||
13 | + borderMipMap: 0 | ||
14 | + mipMapsPreserveCoverage: 0 | ||
15 | + alphaTestReferenceValue: 0.5 | ||
16 | + mipMapFadeDistanceStart: 1 | ||
17 | + mipMapFadeDistanceEnd: 3 | ||
18 | + bumpmap: | ||
19 | + convertToNormalMap: 0 | ||
20 | + externalNormalMap: 0 | ||
21 | + heightScale: 0.25 | ||
22 | + normalMapFilter: 0 | ||
23 | + isReadable: 0 | ||
24 | + streamingMipmaps: 0 | ||
25 | + streamingMipmapsPriority: 0 | ||
26 | + grayScaleToAlpha: 0 | ||
27 | + generateCubemap: 6 | ||
28 | + cubemapConvolution: 0 | ||
29 | + seamlessCubemap: 0 | ||
30 | + textureFormat: 1 | ||
31 | + maxTextureSize: 2048 | ||
32 | + textureSettings: | ||
33 | + serializedVersion: 2 | ||
34 | + filterMode: -1 | ||
35 | + aniso: -1 | ||
36 | + mipBias: -100 | ||
37 | + wrapU: -1 | ||
38 | + wrapV: -1 | ||
39 | + wrapW: -1 | ||
40 | + nPOTScale: 1 | ||
41 | + lightmap: 0 | ||
42 | + compressionQuality: 50 | ||
43 | + spriteMode: 0 | ||
44 | + spriteExtrude: 1 | ||
45 | + spriteMeshType: 1 | ||
46 | + alignment: 0 | ||
47 | + spritePivot: {x: 0.5, y: 0.5} | ||
48 | + spritePixelsToUnits: 100 | ||
49 | + spriteBorder: {x: 0, y: 0, z: 0, w: 0} | ||
50 | + spriteGenerateFallbackPhysicsShape: 1 | ||
51 | + alphaUsage: 1 | ||
52 | + alphaIsTransparency: 0 | ||
53 | + spriteTessellationDetail: -1 | ||
54 | + textureType: 0 | ||
55 | + textureShape: 1 | ||
56 | + singleChannelComponent: 0 | ||
57 | + maxTextureSizeSet: 0 | ||
58 | + compressionQualitySet: 0 | ||
59 | + textureFormatSet: 0 | ||
60 | + applyGammaDecoding: 0 | ||
61 | + platformSettings: | ||
62 | + - serializedVersion: 3 | ||
63 | + buildTarget: DefaultTexturePlatform | ||
64 | + maxTextureSize: 2048 | ||
65 | + resizeAlgorithm: 0 | ||
66 | + textureFormat: -1 | ||
67 | + textureCompression: 1 | ||
68 | + compressionQuality: 50 | ||
69 | + crunchedCompression: 0 | ||
70 | + allowsAlphaSplitting: 0 | ||
71 | + overridden: 0 | ||
72 | + androidETC2FallbackOverride: 0 | ||
73 | + forceMaximumCompressionQuality_BC6H_BC7: 0 | ||
74 | + spriteSheet: | ||
75 | + serializedVersion: 2 | ||
76 | + sprites: [] | ||
77 | + outline: [] | ||
78 | + physicsShape: [] | ||
79 | + bones: [] | ||
80 | + spriteID: | ||
81 | + internalID: 0 | ||
82 | + vertices: [] | ||
83 | + indices: | ||
84 | + edges: [] | ||
85 | + weights: [] | ||
86 | + secondaryTextures: [] | ||
87 | + spritePackingTag: | ||
88 | + pSDRemoveMatte: 0 | ||
89 | + pSDShowRemoveMatteOption: 0 | ||
90 | + userData: | ||
91 | + assetBundleName: | ||
92 | + assetBundleVariant: |
프로젝트/NewAndFurious/Assets/Bee_Mad_Emote.png
0 → 100644
47.6 KB
1 | +fileFormatVersion: 2 | ||
2 | +guid: 637490d0320677044aeeaad680945746 | ||
3 | +TextureImporter: | ||
4 | + internalIDToNameTable: [] | ||
5 | + externalObjects: {} | ||
6 | + serializedVersion: 11 | ||
7 | + mipmaps: | ||
8 | + mipMapMode: 0 | ||
9 | + enableMipMap: 1 | ||
10 | + sRGBTexture: 1 | ||
11 | + linearTexture: 0 | ||
12 | + fadeOut: 0 | ||
13 | + borderMipMap: 0 | ||
14 | + mipMapsPreserveCoverage: 0 | ||
15 | + alphaTestReferenceValue: 0.5 | ||
16 | + mipMapFadeDistanceStart: 1 | ||
17 | + mipMapFadeDistanceEnd: 3 | ||
18 | + bumpmap: | ||
19 | + convertToNormalMap: 0 | ||
20 | + externalNormalMap: 0 | ||
21 | + heightScale: 0.25 | ||
22 | + normalMapFilter: 0 | ||
23 | + isReadable: 0 | ||
24 | + streamingMipmaps: 0 | ||
25 | + streamingMipmapsPriority: 0 | ||
26 | + grayScaleToAlpha: 0 | ||
27 | + generateCubemap: 6 | ||
28 | + cubemapConvolution: 0 | ||
29 | + seamlessCubemap: 0 | ||
30 | + textureFormat: 1 | ||
31 | + maxTextureSize: 2048 | ||
32 | + textureSettings: | ||
33 | + serializedVersion: 2 | ||
34 | + filterMode: -1 | ||
35 | + aniso: -1 | ||
36 | + mipBias: -100 | ||
37 | + wrapU: -1 | ||
38 | + wrapV: -1 | ||
39 | + wrapW: -1 | ||
40 | + nPOTScale: 1 | ||
41 | + lightmap: 0 | ||
42 | + compressionQuality: 50 | ||
43 | + spriteMode: 0 | ||
44 | + spriteExtrude: 1 | ||
45 | + spriteMeshType: 1 | ||
46 | + alignment: 0 | ||
47 | + spritePivot: {x: 0.5, y: 0.5} | ||
48 | + spritePixelsToUnits: 100 | ||
49 | + spriteBorder: {x: 0, y: 0, z: 0, w: 0} | ||
50 | + spriteGenerateFallbackPhysicsShape: 1 | ||
51 | + alphaUsage: 1 | ||
52 | + alphaIsTransparency: 0 | ||
53 | + spriteTessellationDetail: -1 | ||
54 | + textureType: 0 | ||
55 | + textureShape: 1 | ||
56 | + singleChannelComponent: 0 | ||
57 | + maxTextureSizeSet: 0 | ||
58 | + compressionQualitySet: 0 | ||
59 | + textureFormatSet: 0 | ||
60 | + applyGammaDecoding: 0 | ||
61 | + platformSettings: | ||
62 | + - serializedVersion: 3 | ||
63 | + buildTarget: DefaultTexturePlatform | ||
64 | + maxTextureSize: 2048 | ||
65 | + resizeAlgorithm: 0 | ||
66 | + textureFormat: -1 | ||
67 | + textureCompression: 1 | ||
68 | + compressionQuality: 50 | ||
69 | + crunchedCompression: 0 | ||
70 | + allowsAlphaSplitting: 0 | ||
71 | + overridden: 0 | ||
72 | + androidETC2FallbackOverride: 0 | ||
73 | + forceMaximumCompressionQuality_BC6H_BC7: 0 | ||
74 | + spriteSheet: | ||
75 | + serializedVersion: 2 | ||
76 | + sprites: [] | ||
77 | + outline: [] | ||
78 | + physicsShape: [] | ||
79 | + bones: [] | ||
80 | + spriteID: | ||
81 | + internalID: 0 | ||
82 | + vertices: [] | ||
83 | + indices: | ||
84 | + edges: [] | ||
85 | + weights: [] | ||
86 | + secondaryTextures: [] | ||
87 | + spritePackingTag: | ||
88 | + pSDRemoveMatte: 0 | ||
89 | + pSDShowRemoveMatteOption: 0 | ||
90 | + userData: | ||
91 | + assetBundleName: | ||
92 | + assetBundleVariant: |
프로젝트/NewAndFurious/Assets/Bee_Sad_Emote.png
0 → 100644
82.4 KB
1 | +fileFormatVersion: 2 | ||
2 | +guid: 276c4e4726da6a148b43ba56f388c1e1 | ||
3 | +TextureImporter: | ||
4 | + internalIDToNameTable: [] | ||
5 | + externalObjects: {} | ||
6 | + serializedVersion: 11 | ||
7 | + mipmaps: | ||
8 | + mipMapMode: 0 | ||
9 | + enableMipMap: 1 | ||
10 | + sRGBTexture: 1 | ||
11 | + linearTexture: 0 | ||
12 | + fadeOut: 0 | ||
13 | + borderMipMap: 0 | ||
14 | + mipMapsPreserveCoverage: 0 | ||
15 | + alphaTestReferenceValue: 0.5 | ||
16 | + mipMapFadeDistanceStart: 1 | ||
17 | + mipMapFadeDistanceEnd: 3 | ||
18 | + bumpmap: | ||
19 | + convertToNormalMap: 0 | ||
20 | + externalNormalMap: 0 | ||
21 | + heightScale: 0.25 | ||
22 | + normalMapFilter: 0 | ||
23 | + isReadable: 0 | ||
24 | + streamingMipmaps: 0 | ||
25 | + streamingMipmapsPriority: 0 | ||
26 | + grayScaleToAlpha: 0 | ||
27 | + generateCubemap: 6 | ||
28 | + cubemapConvolution: 0 | ||
29 | + seamlessCubemap: 0 | ||
30 | + textureFormat: 1 | ||
31 | + maxTextureSize: 2048 | ||
32 | + textureSettings: | ||
33 | + serializedVersion: 2 | ||
34 | + filterMode: -1 | ||
35 | + aniso: -1 | ||
36 | + mipBias: -100 | ||
37 | + wrapU: -1 | ||
38 | + wrapV: -1 | ||
39 | + wrapW: -1 | ||
40 | + nPOTScale: 1 | ||
41 | + lightmap: 0 | ||
42 | + compressionQuality: 50 | ||
43 | + spriteMode: 0 | ||
44 | + spriteExtrude: 1 | ||
45 | + spriteMeshType: 1 | ||
46 | + alignment: 0 | ||
47 | + spritePivot: {x: 0.5, y: 0.5} | ||
48 | + spritePixelsToUnits: 100 | ||
49 | + spriteBorder: {x: 0, y: 0, z: 0, w: 0} | ||
50 | + spriteGenerateFallbackPhysicsShape: 1 | ||
51 | + alphaUsage: 1 | ||
52 | + alphaIsTransparency: 0 | ||
53 | + spriteTessellationDetail: -1 | ||
54 | + textureType: 0 | ||
55 | + textureShape: 1 | ||
56 | + singleChannelComponent: 0 | ||
57 | + maxTextureSizeSet: 0 | ||
58 | + compressionQualitySet: 0 | ||
59 | + textureFormatSet: 0 | ||
60 | + applyGammaDecoding: 0 | ||
61 | + platformSettings: | ||
62 | + - serializedVersion: 3 | ||
63 | + buildTarget: DefaultTexturePlatform | ||
64 | + maxTextureSize: 2048 | ||
65 | + resizeAlgorithm: 0 | ||
66 | + textureFormat: -1 | ||
67 | + textureCompression: 1 | ||
68 | + compressionQuality: 50 | ||
69 | + crunchedCompression: 0 | ||
70 | + allowsAlphaSplitting: 0 | ||
71 | + overridden: 0 | ||
72 | + androidETC2FallbackOverride: 0 | ||
73 | + forceMaximumCompressionQuality_BC6H_BC7: 0 | ||
74 | + spriteSheet: | ||
75 | + serializedVersion: 2 | ||
76 | + sprites: [] | ||
77 | + outline: [] | ||
78 | + physicsShape: [] | ||
79 | + bones: [] | ||
80 | + spriteID: | ||
81 | + internalID: 0 | ||
82 | + vertices: [] | ||
83 | + indices: | ||
84 | + edges: [] | ||
85 | + weights: [] | ||
86 | + secondaryTextures: [] | ||
87 | + spritePackingTag: | ||
88 | + pSDRemoveMatte: 0 | ||
89 | + pSDShowRemoveMatteOption: 0 | ||
90 | + userData: | ||
91 | + assetBundleName: | ||
92 | + assetBundleVariant: |
프로젝트/NewAndFurious/Assets/Demo.meta
0 → 100644
129 Bytes
1 | +fileFormatVersion: 2 | ||
2 | +guid: 1042d5f4559f64489a485e76563ccece | ||
3 | +TextureImporter: | ||
4 | + fileIDToRecycleName: {} | ||
5 | + externalObjects: {} | ||
6 | + serializedVersion: 7 | ||
7 | + mipmaps: | ||
8 | + mipMapMode: 0 | ||
9 | + enableMipMap: 1 | ||
10 | + sRGBTexture: 1 | ||
11 | + linearTexture: 0 | ||
12 | + fadeOut: 0 | ||
13 | + borderMipMap: 0 | ||
14 | + mipMapsPreserveCoverage: 0 | ||
15 | + alphaTestReferenceValue: 0.5 | ||
16 | + mipMapFadeDistanceStart: 1 | ||
17 | + mipMapFadeDistanceEnd: 3 | ||
18 | + bumpmap: | ||
19 | + convertToNormalMap: 0 | ||
20 | + externalNormalMap: 0 | ||
21 | + heightScale: 0.25 | ||
22 | + normalMapFilter: 0 | ||
23 | + isReadable: 0 | ||
24 | + streamingMipmaps: 0 | ||
25 | + streamingMipmapsPriority: 0 | ||
26 | + grayScaleToAlpha: 0 | ||
27 | + generateCubemap: 6 | ||
28 | + cubemapConvolution: 0 | ||
29 | + seamlessCubemap: 0 | ||
30 | + textureFormat: 1 | ||
31 | + maxTextureSize: 2048 | ||
32 | + textureSettings: | ||
33 | + serializedVersion: 2 | ||
34 | + filterMode: -1 | ||
35 | + aniso: -1 | ||
36 | + mipBias: -100 | ||
37 | + wrapU: -1 | ||
38 | + wrapV: -1 | ||
39 | + wrapW: -1 | ||
40 | + nPOTScale: 1 | ||
41 | + lightmap: 0 | ||
42 | + compressionQuality: 50 | ||
43 | + spriteMode: 0 | ||
44 | + spriteExtrude: 1 | ||
45 | + spriteMeshType: 1 | ||
46 | + alignment: 0 | ||
47 | + spritePivot: {x: 0.5, y: 0.5} | ||
48 | + spritePixelsToUnits: 100 | ||
49 | + spriteBorder: {x: 0, y: 0, z: 0, w: 0} | ||
50 | + spriteGenerateFallbackPhysicsShape: 1 | ||
51 | + alphaUsage: 1 | ||
52 | + alphaIsTransparency: 1 | ||
53 | + spriteTessellationDetail: -1 | ||
54 | + textureType: 0 | ||
55 | + textureShape: 1 | ||
56 | + singleChannelComponent: 0 | ||
57 | + maxTextureSizeSet: 0 | ||
58 | + compressionQualitySet: 0 | ||
59 | + textureFormatSet: 0 | ||
60 | + platformSettings: | ||
61 | + - serializedVersion: 2 | ||
62 | + buildTarget: DefaultTexturePlatform | ||
63 | + maxTextureSize: 2048 | ||
64 | + resizeAlgorithm: 0 | ||
65 | + textureFormat: -1 | ||
66 | + textureCompression: 1 | ||
67 | + compressionQuality: 50 | ||
68 | + crunchedCompression: 0 | ||
69 | + allowsAlphaSplitting: 0 | ||
70 | + overridden: 0 | ||
71 | + androidETC2FallbackOverride: 0 | ||
72 | + - serializedVersion: 2 | ||
73 | + buildTarget: Standalone | ||
74 | + maxTextureSize: 2048 | ||
75 | + resizeAlgorithm: 0 | ||
76 | + textureFormat: -1 | ||
77 | + textureCompression: 1 | ||
78 | + compressionQuality: 50 | ||
79 | + crunchedCompression: 0 | ||
80 | + allowsAlphaSplitting: 0 | ||
81 | + overridden: 0 | ||
82 | + androidETC2FallbackOverride: 0 | ||
83 | + - serializedVersion: 2 | ||
84 | + buildTarget: iPhone | ||
85 | + maxTextureSize: 2048 | ||
86 | + resizeAlgorithm: 0 | ||
87 | + textureFormat: -1 | ||
88 | + textureCompression: 1 | ||
89 | + compressionQuality: 50 | ||
90 | + crunchedCompression: 0 | ||
91 | + allowsAlphaSplitting: 0 | ||
92 | + overridden: 0 | ||
93 | + androidETC2FallbackOverride: 0 | ||
94 | + - serializedVersion: 2 | ||
95 | + buildTarget: Android | ||
96 | + maxTextureSize: 2048 | ||
97 | + resizeAlgorithm: 0 | ||
98 | + textureFormat: -1 | ||
99 | + textureCompression: 1 | ||
100 | + compressionQuality: 50 | ||
101 | + crunchedCompression: 0 | ||
102 | + allowsAlphaSplitting: 0 | ||
103 | + overridden: 0 | ||
104 | + androidETC2FallbackOverride: 0 | ||
105 | + spriteSheet: | ||
106 | + serializedVersion: 2 | ||
107 | + sprites: [] | ||
108 | + outline: [] | ||
109 | + physicsShape: [] | ||
110 | + bones: [] | ||
111 | + spriteID: | ||
112 | + vertices: [] | ||
113 | + indices: | ||
114 | + edges: [] | ||
115 | + weights: [] | ||
116 | + spritePackingTag: | ||
117 | + pSDRemoveMatte: 0 | ||
118 | + pSDShowRemoveMatteOption: 0 | ||
119 | + userData: | ||
120 | + assetBundleName: | ||
121 | + assetBundleVariant: |
1 | +using System.Collections; | ||
2 | +using System.Collections.Generic; | ||
3 | +using UnityEngine; | ||
4 | +using UnityEngine.XR.ARFoundation; | ||
5 | +using UnityEngine.XR; | ||
6 | +using UnityEngine.XR.ARSubsystems; | ||
7 | +using System; | ||
8 | + | ||
9 | +public class ARTapToPlaceObject : MonoBehaviour | ||
10 | +{ | ||
11 | + public GameObject objectToPlace; | ||
12 | + public GameObject placementIndicator; | ||
13 | + private Camera myCamera; | ||
14 | + private ARSessionOrigin arOrigin; | ||
15 | + private ARRaycastManager raycastManager; | ||
16 | + private Pose placementPose; | ||
17 | + private bool placementPoseIsValid = false; | ||
18 | + | ||
19 | + void Start() | ||
20 | + { | ||
21 | + arOrigin = FindObjectOfType<ARSessionOrigin>(); | ||
22 | + raycastManager = FindObjectOfType<ARRaycastManager>(); | ||
23 | + | ||
24 | + } | ||
25 | + | ||
26 | + void Update() | ||
27 | + { | ||
28 | + UpdatePlacementPose(); | ||
29 | + UpdatePlacementIndicator(); | ||
30 | + Debug.Log(placementPoseIsValid); | ||
31 | + | ||
32 | + if (placementPoseIsValid && Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began) | ||
33 | + { | ||
34 | + PlaceObject(); | ||
35 | + } | ||
36 | + } | ||
37 | + | ||
38 | + private void PlaceObject() | ||
39 | + { | ||
40 | + Instantiate(objectToPlace, placementPose.position, placementPose.rotation); | ||
41 | + } | ||
42 | + | ||
43 | + private void UpdatePlacementIndicator() | ||
44 | + { | ||
45 | + if (placementPoseIsValid) | ||
46 | + { | ||
47 | + placementIndicator.SetActive(true); | ||
48 | + placementIndicator.transform.SetPositionAndRotation(placementPose.position, placementPose.rotation); | ||
49 | + } | ||
50 | + else | ||
51 | + { | ||
52 | + placementIndicator.SetActive(false); | ||
53 | + } | ||
54 | + } | ||
55 | + | ||
56 | + private void UpdatePlacementPose() | ||
57 | + { | ||
58 | + var screenCenter = Camera.main.ViewportToScreenPoint(new Vector3(0.5f, 0.5f)); | ||
59 | + var hits = new List<ARRaycastHit>(); | ||
60 | + raycastManager.Raycast(screenCenter, hits, TrackableType.Planes); | ||
61 | + Debug.Log(hits); | ||
62 | + | ||
63 | + placementPoseIsValid = hits.Count > 0; | ||
64 | + if (placementPoseIsValid) | ||
65 | + { | ||
66 | + placementPose = hits[0].pose; | ||
67 | + | ||
68 | + var cameraForward = Camera.main.transform.forward; | ||
69 | + var cameraBearing = new Vector3(cameraForward.x, 0, cameraForward.z).normalized; | ||
70 | + placementPose.rotation = Quaternion.LookRotation(cameraBearing); | ||
71 | + } | ||
72 | + } | ||
73 | + | ||
74 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +%YAML 1.1 | ||
2 | +%TAG !u! tag:unity3d.com,2011: | ||
3 | +--- !u!1 &508961879638566353 | ||
4 | +GameObject: | ||
5 | + m_ObjectHideFlags: 0 | ||
6 | + m_CorrespondingSourceObject: {fileID: 0} | ||
7 | + m_PrefabInstance: {fileID: 0} | ||
8 | + m_PrefabAsset: {fileID: 0} | ||
9 | + serializedVersion: 6 | ||
10 | + m_Component: | ||
11 | + - component: {fileID: 6563567102876091991} | ||
12 | + m_Layer: 0 | ||
13 | + m_Name: Game Piece | ||
14 | + m_TagString: Untagged | ||
15 | + m_Icon: {fileID: 0} | ||
16 | + m_NavMeshLayer: 0 | ||
17 | + m_StaticEditorFlags: 0 | ||
18 | + m_IsActive: 1 | ||
19 | +--- !u!4 &6563567102876091991 | ||
20 | +Transform: | ||
21 | + m_ObjectHideFlags: 0 | ||
22 | + m_CorrespondingSourceObject: {fileID: 0} | ||
23 | + m_PrefabInstance: {fileID: 0} | ||
24 | + m_PrefabAsset: {fileID: 0} | ||
25 | + m_GameObject: {fileID: 508961879638566353} | ||
26 | + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} | ||
27 | + m_LocalPosition: {x: 0, y: 0, z: 0} | ||
28 | + m_LocalScale: {x: 1, y: 1, z: 1} | ||
29 | + m_Children: | ||
30 | + - {fileID: 4697389430244674019} | ||
31 | + m_Father: {fileID: 0} | ||
32 | + m_RootOrder: 0 | ||
33 | + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||
34 | +--- !u!1 &4697389430244674031 | ||
35 | +GameObject: | ||
36 | + m_ObjectHideFlags: 0 | ||
37 | + m_CorrespondingSourceObject: {fileID: 0} | ||
38 | + m_PrefabInstance: {fileID: 0} | ||
39 | + m_PrefabAsset: {fileID: 0} | ||
40 | + serializedVersion: 6 | ||
41 | + m_Component: | ||
42 | + - component: {fileID: 4697389430244674019} | ||
43 | + - component: {fileID: 4697389430244674028} | ||
44 | + - component: {fileID: 4697389430244674029} | ||
45 | + - component: {fileID: 4697389430244674030} | ||
46 | + m_Layer: 0 | ||
47 | + m_Name: Cube | ||
48 | + m_TagString: Untagged | ||
49 | + m_Icon: {fileID: 0} | ||
50 | + m_NavMeshLayer: 0 | ||
51 | + m_StaticEditorFlags: 0 | ||
52 | + m_IsActive: 1 | ||
53 | +--- !u!4 &4697389430244674019 | ||
54 | +Transform: | ||
55 | + m_ObjectHideFlags: 0 | ||
56 | + m_CorrespondingSourceObject: {fileID: 0} | ||
57 | + m_PrefabInstance: {fileID: 0} | ||
58 | + m_PrefabAsset: {fileID: 0} | ||
59 | + m_GameObject: {fileID: 4697389430244674031} | ||
60 | + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} | ||
61 | + m_LocalPosition: {x: 0, y: 0.05, z: 0} | ||
62 | + m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} | ||
63 | + m_Children: [] | ||
64 | + m_Father: {fileID: 6563567102876091991} | ||
65 | + m_RootOrder: 0 | ||
66 | + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||
67 | +--- !u!33 &4697389430244674028 | ||
68 | +MeshFilter: | ||
69 | + m_ObjectHideFlags: 0 | ||
70 | + m_CorrespondingSourceObject: {fileID: 0} | ||
71 | + m_PrefabInstance: {fileID: 0} | ||
72 | + m_PrefabAsset: {fileID: 0} | ||
73 | + m_GameObject: {fileID: 4697389430244674031} | ||
74 | + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} | ||
75 | +--- !u!23 &4697389430244674029 | ||
76 | +MeshRenderer: | ||
77 | + m_ObjectHideFlags: 0 | ||
78 | + m_CorrespondingSourceObject: {fileID: 0} | ||
79 | + m_PrefabInstance: {fileID: 0} | ||
80 | + m_PrefabAsset: {fileID: 0} | ||
81 | + m_GameObject: {fileID: 4697389430244674031} | ||
82 | + m_Enabled: 1 | ||
83 | + m_CastShadows: 1 | ||
84 | + m_ReceiveShadows: 1 | ||
85 | + m_DynamicOccludee: 1 | ||
86 | + m_MotionVectors: 1 | ||
87 | + m_LightProbeUsage: 1 | ||
88 | + m_ReflectionProbeUsage: 1 | ||
89 | + m_RenderingLayerMask: 1 | ||
90 | + m_RendererPriority: 0 | ||
91 | + m_Materials: | ||
92 | + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} | ||
93 | + m_StaticBatchInfo: | ||
94 | + firstSubMesh: 0 | ||
95 | + subMeshCount: 0 | ||
96 | + m_StaticBatchRoot: {fileID: 0} | ||
97 | + m_ProbeAnchor: {fileID: 0} | ||
98 | + m_LightProbeVolumeOverride: {fileID: 0} | ||
99 | + m_ScaleInLightmap: 1 | ||
100 | + m_PreserveUVs: 0 | ||
101 | + m_IgnoreNormalsForChartDetection: 0 | ||
102 | + m_ImportantGI: 0 | ||
103 | + m_StitchLightmapSeams: 0 | ||
104 | + m_SelectedEditorRenderState: 3 | ||
105 | + m_MinimumChartSize: 4 | ||
106 | + m_AutoUVMaxDistance: 0.5 | ||
107 | + m_AutoUVMaxAngle: 89 | ||
108 | + m_LightmapParameters: {fileID: 0} | ||
109 | + m_SortingLayerID: 0 | ||
110 | + m_SortingLayer: 0 | ||
111 | + m_SortingOrder: 0 | ||
112 | +--- !u!65 &4697389430244674030 | ||
113 | +BoxCollider: | ||
114 | + m_ObjectHideFlags: 0 | ||
115 | + m_CorrespondingSourceObject: {fileID: 0} | ||
116 | + m_PrefabInstance: {fileID: 0} | ||
117 | + m_PrefabAsset: {fileID: 0} | ||
118 | + m_GameObject: {fileID: 4697389430244674031} | ||
119 | + m_Material: {fileID: 0} | ||
120 | + m_IsTrigger: 0 | ||
121 | + m_Enabled: 1 | ||
122 | + serializedVersion: 2 | ||
123 | + m_Size: {x: 1, y: 1, z: 1} | ||
124 | + m_Center: {x: 0, y: 0, z: 0} |
1 | +%YAML 1.1 | ||
2 | +%TAG !u! tag:unity3d.com,2011: | ||
3 | +--- !u!21 &2100000 | ||
4 | +Material: | ||
5 | + serializedVersion: 6 | ||
6 | + m_ObjectHideFlags: 0 | ||
7 | + m_CorrespondingSourceObject: {fileID: 0} | ||
8 | + m_PrefabInstance: {fileID: 0} | ||
9 | + m_PrefabAsset: {fileID: 0} | ||
10 | + m_Name: PlacementIndicator | ||
11 | + m_Shader: {fileID: 10750, guid: 0000000000000000f000000000000000, type: 0} | ||
12 | + m_ShaderKeywords: | ||
13 | + m_LightmapFlags: 4 | ||
14 | + m_EnableInstancingVariants: 0 | ||
15 | + m_DoubleSidedGI: 0 | ||
16 | + m_CustomRenderQueue: -1 | ||
17 | + stringTagMap: {} | ||
18 | + disabledShaderPasses: [] | ||
19 | + m_SavedProperties: | ||
20 | + serializedVersion: 3 | ||
21 | + m_TexEnvs: | ||
22 | + - _BumpMap: | ||
23 | + m_Texture: {fileID: 0} | ||
24 | + m_Scale: {x: 1, y: 1} | ||
25 | + m_Offset: {x: 0, y: 0} | ||
26 | + - _DetailAlbedoMap: | ||
27 | + m_Texture: {fileID: 0} | ||
28 | + m_Scale: {x: 1, y: 1} | ||
29 | + m_Offset: {x: 0, y: 0} | ||
30 | + - _DetailMask: | ||
31 | + m_Texture: {fileID: 0} | ||
32 | + m_Scale: {x: 1, y: 1} | ||
33 | + m_Offset: {x: 0, y: 0} | ||
34 | + - _DetailNormalMap: | ||
35 | + m_Texture: {fileID: 0} | ||
36 | + m_Scale: {x: 1, y: 1} | ||
37 | + m_Offset: {x: 0, y: 0} | ||
38 | + - _EmissionMap: | ||
39 | + m_Texture: {fileID: 0} | ||
40 | + m_Scale: {x: 1, y: 1} | ||
41 | + m_Offset: {x: 0, y: 0} | ||
42 | + - _MainTex: | ||
43 | + m_Texture: {fileID: 2800000, guid: 1a347211d9074b14990f45ba0e4d5796, type: 3} | ||
44 | + m_Scale: {x: 1, y: 1} | ||
45 | + m_Offset: {x: 0, y: 0} | ||
46 | + - _MetallicGlossMap: | ||
47 | + m_Texture: {fileID: 0} | ||
48 | + m_Scale: {x: 1, y: 1} | ||
49 | + m_Offset: {x: 0, y: 0} | ||
50 | + - _OcclusionMap: | ||
51 | + m_Texture: {fileID: 0} | ||
52 | + m_Scale: {x: 1, y: 1} | ||
53 | + m_Offset: {x: 0, y: 0} | ||
54 | + - _ParallaxMap: | ||
55 | + m_Texture: {fileID: 0} | ||
56 | + m_Scale: {x: 1, y: 1} | ||
57 | + m_Offset: {x: 0, y: 0} | ||
58 | + m_Floats: | ||
59 | + - _BumpScale: 1 | ||
60 | + - _Cutoff: 0.5 | ||
61 | + - _DetailNormalMapScale: 1 | ||
62 | + - _DstBlend: 0 | ||
63 | + - _GlossMapScale: 1 | ||
64 | + - _Glossiness: 0.5 | ||
65 | + - _GlossyReflections: 1 | ||
66 | + - _Metallic: 0 | ||
67 | + - _Mode: 0 | ||
68 | + - _OcclusionStrength: 1 | ||
69 | + - _Parallax: 0.02 | ||
70 | + - _SmoothnessTextureChannel: 0 | ||
71 | + - _SpecularHighlights: 1 | ||
72 | + - _SrcBlend: 1 | ||
73 | + - _UVSec: 0 | ||
74 | + - _ZWrite: 1 | ||
75 | + m_Colors: | ||
76 | + - _Color: {r: 1, g: 1, b: 1, a: 1} | ||
77 | + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} |
1 | +%YAML 1.1 | ||
2 | +%TAG !u! tag:unity3d.com,2011: | ||
3 | +--- !u!21 &2100000 | ||
4 | +Material: | ||
5 | + serializedVersion: 6 | ||
6 | + m_ObjectHideFlags: 0 | ||
7 | + m_CorrespondingSourceObject: {fileID: 0} | ||
8 | + m_PrefabInstance: {fileID: 0} | ||
9 | + m_PrefabAsset: {fileID: 0} | ||
10 | + m_Name: PlacementIndicator_2 | ||
11 | + m_Shader: {fileID: 10750, guid: 0000000000000000f000000000000000, type: 0} | ||
12 | + m_ShaderKeywords: | ||
13 | + m_LightmapFlags: 4 | ||
14 | + m_EnableInstancingVariants: 0 | ||
15 | + m_DoubleSidedGI: 0 | ||
16 | + m_CustomRenderQueue: -1 | ||
17 | + stringTagMap: {} | ||
18 | + disabledShaderPasses: [] | ||
19 | + m_SavedProperties: | ||
20 | + serializedVersion: 3 | ||
21 | + m_TexEnvs: | ||
22 | + - _BumpMap: | ||
23 | + m_Texture: {fileID: 0} | ||
24 | + m_Scale: {x: 1, y: 1} | ||
25 | + m_Offset: {x: 0, y: 0} | ||
26 | + - _DetailAlbedoMap: | ||
27 | + m_Texture: {fileID: 0} | ||
28 | + m_Scale: {x: 1, y: 1} | ||
29 | + m_Offset: {x: 0, y: 0} | ||
30 | + - _DetailMask: | ||
31 | + m_Texture: {fileID: 0} | ||
32 | + m_Scale: {x: 1, y: 1} | ||
33 | + m_Offset: {x: 0, y: 0} | ||
34 | + - _DetailNormalMap: | ||
35 | + m_Texture: {fileID: 0} | ||
36 | + m_Scale: {x: 1, y: 1} | ||
37 | + m_Offset: {x: 0, y: 0} | ||
38 | + - _EmissionMap: | ||
39 | + m_Texture: {fileID: 0} | ||
40 | + m_Scale: {x: 1, y: 1} | ||
41 | + m_Offset: {x: 0, y: 0} | ||
42 | + - _MainTex: | ||
43 | + m_Texture: {fileID: 2800000, guid: 276c4e4726da6a148b43ba56f388c1e1, type: 3} | ||
44 | + m_Scale: {x: 1, y: 1} | ||
45 | + m_Offset: {x: 0, y: 0} | ||
46 | + - _MetallicGlossMap: | ||
47 | + m_Texture: {fileID: 0} | ||
48 | + m_Scale: {x: 1, y: 1} | ||
49 | + m_Offset: {x: 0, y: 0} | ||
50 | + - _OcclusionMap: | ||
51 | + m_Texture: {fileID: 0} | ||
52 | + m_Scale: {x: 1, y: 1} | ||
53 | + m_Offset: {x: 0, y: 0} | ||
54 | + - _ParallaxMap: | ||
55 | + m_Texture: {fileID: 0} | ||
56 | + m_Scale: {x: 1, y: 1} | ||
57 | + m_Offset: {x: 0, y: 0} | ||
58 | + m_Floats: | ||
59 | + - _BumpScale: 1 | ||
60 | + - _Cutoff: 0.5 | ||
61 | + - _DetailNormalMapScale: 1 | ||
62 | + - _DstBlend: 0 | ||
63 | + - _GlossMapScale: 1 | ||
64 | + - _Glossiness: 0.5 | ||
65 | + - _GlossyReflections: 1 | ||
66 | + - _Metallic: 0 | ||
67 | + - _Mode: 0 | ||
68 | + - _OcclusionStrength: 1 | ||
69 | + - _Parallax: 0.02 | ||
70 | + - _SmoothnessTextureChannel: 0 | ||
71 | + - _SpecularHighlights: 1 | ||
72 | + - _SrcBlend: 1 | ||
73 | + - _UVSec: 0 | ||
74 | + - _ZWrite: 1 | ||
75 | + m_Colors: | ||
76 | + - _Color: {r: 1, g: 1, b: 1, a: 1} | ||
77 | + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} |
프로젝트/NewAndFurious/Assets/FinalPLan.cs
0 → 100644
1 | +using System.Collections; | ||
2 | +using System.Collections.Generic; | ||
3 | +using UnityEngine; | ||
4 | +using UnityEngine.XR.ARFoundation; | ||
5 | +using UnityEngine.XR; | ||
6 | +using UnityEngine.XR.ARSubsystems; | ||
7 | + | ||
8 | +public class FinalPLan : MonoBehaviour | ||
9 | +{ | ||
10 | + public GameObject PrefabToInstantiate; | ||
11 | + private float sponTime = 0.5f; | ||
12 | + | ||
13 | + | ||
14 | + | ||
15 | + private void Awake() | ||
16 | + { | ||
17 | + | ||
18 | + } | ||
19 | + private void Update() | ||
20 | + { | ||
21 | + | ||
22 | + | ||
23 | + sponTime -= Time.deltaTime; // 리스폰 시간을 깍음. | ||
24 | + if (sponTime < 0) // 리스폰 시간이 0이 되었는지 검사 | ||
25 | + { | ||
26 | + | ||
27 | + var item = GameObject.FindWithTag("HeyBee"); | ||
28 | + Vector3 NNNN = new Vector3(transform.position.x, item.transform.position.y, transform.position.z); | ||
29 | + Instantiate(PrefabToInstantiate, NNNN, transform.rotation); // 생성 | ||
30 | + Debug.Log("PlacemnetIndicator Generate Sucess!"); | ||
31 | + sponTime = 0.5f; | ||
32 | + | ||
33 | + | ||
34 | + // 리스폰시간 초기화 | ||
35 | + } | ||
36 | + | ||
37 | + } | ||
38 | + | ||
39 | +} |
프로젝트/NewAndFurious/Assets/FinalPLan.cs.meta
0 → 100644
프로젝트/NewAndFurious/Assets/HeyBee.png
0 → 100644
58.6 KB
프로젝트/NewAndFurious/Assets/HeyBee.png.meta
0 → 100644
1 | +fileFormatVersion: 2 | ||
2 | +guid: 1a347211d9074b14990f45ba0e4d5796 | ||
3 | +TextureImporter: | ||
4 | + internalIDToNameTable: [] | ||
5 | + externalObjects: {} | ||
6 | + serializedVersion: 11 | ||
7 | + mipmaps: | ||
8 | + mipMapMode: 0 | ||
9 | + enableMipMap: 1 | ||
10 | + sRGBTexture: 1 | ||
11 | + linearTexture: 0 | ||
12 | + fadeOut: 0 | ||
13 | + borderMipMap: 0 | ||
14 | + mipMapsPreserveCoverage: 0 | ||
15 | + alphaTestReferenceValue: 0.5 | ||
16 | + mipMapFadeDistanceStart: 1 | ||
17 | + mipMapFadeDistanceEnd: 3 | ||
18 | + bumpmap: | ||
19 | + convertToNormalMap: 0 | ||
20 | + externalNormalMap: 0 | ||
21 | + heightScale: 0.25 | ||
22 | + normalMapFilter: 0 | ||
23 | + isReadable: 0 | ||
24 | + streamingMipmaps: 0 | ||
25 | + streamingMipmapsPriority: 0 | ||
26 | + grayScaleToAlpha: 0 | ||
27 | + generateCubemap: 6 | ||
28 | + cubemapConvolution: 0 | ||
29 | + seamlessCubemap: 0 | ||
30 | + textureFormat: 1 | ||
31 | + maxTextureSize: 2048 | ||
32 | + textureSettings: | ||
33 | + serializedVersion: 2 | ||
34 | + filterMode: -1 | ||
35 | + aniso: -1 | ||
36 | + mipBias: -100 | ||
37 | + wrapU: -1 | ||
38 | + wrapV: -1 | ||
39 | + wrapW: -1 | ||
40 | + nPOTScale: 1 | ||
41 | + lightmap: 0 | ||
42 | + compressionQuality: 50 | ||
43 | + spriteMode: 0 | ||
44 | + spriteExtrude: 1 | ||
45 | + spriteMeshType: 1 | ||
46 | + alignment: 0 | ||
47 | + spritePivot: {x: 0.5, y: 0.5} | ||
48 | + spritePixelsToUnits: 100 | ||
49 | + spriteBorder: {x: 0, y: 0, z: 0, w: 0} | ||
50 | + spriteGenerateFallbackPhysicsShape: 1 | ||
51 | + alphaUsage: 1 | ||
52 | + alphaIsTransparency: 0 | ||
53 | + spriteTessellationDetail: -1 | ||
54 | + textureType: 0 | ||
55 | + textureShape: 1 | ||
56 | + singleChannelComponent: 0 | ||
57 | + maxTextureSizeSet: 0 | ||
58 | + compressionQualitySet: 0 | ||
59 | + textureFormatSet: 0 | ||
60 | + applyGammaDecoding: 0 | ||
61 | + platformSettings: | ||
62 | + - serializedVersion: 3 | ||
63 | + buildTarget: DefaultTexturePlatform | ||
64 | + maxTextureSize: 2048 | ||
65 | + resizeAlgorithm: 0 | ||
66 | + textureFormat: -1 | ||
67 | + textureCompression: 1 | ||
68 | + compressionQuality: 50 | ||
69 | + crunchedCompression: 0 | ||
70 | + allowsAlphaSplitting: 0 | ||
71 | + overridden: 0 | ||
72 | + androidETC2FallbackOverride: 0 | ||
73 | + forceMaximumCompressionQuality_BC6H_BC7: 0 | ||
74 | + spriteSheet: | ||
75 | + serializedVersion: 2 | ||
76 | + sprites: [] | ||
77 | + outline: [] | ||
78 | + physicsShape: [] | ||
79 | + bones: [] | ||
80 | + spriteID: | ||
81 | + internalID: 0 | ||
82 | + vertices: [] | ||
83 | + indices: | ||
84 | + edges: [] | ||
85 | + weights: [] | ||
86 | + secondaryTextures: [] | ||
87 | + spritePackingTag: | ||
88 | + pSDRemoveMatte: 0 | ||
89 | + pSDShowRemoveMatteOption: 0 | ||
90 | + userData: | ||
91 | + assetBundleName: | ||
92 | + assetBundleVariant: |
1 | +using System.Collections; | ||
2 | +using System.Collections.Generic; | ||
3 | +using UnityEngine; | ||
4 | +using UnityEngine.XR; | ||
5 | +using UnityEngine.XR.ARFoundation; | ||
6 | + | ||
7 | +public class ImageRecognitionExample : MonoBehaviour | ||
8 | +{ | ||
9 | + private ARTrackedImageManager _arTrackedImageManager; | ||
10 | + | ||
11 | + private void Awake() | ||
12 | + { | ||
13 | + _arTrackedImageManager = FindObjectOfType<ARTrackedImageManager>(); | ||
14 | + } | ||
15 | + | ||
16 | + private void OnEnable() | ||
17 | + { | ||
18 | + _arTrackedImageManager.trackedImagesChanged += OnImageChanged; | ||
19 | + } | ||
20 | + | ||
21 | + private void OnDisable() | ||
22 | + { | ||
23 | + _arTrackedImageManager.trackedImagesChanged -= OnImageChanged; | ||
24 | + | ||
25 | + } | ||
26 | + | ||
27 | + public void OnImageChanged(ARTrackedImagesChangedEventArgs args) | ||
28 | + { | ||
29 | + foreach (var trackedImage in args.added) | ||
30 | + { | ||
31 | + Debug.Log(trackedImage.name); | ||
32 | + } | ||
33 | + } | ||
34 | +} |
프로젝트/NewAndFurious/Assets/MakePlaneColor.cs
0 → 100644
1 | +using System.Collections; | ||
2 | +using System.Collections.Generic; | ||
3 | +using UnityEngine; | ||
4 | +using UnityEngine.XR.ARFoundation; | ||
5 | +using UnityEngine.XR.ARSubsystems; | ||
6 | + | ||
7 | + | ||
8 | +[RequireComponent(typeof(ARRaycastManager))] | ||
9 | +public class MakePlaneColor : MonoBehaviour | ||
10 | +{ | ||
11 | + public GameObject gameObjectToInstantiate; | ||
12 | + | ||
13 | + private GameObject spawnedObject; | ||
14 | + private ARRaycastManager _arRaycastManager; | ||
15 | + private Vector2 touchPosition; | ||
16 | + | ||
17 | + static List<ARRaycastHit> hits = new List<ARRaycastHit>(); | ||
18 | + | ||
19 | + private void Awake() | ||
20 | + { | ||
21 | + _arRaycastManager = GetComponent<ARRaycastManager>(); | ||
22 | + } | ||
23 | + | ||
24 | + bool TryGetTouchPosition(out Vector2 touchPosition) | ||
25 | + { | ||
26 | + if (Input.touchCount > 0) | ||
27 | + { | ||
28 | + touchPosition = Input.GetTouch(0).position; | ||
29 | + return true; | ||
30 | + } | ||
31 | + | ||
32 | + touchPosition = default; | ||
33 | + return false; | ||
34 | + } | ||
35 | + | ||
36 | + | ||
37 | + // Update is called once per frame | ||
38 | + void Update() | ||
39 | + { | ||
40 | + if (!TryGetTouchPosition(out Vector2 touchPosition)) | ||
41 | + return; | ||
42 | + if (_arRaycastManager.Raycast(touchPosition, hits, TrackableType.PlaneWithinPolygon)) | ||
43 | + { | ||
44 | + var hitPose = hits[0].pose; | ||
45 | + | ||
46 | + if (spawnedObject == null) | ||
47 | + { | ||
48 | + spawnedObject = Instantiate(gameObjectToInstantiate, hitPose.position, hitPose.rotation); | ||
49 | + } | ||
50 | + else | ||
51 | + { | ||
52 | + spawnedObject.transform.position = hitPose.position; | ||
53 | + } | ||
54 | + } | ||
55 | + | ||
56 | + } | ||
57 | +} |
프로젝트/NewAndFurious/Assets/Materials.meta
0 → 100644
1 | +%YAML 1.1 | ||
2 | +%TAG !u! tag:unity3d.com,2011: | ||
3 | +--- !u!21 &2100000 | ||
4 | +Material: | ||
5 | + serializedVersion: 6 | ||
6 | + m_ObjectHideFlags: 0 | ||
7 | + m_CorrespondingSourceObject: {fileID: 0} | ||
8 | + m_PrefabInstance: {fileID: 0} | ||
9 | + m_PrefabAsset: {fileID: 0} | ||
10 | + m_Name: Visualizer | ||
11 | + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} | ||
12 | + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON | ||
13 | + m_LightmapFlags: 4 | ||
14 | + m_EnableInstancingVariants: 0 | ||
15 | + m_DoubleSidedGI: 0 | ||
16 | + m_CustomRenderQueue: 3000 | ||
17 | + stringTagMap: | ||
18 | + RenderType: Transparent | ||
19 | + disabledShaderPasses: [] | ||
20 | + m_SavedProperties: | ||
21 | + serializedVersion: 3 | ||
22 | + m_TexEnvs: | ||
23 | + - _BumpMap: | ||
24 | + m_Texture: {fileID: 0} | ||
25 | + m_Scale: {x: 1, y: 1} | ||
26 | + m_Offset: {x: 0, y: 0} | ||
27 | + - _DetailAlbedoMap: | ||
28 | + m_Texture: {fileID: 0} | ||
29 | + m_Scale: {x: 1, y: 1} | ||
30 | + m_Offset: {x: 0, y: 0} | ||
31 | + - _DetailMask: | ||
32 | + m_Texture: {fileID: 0} | ||
33 | + m_Scale: {x: 1, y: 1} | ||
34 | + m_Offset: {x: 0, y: 0} | ||
35 | + - _DetailNormalMap: | ||
36 | + m_Texture: {fileID: 0} | ||
37 | + m_Scale: {x: 1, y: 1} | ||
38 | + m_Offset: {x: 0, y: 0} | ||
39 | + - _EmissionMap: | ||
40 | + m_Texture: {fileID: 0} | ||
41 | + m_Scale: {x: 1, y: 1} | ||
42 | + m_Offset: {x: 0, y: 0} | ||
43 | + - _MainTex: | ||
44 | + m_Texture: {fileID: 0} | ||
45 | + m_Scale: {x: 1, y: 1} | ||
46 | + m_Offset: {x: 0, y: 0} | ||
47 | + - _MetallicGlossMap: | ||
48 | + m_Texture: {fileID: 0} | ||
49 | + m_Scale: {x: 1, y: 1} | ||
50 | + m_Offset: {x: 0, y: 0} | ||
51 | + - _OcclusionMap: | ||
52 | + m_Texture: {fileID: 0} | ||
53 | + m_Scale: {x: 1, y: 1} | ||
54 | + m_Offset: {x: 0, y: 0} | ||
55 | + - _ParallaxMap: | ||
56 | + m_Texture: {fileID: 0} | ||
57 | + m_Scale: {x: 1, y: 1} | ||
58 | + m_Offset: {x: 0, y: 0} | ||
59 | + m_Floats: | ||
60 | + - _BumpScale: 1 | ||
61 | + - _Cutoff: 0.5 | ||
62 | + - _DetailNormalMapScale: 1 | ||
63 | + - _DstBlend: 10 | ||
64 | + - _GlossMapScale: 1 | ||
65 | + - _Glossiness: 0.5 | ||
66 | + - _GlossyReflections: 1 | ||
67 | + - _Metallic: 0 | ||
68 | + - _Mode: 3 | ||
69 | + - _OcclusionStrength: 1 | ||
70 | + - _Parallax: 0.02 | ||
71 | + - _SmoothnessTextureChannel: 0 | ||
72 | + - _SpecularHighlights: 1 | ||
73 | + - _SrcBlend: 1 | ||
74 | + - _UVSec: 0 | ||
75 | + - _ZWrite: 0 | ||
76 | + m_Colors: | ||
77 | + - _Color: {r: 1, g: 1, b: 1, a: 0.27450982} | ||
78 | + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} |
1 | +%YAML 1.1 | ||
2 | +%TAG !u! tag:unity3d.com,2011: | ||
3 | +--- !u!21 &2100000 | ||
4 | +Material: | ||
5 | + serializedVersion: 6 | ||
6 | + m_ObjectHideFlags: 0 | ||
7 | + m_CorrespondingSourceObject: {fileID: 0} | ||
8 | + m_PrefabInstance: {fileID: 0} | ||
9 | + m_PrefabAsset: {fileID: 0} | ||
10 | + m_Name: Visualizer2 | ||
11 | + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} | ||
12 | + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON | ||
13 | + m_LightmapFlags: 4 | ||
14 | + m_EnableInstancingVariants: 0 | ||
15 | + m_DoubleSidedGI: 0 | ||
16 | + m_CustomRenderQueue: 3000 | ||
17 | + stringTagMap: | ||
18 | + RenderType: Transparent | ||
19 | + disabledShaderPasses: [] | ||
20 | + m_SavedProperties: | ||
21 | + serializedVersion: 3 | ||
22 | + m_TexEnvs: | ||
23 | + - _BumpMap: | ||
24 | + m_Texture: {fileID: 0} | ||
25 | + m_Scale: {x: 1, y: 1} | ||
26 | + m_Offset: {x: 0, y: 0} | ||
27 | + - _DetailAlbedoMap: | ||
28 | + m_Texture: {fileID: 0} | ||
29 | + m_Scale: {x: 1, y: 1} | ||
30 | + m_Offset: {x: 0, y: 0} | ||
31 | + - _DetailMask: | ||
32 | + m_Texture: {fileID: 0} | ||
33 | + m_Scale: {x: 1, y: 1} | ||
34 | + m_Offset: {x: 0, y: 0} | ||
35 | + - _DetailNormalMap: | ||
36 | + m_Texture: {fileID: 0} | ||
37 | + m_Scale: {x: 1, y: 1} | ||
38 | + m_Offset: {x: 0, y: 0} | ||
39 | + - _EmissionMap: | ||
40 | + m_Texture: {fileID: 0} | ||
41 | + m_Scale: {x: 1, y: 1} | ||
42 | + m_Offset: {x: 0, y: 0} | ||
43 | + - _MainTex: | ||
44 | + m_Texture: {fileID: 0} | ||
45 | + m_Scale: {x: 1, y: 1} | ||
46 | + m_Offset: {x: 0, y: 0} | ||
47 | + - _MetallicGlossMap: | ||
48 | + m_Texture: {fileID: 0} | ||
49 | + m_Scale: {x: 1, y: 1} | ||
50 | + m_Offset: {x: 0, y: 0} | ||
51 | + - _OcclusionMap: | ||
52 | + m_Texture: {fileID: 0} | ||
53 | + m_Scale: {x: 1, y: 1} | ||
54 | + m_Offset: {x: 0, y: 0} | ||
55 | + - _ParallaxMap: | ||
56 | + m_Texture: {fileID: 0} | ||
57 | + m_Scale: {x: 1, y: 1} | ||
58 | + m_Offset: {x: 0, y: 0} | ||
59 | + m_Floats: | ||
60 | + - _BumpScale: 1 | ||
61 | + - _Cutoff: 0.5 | ||
62 | + - _DetailNormalMapScale: 1 | ||
63 | + - _DstBlend: 10 | ||
64 | + - _GlossMapScale: 1 | ||
65 | + - _Glossiness: 0.5 | ||
66 | + - _GlossyReflections: 1 | ||
67 | + - _Metallic: 0 | ||
68 | + - _Mode: 3 | ||
69 | + - _OcclusionStrength: 1 | ||
70 | + - _Parallax: 0.02 | ||
71 | + - _SmoothnessTextureChannel: 0 | ||
72 | + - _SpecularHighlights: 1 | ||
73 | + - _SrcBlend: 1 | ||
74 | + - _UVSec: 0 | ||
75 | + - _ZWrite: 0 | ||
76 | + m_Colors: | ||
77 | + - _Color: {r: 0, g: 0.31863594, b: 1, a: 0.27450982} | ||
78 | + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} |
프로젝트/NewAndFurious/Assets/Prefabs.meta
0 → 100644
1 | +%YAML 1.1 | ||
2 | +%TAG !u! tag:unity3d.com,2011: | ||
3 | +--- !u!1 &8572943399424948391 | ||
4 | +GameObject: | ||
5 | + m_ObjectHideFlags: 0 | ||
6 | + m_CorrespondingSourceObject: {fileID: 0} | ||
7 | + m_PrefabInstance: {fileID: 0} | ||
8 | + m_PrefabAsset: {fileID: 0} | ||
9 | + serializedVersion: 6 | ||
10 | + m_Component: | ||
11 | + - component: {fileID: 8230380940538504422} | ||
12 | + - component: {fileID: 6414193907150849304} | ||
13 | + - component: {fileID: 6901249324319875320} | ||
14 | + - component: {fileID: 8458829766186277930} | ||
15 | + - component: {fileID: 7777063999342426469} | ||
16 | + - component: {fileID: 6856376542911430689} | ||
17 | + - component: {fileID: 1734348606672184616} | ||
18 | + m_Layer: 0 | ||
19 | + m_Name: ARPlane | ||
20 | + m_TagString: Untagged | ||
21 | + m_Icon: {fileID: 0} | ||
22 | + m_NavMeshLayer: 0 | ||
23 | + m_StaticEditorFlags: 0 | ||
24 | + m_IsActive: 1 | ||
25 | +--- !u!4 &8230380940538504422 | ||
26 | +Transform: | ||
27 | + m_ObjectHideFlags: 0 | ||
28 | + m_CorrespondingSourceObject: {fileID: 0} | ||
29 | + m_PrefabInstance: {fileID: 0} | ||
30 | + m_PrefabAsset: {fileID: 0} | ||
31 | + m_GameObject: {fileID: 8572943399424948391} | ||
32 | + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} | ||
33 | + m_LocalPosition: {x: 0, y: 0, z: 0} | ||
34 | + m_LocalScale: {x: 1, y: 1, z: 1} | ||
35 | + m_Children: [] | ||
36 | + m_Father: {fileID: 0} | ||
37 | + m_RootOrder: 0 | ||
38 | + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||
39 | +--- !u!114 &6414193907150849304 | ||
40 | +MonoBehaviour: | ||
41 | + m_ObjectHideFlags: 0 | ||
42 | + m_CorrespondingSourceObject: {fileID: 0} | ||
43 | + m_PrefabInstance: {fileID: 0} | ||
44 | + m_PrefabAsset: {fileID: 0} | ||
45 | + m_GameObject: {fileID: 8572943399424948391} | ||
46 | + m_Enabled: 1 | ||
47 | + m_EditorHideFlags: 0 | ||
48 | + m_Script: {fileID: 11500000, guid: 5f66da7470dce8f4d821d71dd2b1d4ac, type: 3} | ||
49 | + m_Name: | ||
50 | + m_EditorClassIdentifier: | ||
51 | + m_DestroyOnRemoval: 1 | ||
52 | + m_VertexChangedThreshold: 0.01 | ||
53 | +--- !u!114 &6901249324319875320 | ||
54 | +MonoBehaviour: | ||
55 | + m_ObjectHideFlags: 0 | ||
56 | + m_CorrespondingSourceObject: {fileID: 0} | ||
57 | + m_PrefabInstance: {fileID: 0} | ||
58 | + m_PrefabAsset: {fileID: 0} | ||
59 | + m_GameObject: {fileID: 8572943399424948391} | ||
60 | + m_Enabled: 1 | ||
61 | + m_EditorHideFlags: 0 | ||
62 | + m_Script: {fileID: 11500000, guid: 3d180956a54db4646a1c6342921672ad, type: 3} | ||
63 | + m_Name: | ||
64 | + m_EditorClassIdentifier: | ||
65 | +--- !u!64 &8458829766186277930 | ||
66 | +MeshCollider: | ||
67 | + m_ObjectHideFlags: 0 | ||
68 | + m_CorrespondingSourceObject: {fileID: 0} | ||
69 | + m_PrefabInstance: {fileID: 0} | ||
70 | + m_PrefabAsset: {fileID: 0} | ||
71 | + m_GameObject: {fileID: 8572943399424948391} | ||
72 | + m_Material: {fileID: 0} | ||
73 | + m_IsTrigger: 0 | ||
74 | + m_Enabled: 1 | ||
75 | + serializedVersion: 4 | ||
76 | + m_Convex: 0 | ||
77 | + m_CookingOptions: 30 | ||
78 | + m_Mesh: {fileID: 0} | ||
79 | +--- !u!33 &7777063999342426469 | ||
80 | +MeshFilter: | ||
81 | + m_ObjectHideFlags: 0 | ||
82 | + m_CorrespondingSourceObject: {fileID: 0} | ||
83 | + m_PrefabInstance: {fileID: 0} | ||
84 | + m_PrefabAsset: {fileID: 0} | ||
85 | + m_GameObject: {fileID: 8572943399424948391} | ||
86 | + m_Mesh: {fileID: 0} | ||
87 | +--- !u!23 &6856376542911430689 | ||
88 | +MeshRenderer: | ||
89 | + m_ObjectHideFlags: 0 | ||
90 | + m_CorrespondingSourceObject: {fileID: 0} | ||
91 | + m_PrefabInstance: {fileID: 0} | ||
92 | + m_PrefabAsset: {fileID: 0} | ||
93 | + m_GameObject: {fileID: 8572943399424948391} | ||
94 | + m_Enabled: 1 | ||
95 | + m_CastShadows: 1 | ||
96 | + m_ReceiveShadows: 1 | ||
97 | + m_DynamicOccludee: 1 | ||
98 | + m_MotionVectors: 1 | ||
99 | + m_LightProbeUsage: 1 | ||
100 | + m_ReflectionProbeUsage: 1 | ||
101 | + m_RayTracingMode: 2 | ||
102 | + m_RenderingLayerMask: 1 | ||
103 | + m_RendererPriority: 0 | ||
104 | + m_Materials: | ||
105 | + - {fileID: 2100000, guid: 6574dd7043e33924c93430c58b5798e9, type: 2} | ||
106 | + m_StaticBatchInfo: | ||
107 | + firstSubMesh: 0 | ||
108 | + subMeshCount: 0 | ||
109 | + m_StaticBatchRoot: {fileID: 0} | ||
110 | + m_ProbeAnchor: {fileID: 0} | ||
111 | + m_LightProbeVolumeOverride: {fileID: 0} | ||
112 | + m_ScaleInLightmap: 1 | ||
113 | + m_ReceiveGI: 1 | ||
114 | + m_PreserveUVs: 0 | ||
115 | + m_IgnoreNormalsForChartDetection: 0 | ||
116 | + m_ImportantGI: 0 | ||
117 | + m_StitchLightmapSeams: 1 | ||
118 | + m_SelectedEditorRenderState: 3 | ||
119 | + m_MinimumChartSize: 4 | ||
120 | + m_AutoUVMaxDistance: 0.5 | ||
121 | + m_AutoUVMaxAngle: 89 | ||
122 | + m_LightmapParameters: {fileID: 0} | ||
123 | + m_SortingLayerID: 0 | ||
124 | + m_SortingLayer: 0 | ||
125 | + m_SortingOrder: 0 | ||
126 | +--- !u!120 &1734348606672184616 | ||
127 | +LineRenderer: | ||
128 | + m_ObjectHideFlags: 0 | ||
129 | + m_CorrespondingSourceObject: {fileID: 0} | ||
130 | + m_PrefabInstance: {fileID: 0} | ||
131 | + m_PrefabAsset: {fileID: 0} | ||
132 | + m_GameObject: {fileID: 8572943399424948391} | ||
133 | + m_Enabled: 1 | ||
134 | + m_CastShadows: 0 | ||
135 | + m_ReceiveShadows: 0 | ||
136 | + m_DynamicOccludee: 1 | ||
137 | + m_MotionVectors: 0 | ||
138 | + m_LightProbeUsage: 0 | ||
139 | + m_ReflectionProbeUsage: 0 | ||
140 | + m_RayTracingMode: 0 | ||
141 | + m_RenderingLayerMask: 1 | ||
142 | + m_RendererPriority: 0 | ||
143 | + m_Materials: | ||
144 | + - {fileID: 10306, guid: 0000000000000000f000000000000000, type: 0} | ||
145 | + m_StaticBatchInfo: | ||
146 | + firstSubMesh: 0 | ||
147 | + subMeshCount: 0 | ||
148 | + m_StaticBatchRoot: {fileID: 0} | ||
149 | + m_ProbeAnchor: {fileID: 0} | ||
150 | + m_LightProbeVolumeOverride: {fileID: 0} | ||
151 | + m_ScaleInLightmap: 1 | ||
152 | + m_ReceiveGI: 1 | ||
153 | + m_PreserveUVs: 0 | ||
154 | + m_IgnoreNormalsForChartDetection: 0 | ||
155 | + m_ImportantGI: 0 | ||
156 | + m_StitchLightmapSeams: 1 | ||
157 | + m_SelectedEditorRenderState: 3 | ||
158 | + m_MinimumChartSize: 4 | ||
159 | + m_AutoUVMaxDistance: 0.5 | ||
160 | + m_AutoUVMaxAngle: 89 | ||
161 | + m_LightmapParameters: {fileID: 0} | ||
162 | + m_SortingLayerID: 0 | ||
163 | + m_SortingLayer: 0 | ||
164 | + m_SortingOrder: 0 | ||
165 | + m_Positions: | ||
166 | + - {x: 0, y: 0, z: 0} | ||
167 | + - {x: 0, y: 0, z: 1} | ||
168 | + m_Parameters: | ||
169 | + serializedVersion: 3 | ||
170 | + widthMultiplier: 0.01 | ||
171 | + widthCurve: | ||
172 | + serializedVersion: 2 | ||
173 | + m_Curve: | ||
174 | + - serializedVersion: 3 | ||
175 | + time: 0 | ||
176 | + value: 1 | ||
177 | + inSlope: 0 | ||
178 | + outSlope: 0 | ||
179 | + tangentMode: 0 | ||
180 | + weightedMode: 0 | ||
181 | + inWeight: 0.33333334 | ||
182 | + outWeight: 0.33333334 | ||
183 | + m_PreInfinity: 2 | ||
184 | + m_PostInfinity: 2 | ||
185 | + m_RotationOrder: 4 | ||
186 | + colorGradient: | ||
187 | + serializedVersion: 2 | ||
188 | + key0: {r: 0.28721562, g: 0.015686274, b: 1, a: 1} | ||
189 | + key1: {r: 0, g: 0.594635, b: 1, a: 1} | ||
190 | + key2: {r: 0, g: 0.594635, b: 1, a: 0} | ||
191 | + key3: {r: 0, g: 0.594635, b: 1, a: 0} | ||
192 | + key4: {r: 0, g: 0, b: 0, a: 0} | ||
193 | + key5: {r: 0, g: 0, b: 0, a: 0} | ||
194 | + key6: {r: 0, g: 0, b: 0, a: 0} | ||
195 | + key7: {r: 0, g: 0, b: 0, a: 0} | ||
196 | + ctime0: 0 | ||
197 | + ctime1: 65535 | ||
198 | + ctime2: 65535 | ||
199 | + ctime3: 65535 | ||
200 | + ctime4: 0 | ||
201 | + ctime5: 0 | ||
202 | + ctime6: 0 | ||
203 | + ctime7: 0 | ||
204 | + atime0: 0 | ||
205 | + atime1: 65535 | ||
206 | + atime2: 0 | ||
207 | + atime3: 0 | ||
208 | + atime4: 0 | ||
209 | + atime5: 0 | ||
210 | + atime6: 0 | ||
211 | + atime7: 0 | ||
212 | + m_Mode: 0 | ||
213 | + m_NumColorKeys: 2 | ||
214 | + m_NumAlphaKeys: 2 | ||
215 | + numCornerVertices: 4 | ||
216 | + numCapVertices: 4 | ||
217 | + alignment: 0 | ||
218 | + textureMode: 0 | ||
219 | + shadowBias: 0.5 | ||
220 | + generateLightingData: 0 | ||
221 | + m_UseWorldSpace: 0 | ||
222 | + m_Loop: 0 |
1 | +using System.Collections; | ||
2 | +using System.Collections.Generic; | ||
3 | +using UnityEngine; | ||
4 | + | ||
5 | +public class ColorChange : MonoBehaviour | ||
6 | +{ | ||
7 | + | ||
8 | + MeshRenderer mesh; | ||
9 | + Material mat; | ||
10 | + | ||
11 | + void Start() | ||
12 | + { | ||
13 | + mesh = GetComponent<MeshRenderer>(); | ||
14 | + mat = mesh.material; | ||
15 | + } | ||
16 | + private void Update() | ||
17 | + { | ||
18 | + | ||
19 | + } | ||
20 | + | ||
21 | + private void OnCollisionEnter(Collision collision) | ||
22 | + { | ||
23 | + Debug.Log("충돌"); | ||
24 | + mat.color = new Color(1, 0, 0); | ||
25 | + } | ||
26 | + | ||
27 | +} | ||
28 | + |
1 | +%YAML 1.1 | ||
2 | +%TAG !u! tag:unity3d.com,2011: | ||
3 | +--- !u!1 &275043505709825487 | ||
4 | +GameObject: | ||
5 | + m_ObjectHideFlags: 0 | ||
6 | + m_CorrespondingSourceObject: {fileID: 0} | ||
7 | + m_PrefabInstance: {fileID: 0} | ||
8 | + m_PrefabAsset: {fileID: 0} | ||
9 | + serializedVersion: 6 | ||
10 | + m_Component: | ||
11 | + - component: {fileID: 275043505709825483} | ||
12 | + - component: {fileID: 275043505709825480} | ||
13 | + - component: {fileID: 275043505709825481} | ||
14 | + - component: {fileID: 275043505709825486} | ||
15 | + - component: {fileID: 1390676110750850629} | ||
16 | + m_Layer: 0 | ||
17 | + m_Name: Cube | ||
18 | + m_TagString: Untagged | ||
19 | + m_Icon: {fileID: 0} | ||
20 | + m_NavMeshLayer: 0 | ||
21 | + m_StaticEditorFlags: 0 | ||
22 | + m_IsActive: 1 | ||
23 | +--- !u!4 &275043505709825483 | ||
24 | +Transform: | ||
25 | + m_ObjectHideFlags: 0 | ||
26 | + m_CorrespondingSourceObject: {fileID: 0} | ||
27 | + m_PrefabInstance: {fileID: 0} | ||
28 | + m_PrefabAsset: {fileID: 0} | ||
29 | + m_GameObject: {fileID: 275043505709825487} | ||
30 | + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} | ||
31 | + m_LocalPosition: {x: 0, y: 0, z: 0} | ||
32 | + m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} | ||
33 | + m_Children: [] | ||
34 | + m_Father: {fileID: 0} | ||
35 | + m_RootOrder: 0 | ||
36 | + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||
37 | +--- !u!33 &275043505709825480 | ||
38 | +MeshFilter: | ||
39 | + m_ObjectHideFlags: 0 | ||
40 | + m_CorrespondingSourceObject: {fileID: 0} | ||
41 | + m_PrefabInstance: {fileID: 0} | ||
42 | + m_PrefabAsset: {fileID: 0} | ||
43 | + m_GameObject: {fileID: 275043505709825487} | ||
44 | + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} | ||
45 | +--- !u!23 &275043505709825481 | ||
46 | +MeshRenderer: | ||
47 | + m_ObjectHideFlags: 0 | ||
48 | + m_CorrespondingSourceObject: {fileID: 0} | ||
49 | + m_PrefabInstance: {fileID: 0} | ||
50 | + m_PrefabAsset: {fileID: 0} | ||
51 | + m_GameObject: {fileID: 275043505709825487} | ||
52 | + m_Enabled: 1 | ||
53 | + m_CastShadows: 1 | ||
54 | + m_ReceiveShadows: 1 | ||
55 | + m_DynamicOccludee: 1 | ||
56 | + m_MotionVectors: 1 | ||
57 | + m_LightProbeUsage: 1 | ||
58 | + m_ReflectionProbeUsage: 1 | ||
59 | + m_RayTracingMode: 2 | ||
60 | + m_RenderingLayerMask: 1 | ||
61 | + m_RendererPriority: 0 | ||
62 | + m_Materials: | ||
63 | + - {fileID: 2100000, guid: c65f0a93e557b904582ebd86151d51ea, type: 2} | ||
64 | + m_StaticBatchInfo: | ||
65 | + firstSubMesh: 0 | ||
66 | + subMeshCount: 0 | ||
67 | + m_StaticBatchRoot: {fileID: 0} | ||
68 | + m_ProbeAnchor: {fileID: 0} | ||
69 | + m_LightProbeVolumeOverride: {fileID: 0} | ||
70 | + m_ScaleInLightmap: 1 | ||
71 | + m_ReceiveGI: 1 | ||
72 | + m_PreserveUVs: 0 | ||
73 | + m_IgnoreNormalsForChartDetection: 0 | ||
74 | + m_ImportantGI: 0 | ||
75 | + m_StitchLightmapSeams: 1 | ||
76 | + m_SelectedEditorRenderState: 3 | ||
77 | + m_MinimumChartSize: 4 | ||
78 | + m_AutoUVMaxDistance: 0.5 | ||
79 | + m_AutoUVMaxAngle: 89 | ||
80 | + m_LightmapParameters: {fileID: 0} | ||
81 | + m_SortingLayerID: 0 | ||
82 | + m_SortingLayer: 0 | ||
83 | + m_SortingOrder: 0 | ||
84 | +--- !u!65 &275043505709825486 | ||
85 | +BoxCollider: | ||
86 | + m_ObjectHideFlags: 0 | ||
87 | + m_CorrespondingSourceObject: {fileID: 0} | ||
88 | + m_PrefabInstance: {fileID: 0} | ||
89 | + m_PrefabAsset: {fileID: 0} | ||
90 | + m_GameObject: {fileID: 275043505709825487} | ||
91 | + m_Material: {fileID: 0} | ||
92 | + m_IsTrigger: 0 | ||
93 | + m_Enabled: 1 | ||
94 | + serializedVersion: 2 | ||
95 | + m_Size: {x: 2, y: 2, z: 2} | ||
96 | + m_Center: {x: 0, y: 0, z: 0} | ||
97 | +--- !u!114 &1390676110750850629 | ||
98 | +MonoBehaviour: | ||
99 | + m_ObjectHideFlags: 0 | ||
100 | + m_CorrespondingSourceObject: {fileID: 0} | ||
101 | + m_PrefabInstance: {fileID: 0} | ||
102 | + m_PrefabAsset: {fileID: 0} | ||
103 | + m_GameObject: {fileID: 275043505709825487} | ||
104 | + m_Enabled: 1 | ||
105 | + m_EditorHideFlags: 0 | ||
106 | + m_Script: {fileID: 11500000, guid: fd6f278c2997a064aac10352bac67407, type: 3} | ||
107 | + m_Name: | ||
108 | + m_EditorClassIdentifier: |
1 | +%YAML 1.1 | ||
2 | +%TAG !u! tag:unity3d.com,2011: | ||
3 | +--- !u!1 &1694644481791102473 | ||
4 | +GameObject: | ||
5 | + m_ObjectHideFlags: 0 | ||
6 | + m_CorrespondingSourceObject: {fileID: 0} | ||
7 | + m_PrefabInstance: {fileID: 0} | ||
8 | + m_PrefabAsset: {fileID: 0} | ||
9 | + serializedVersion: 6 | ||
10 | + m_Component: | ||
11 | + - component: {fileID: 7764804282280814968} | ||
12 | + - component: {fileID: 5819071639410241156} | ||
13 | + - component: {fileID: 4549434547178058856} | ||
14 | + - component: {fileID: 4223524825986161770} | ||
15 | + m_Layer: 0 | ||
16 | + m_Name: Quad | ||
17 | + m_TagString: Untagged | ||
18 | + m_Icon: {fileID: 0} | ||
19 | + m_NavMeshLayer: 0 | ||
20 | + m_StaticEditorFlags: 0 | ||
21 | + m_IsActive: 1 | ||
22 | +--- !u!4 &7764804282280814968 | ||
23 | +Transform: | ||
24 | + m_ObjectHideFlags: 0 | ||
25 | + m_CorrespondingSourceObject: {fileID: 0} | ||
26 | + m_PrefabInstance: {fileID: 0} | ||
27 | + m_PrefabAsset: {fileID: 0} | ||
28 | + m_GameObject: {fileID: 1694644481791102473} | ||
29 | + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} | ||
30 | + m_LocalPosition: {x: 0, y: 0, z: 0} | ||
31 | + m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} | ||
32 | + m_Children: [] | ||
33 | + m_Father: {fileID: 3847587717169254739} | ||
34 | + m_RootOrder: 0 | ||
35 | + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} | ||
36 | +--- !u!33 &5819071639410241156 | ||
37 | +MeshFilter: | ||
38 | + m_ObjectHideFlags: 0 | ||
39 | + m_CorrespondingSourceObject: {fileID: 0} | ||
40 | + m_PrefabInstance: {fileID: 0} | ||
41 | + m_PrefabAsset: {fileID: 0} | ||
42 | + m_GameObject: {fileID: 1694644481791102473} | ||
43 | + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} | ||
44 | +--- !u!23 &4549434547178058856 | ||
45 | +MeshRenderer: | ||
46 | + m_ObjectHideFlags: 0 | ||
47 | + m_CorrespondingSourceObject: {fileID: 0} | ||
48 | + m_PrefabInstance: {fileID: 0} | ||
49 | + m_PrefabAsset: {fileID: 0} | ||
50 | + m_GameObject: {fileID: 1694644481791102473} | ||
51 | + m_Enabled: 1 | ||
52 | + m_CastShadows: 1 | ||
53 | + m_ReceiveShadows: 1 | ||
54 | + m_DynamicOccludee: 1 | ||
55 | + m_MotionVectors: 1 | ||
56 | + m_LightProbeUsage: 1 | ||
57 | + m_ReflectionProbeUsage: 1 | ||
58 | + m_RayTracingMode: 2 | ||
59 | + m_RenderingLayerMask: 1 | ||
60 | + m_RendererPriority: 0 | ||
61 | + m_Materials: | ||
62 | + - {fileID: 2100000, guid: 0252f8fdc4e801244aba3d32e4532c25, type: 2} | ||
63 | + m_StaticBatchInfo: | ||
64 | + firstSubMesh: 0 | ||
65 | + subMeshCount: 0 | ||
66 | + m_StaticBatchRoot: {fileID: 0} | ||
67 | + m_ProbeAnchor: {fileID: 0} | ||
68 | + m_LightProbeVolumeOverride: {fileID: 0} | ||
69 | + m_ScaleInLightmap: 1 | ||
70 | + m_ReceiveGI: 1 | ||
71 | + m_PreserveUVs: 0 | ||
72 | + m_IgnoreNormalsForChartDetection: 0 | ||
73 | + m_ImportantGI: 0 | ||
74 | + m_StitchLightmapSeams: 1 | ||
75 | + m_SelectedEditorRenderState: 3 | ||
76 | + m_MinimumChartSize: 4 | ||
77 | + m_AutoUVMaxDistance: 0.5 | ||
78 | + m_AutoUVMaxAngle: 89 | ||
79 | + m_LightmapParameters: {fileID: 0} | ||
80 | + m_SortingLayerID: 0 | ||
81 | + m_SortingLayer: 0 | ||
82 | + m_SortingOrder: 0 | ||
83 | +--- !u!64 &4223524825986161770 | ||
84 | +MeshCollider: | ||
85 | + m_ObjectHideFlags: 0 | ||
86 | + m_CorrespondingSourceObject: {fileID: 0} | ||
87 | + m_PrefabInstance: {fileID: 0} | ||
88 | + m_PrefabAsset: {fileID: 0} | ||
89 | + m_GameObject: {fileID: 1694644481791102473} | ||
90 | + m_Material: {fileID: 0} | ||
91 | + m_IsTrigger: 0 | ||
92 | + m_Enabled: 1 | ||
93 | + serializedVersion: 4 | ||
94 | + m_Convex: 0 | ||
95 | + m_CookingOptions: 30 | ||
96 | + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} | ||
97 | +--- !u!1 &5867708520892882964 | ||
98 | +GameObject: | ||
99 | + m_ObjectHideFlags: 0 | ||
100 | + m_CorrespondingSourceObject: {fileID: 0} | ||
101 | + m_PrefabInstance: {fileID: 0} | ||
102 | + m_PrefabAsset: {fileID: 0} | ||
103 | + serializedVersion: 6 | ||
104 | + m_Component: | ||
105 | + - component: {fileID: 3847587717169254739} | ||
106 | + - component: {fileID: 158359302260373369} | ||
107 | + m_Layer: 0 | ||
108 | + m_Name: Placement Indicator (1) | ||
109 | + m_TagString: Untagged | ||
110 | + m_Icon: {fileID: 0} | ||
111 | + m_NavMeshLayer: 0 | ||
112 | + m_StaticEditorFlags: 0 | ||
113 | + m_IsActive: 1 | ||
114 | +--- !u!4 &3847587717169254739 | ||
115 | +Transform: | ||
116 | + m_ObjectHideFlags: 0 | ||
117 | + m_CorrespondingSourceObject: {fileID: 0} | ||
118 | + m_PrefabInstance: {fileID: 0} | ||
119 | + m_PrefabAsset: {fileID: 0} | ||
120 | + m_GameObject: {fileID: 5867708520892882964} | ||
121 | + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} | ||
122 | + m_LocalPosition: {x: 0, y: 0, z: 0} | ||
123 | + m_LocalScale: {x: 1, y: 1, z: 1} | ||
124 | + m_Children: | ||
125 | + - {fileID: 7764804282280814968} | ||
126 | + m_Father: {fileID: 0} | ||
127 | + m_RootOrder: 0 | ||
128 | + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||
129 | +--- !u!114 &158359302260373369 | ||
130 | +MonoBehaviour: | ||
131 | + m_ObjectHideFlags: 0 | ||
132 | + m_CorrespondingSourceObject: {fileID: 0} | ||
133 | + m_PrefabInstance: {fileID: 0} | ||
134 | + m_PrefabAsset: {fileID: 0} | ||
135 | + m_GameObject: {fileID: 5867708520892882964} | ||
136 | + m_Enabled: 1 | ||
137 | + m_EditorHideFlags: 0 | ||
138 | + m_Script: {fileID: 11500000, guid: d38a937ca4a4faf40869c82a6910b034, type: 3} | ||
139 | + m_Name: | ||
140 | + m_EditorClassIdentifier: | ||
141 | + PrefabToInstantiate: {fileID: 275043505709825487, guid: e93862c196e3d4941a028a74fbb079a6, | ||
142 | + type: 3} | ||
143 | + WhyCryBee: {fileID: 0} | ||
144 | + MechaKucha: {fileID: 0} |
1 | +%YAML 1.1 | ||
2 | +%TAG !u! tag:unity3d.com,2011: | ||
3 | +--- !u!114 &11400000 | ||
4 | +MonoBehaviour: | ||
5 | + m_ObjectHideFlags: 0 | ||
6 | + m_CorrespondingSourceObject: {fileID: 0} | ||
7 | + m_PrefabInstance: {fileID: 0} | ||
8 | + m_PrefabAsset: {fileID: 0} | ||
9 | + m_GameObject: {fileID: 0} | ||
10 | + m_Enabled: 1 | ||
11 | + m_EditorHideFlags: 0 | ||
12 | + m_Script: {fileID: 11500000, guid: 848409ee8ba454f42a5ddff137688a27, type: 3} | ||
13 | + m_Name: ReferenceImageLibrary | ||
14 | + m_EditorClassIdentifier: | ||
15 | + m_GuidLow: 5251952150333541850 | ||
16 | + m_GuidHigh: 16658206529639963798 | ||
17 | + m_Images: | ||
18 | + - m_SerializedGuid: | ||
19 | + m_GuidLow: 5438664385715598811 | ||
20 | + m_GuidHigh: 1485330862213032371 | ||
21 | + m_SerializedTextureGuid: | ||
22 | + m_GuidLow: 8576034593440043216 | ||
23 | + m_GuidHigh: 5068683186707033674 | ||
24 | + m_Size: {x: 0.3, y: 0.3} | ||
25 | + m_SpecifySize: 1 | ||
26 | + m_Name: AYAYA | ||
27 | + m_Texture: {fileID: 0} |
프로젝트/NewAndFurious/Assets/Scenes.meta
0 → 100644
This diff is collapsed. Click to expand it.
프로젝트/NewAndFurious/Assets/XR.meta
0 → 100644
프로젝트/NewAndFurious/Assets/XR/Loaders.meta
0 → 100644
1 | +%YAML 1.1 | ||
2 | +%TAG !u! tag:unity3d.com,2011: | ||
3 | +--- !u!114 &11400000 | ||
4 | +MonoBehaviour: | ||
5 | + m_ObjectHideFlags: 0 | ||
6 | + m_CorrespondingSourceObject: {fileID: 0} | ||
7 | + m_PrefabInstance: {fileID: 0} | ||
8 | + m_PrefabAsset: {fileID: 0} | ||
9 | + m_GameObject: {fileID: 0} | ||
10 | + m_Enabled: 1 | ||
11 | + m_EditorHideFlags: 0 | ||
12 | + m_Script: {fileID: 11500000, guid: 06042c85f885b4d1886f3ca5a1074eca, type: 3} | ||
13 | + m_Name: AR Core Loader | ||
14 | + m_EditorClassIdentifier: |
프로젝트/NewAndFurious/Assets/XR/Settings.meta
0 → 100644
1 | +%YAML 1.1 | ||
2 | +%TAG !u! tag:unity3d.com,2011: | ||
3 | +--- !u!114 &11400000 | ||
4 | +MonoBehaviour: | ||
5 | + m_ObjectHideFlags: 0 | ||
6 | + m_CorrespondingSourceObject: {fileID: 0} | ||
7 | + m_PrefabInstance: {fileID: 0} | ||
8 | + m_PrefabAsset: {fileID: 0} | ||
9 | + m_GameObject: {fileID: 0} | ||
10 | + m_Enabled: 1 | ||
11 | + m_EditorHideFlags: 0 | ||
12 | + m_Script: {fileID: 11500000, guid: 00cb13c61b2744fd786f9f969ce96149, type: 3} | ||
13 | + m_Name: AR Core Loader Settings | ||
14 | + m_EditorClassIdentifier: | ||
15 | + m_StartAndStopSubsystems: 0 |
1 | +%YAML 1.1 | ||
2 | +%TAG !u! tag:unity3d.com,2011: | ||
3 | +--- !u!114 &-3492707309148798384 | ||
4 | +MonoBehaviour: | ||
5 | + m_ObjectHideFlags: 0 | ||
6 | + m_CorrespondingSourceObject: {fileID: 0} | ||
7 | + m_PrefabInstance: {fileID: 0} | ||
8 | + m_PrefabAsset: {fileID: 0} | ||
9 | + m_GameObject: {fileID: 0} | ||
10 | + m_Enabled: 1 | ||
11 | + m_EditorHideFlags: 0 | ||
12 | + m_Script: {fileID: 11500000, guid: d236b7d11115f2143951f1e14045df39, type: 3} | ||
13 | + m_Name: Android Settings | ||
14 | + m_EditorClassIdentifier: | ||
15 | + m_LoaderManagerInstance: {fileID: 2886245437578067938} | ||
16 | + m_InitManagerOnStart: 1 | ||
17 | +--- !u!114 &11400000 | ||
18 | +MonoBehaviour: | ||
19 | + m_ObjectHideFlags: 0 | ||
20 | + m_CorrespondingSourceObject: {fileID: 0} | ||
21 | + m_PrefabInstance: {fileID: 0} | ||
22 | + m_PrefabAsset: {fileID: 0} | ||
23 | + m_GameObject: {fileID: 0} | ||
24 | + m_Enabled: 1 | ||
25 | + m_EditorHideFlags: 0 | ||
26 | + m_Script: {fileID: 11500000, guid: d2dc886499c26824283350fa532d087d, type: 3} | ||
27 | + m_Name: XRGeneralSettings | ||
28 | + m_EditorClassIdentifier: | ||
29 | + Keys: 07000000 | ||
30 | + Values: | ||
31 | + - {fileID: -3492707309148798384} | ||
32 | +--- !u!114 &2886245437578067938 | ||
33 | +MonoBehaviour: | ||
34 | + m_ObjectHideFlags: 0 | ||
35 | + m_CorrespondingSourceObject: {fileID: 0} | ||
36 | + m_PrefabInstance: {fileID: 0} | ||
37 | + m_PrefabAsset: {fileID: 0} | ||
38 | + m_GameObject: {fileID: 0} | ||
39 | + m_Enabled: 1 | ||
40 | + m_EditorHideFlags: 0 | ||
41 | + m_Script: {fileID: 11500000, guid: f4c3631f5e58749a59194e0cf6baf6d5, type: 3} | ||
42 | + m_Name: Android Providers | ||
43 | + m_EditorClassIdentifier: | ||
44 | + m_RequiresSettingsUpdate: 0 | ||
45 | + m_AutomaticLoading: 0 | ||
46 | + m_AutomaticRunning: 0 | ||
47 | + m_Loaders: [] |
프로젝트/NewAndFurious/Assets/unnamed (2).jpg
0 → 100644
96.5 KB
1 | +fileFormatVersion: 2 | ||
2 | +guid: 67e4c6c70a114c846a9f096e714a499a | ||
3 | +TextureImporter: | ||
4 | + internalIDToNameTable: [] | ||
5 | + externalObjects: {} | ||
6 | + serializedVersion: 11 | ||
7 | + mipmaps: | ||
8 | + mipMapMode: 0 | ||
9 | + enableMipMap: 1 | ||
10 | + sRGBTexture: 1 | ||
11 | + linearTexture: 0 | ||
12 | + fadeOut: 0 | ||
13 | + borderMipMap: 0 | ||
14 | + mipMapsPreserveCoverage: 0 | ||
15 | + alphaTestReferenceValue: 0.5 | ||
16 | + mipMapFadeDistanceStart: 1 | ||
17 | + mipMapFadeDistanceEnd: 3 | ||
18 | + bumpmap: | ||
19 | + convertToNormalMap: 0 | ||
20 | + externalNormalMap: 0 | ||
21 | + heightScale: 0.25 | ||
22 | + normalMapFilter: 0 | ||
23 | + isReadable: 0 | ||
24 | + streamingMipmaps: 0 | ||
25 | + streamingMipmapsPriority: 0 | ||
26 | + grayScaleToAlpha: 0 | ||
27 | + generateCubemap: 6 | ||
28 | + cubemapConvolution: 0 | ||
29 | + seamlessCubemap: 0 | ||
30 | + textureFormat: 1 | ||
31 | + maxTextureSize: 2048 | ||
32 | + textureSettings: | ||
33 | + serializedVersion: 2 | ||
34 | + filterMode: -1 | ||
35 | + aniso: -1 | ||
36 | + mipBias: -100 | ||
37 | + wrapU: -1 | ||
38 | + wrapV: -1 | ||
39 | + wrapW: -1 | ||
40 | + nPOTScale: 1 | ||
41 | + lightmap: 0 | ||
42 | + compressionQuality: 50 | ||
43 | + spriteMode: 0 | ||
44 | + spriteExtrude: 1 | ||
45 | + spriteMeshType: 1 | ||
46 | + alignment: 0 | ||
47 | + spritePivot: {x: 0.5, y: 0.5} | ||
48 | + spritePixelsToUnits: 100 | ||
49 | + spriteBorder: {x: 0, y: 0, z: 0, w: 0} | ||
50 | + spriteGenerateFallbackPhysicsShape: 1 | ||
51 | + alphaUsage: 1 | ||
52 | + alphaIsTransparency: 0 | ||
53 | + spriteTessellationDetail: -1 | ||
54 | + textureType: 0 | ||
55 | + textureShape: 1 | ||
56 | + singleChannelComponent: 0 | ||
57 | + maxTextureSizeSet: 0 | ||
58 | + compressionQualitySet: 0 | ||
59 | + textureFormatSet: 0 | ||
60 | + applyGammaDecoding: 0 | ||
61 | + platformSettings: | ||
62 | + - serializedVersion: 3 | ||
63 | + buildTarget: DefaultTexturePlatform | ||
64 | + maxTextureSize: 2048 | ||
65 | + resizeAlgorithm: 0 | ||
66 | + textureFormat: -1 | ||
67 | + textureCompression: 1 | ||
68 | + compressionQuality: 50 | ||
69 | + crunchedCompression: 0 | ||
70 | + allowsAlphaSplitting: 0 | ||
71 | + overridden: 0 | ||
72 | + androidETC2FallbackOverride: 0 | ||
73 | + forceMaximumCompressionQuality_BC6H_BC7: 0 | ||
74 | + spriteSheet: | ||
75 | + serializedVersion: 2 | ||
76 | + sprites: [] | ||
77 | + outline: [] | ||
78 | + physicsShape: [] | ||
79 | + bones: [] | ||
80 | + spriteID: | ||
81 | + internalID: 0 | ||
82 | + vertices: [] | ||
83 | + indices: | ||
84 | + edges: [] | ||
85 | + weights: [] | ||
86 | + secondaryTextures: [] | ||
87 | + spritePackingTag: | ||
88 | + pSDRemoveMatte: 0 | ||
89 | + pSDShowRemoveMatteOption: 0 | ||
90 | + userData: | ||
91 | + assetBundleName: | ||
92 | + assetBundleVariant: |
1 | +//----------------------------------------------------------------------- | ||
2 | +// <copyright file="DetectedPlaneVisualizer.cs" company="Google"> | ||
3 | +// | ||
4 | +// Copyright 2017 Google Inc. All Rights Reserved. | ||
5 | +// | ||
6 | +// Licensed under the Apache License, Version 2.0 (the "License"); | ||
7 | +// you may not use this file except in compliance with the License. | ||
8 | +// You may obtain a copy of the License at | ||
9 | +// | ||
10 | +// http://www.apache.org/licenses/LICENSE-2.0 | ||
11 | +// | ||
12 | +// Unless required by applicable law or agreed to in writing, software | ||
13 | +// distributed under the License is distributed on an "AS IS" BASIS, | ||
14 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
15 | +// See the License for the specific language governing permissions and | ||
16 | +// limitations under the License. | ||
17 | +// | ||
18 | +// </copyright> | ||
19 | +//----------------------------------------------------------------------- | ||
20 | + | ||
21 | +namespace GoogleARCore.Examples.Common | ||
22 | +{ | ||
23 | + using System.Collections.Generic; | ||
24 | + using GoogleARCore; | ||
25 | + using UnityEngine; | ||
26 | + | ||
27 | + /// <summary> | ||
28 | + /// Visualizes a single DetectedPlane in the Unity scene. | ||
29 | + /// </summary> | ||
30 | + public class DetectedPlaneVisualizer : MonoBehaviour | ||
31 | + { | ||
32 | + private static int s_PlaneCount = 0; | ||
33 | + | ||
34 | + private readonly Color[] k_PlaneColors = new Color[] | ||
35 | + { | ||
36 | + new Color(1.0f, 1.0f, 1.0f), | ||
37 | + new Color(0.956f, 0.262f, 0.211f), | ||
38 | + new Color(0.913f, 0.117f, 0.388f), | ||
39 | + new Color(0.611f, 0.152f, 0.654f), | ||
40 | + new Color(0.403f, 0.227f, 0.717f), | ||
41 | + new Color(0.247f, 0.317f, 0.709f), | ||
42 | + new Color(0.129f, 0.588f, 0.952f), | ||
43 | + new Color(0.011f, 0.662f, 0.956f), | ||
44 | + new Color(0f, 0.737f, 0.831f), | ||
45 | + new Color(0f, 0.588f, 0.533f), | ||
46 | + new Color(0.298f, 0.686f, 0.313f), | ||
47 | + new Color(0.545f, 0.764f, 0.290f), | ||
48 | + new Color(0.803f, 0.862f, 0.223f), | ||
49 | + new Color(1.0f, 0.921f, 0.231f), | ||
50 | + new Color(1.0f, 0.756f, 0.027f) | ||
51 | + }; | ||
52 | + | ||
53 | + private DetectedPlane m_DetectedPlane; | ||
54 | + | ||
55 | + // Keep previous frame's mesh polygon to avoid mesh update every frame. | ||
56 | + private List<Vector3> m_PreviousFrameMeshVertices = new List<Vector3>(); | ||
57 | + private List<Vector3> m_MeshVertices = new List<Vector3>(); | ||
58 | + private Vector3 m_PlaneCenter = new Vector3(); | ||
59 | + | ||
60 | + private List<Color> m_MeshColors = new List<Color>(); | ||
61 | + | ||
62 | + private List<int> m_MeshIndices = new List<int>(); | ||
63 | + | ||
64 | + private Mesh m_Mesh; | ||
65 | + | ||
66 | + private MeshRenderer m_MeshRenderer; | ||
67 | + private MeshCollider ar_meshCollider; //Abdul | ||
68 | + | ||
69 | + /// <summary> | ||
70 | + /// The Unity Awake() method. | ||
71 | + /// </summary> | ||
72 | + public void Awake() | ||
73 | + { | ||
74 | + m_Mesh = GetComponent<MeshFilter>().mesh; | ||
75 | + m_MeshRenderer = GetComponent<UnityEngine.MeshRenderer>(); | ||
76 | + ar_meshCollider = GetComponent<MeshCollider>(); //Abdul | ||
77 | + } | ||
78 | + | ||
79 | + /// <summary> | ||
80 | + /// The Unity Update() method. | ||
81 | + /// </summary> | ||
82 | + public void Update() | ||
83 | + { | ||
84 | + if (m_DetectedPlane == null) | ||
85 | + { | ||
86 | + return; | ||
87 | + } | ||
88 | + else if (m_DetectedPlane.SubsumedBy != null) | ||
89 | + { | ||
90 | + Destroy(gameObject); | ||
91 | + return; | ||
92 | + } | ||
93 | + else if (m_DetectedPlane.TrackingState != TrackingState.Tracking) | ||
94 | + { | ||
95 | + m_MeshRenderer.enabled = false; | ||
96 | + return; | ||
97 | + } | ||
98 | + | ||
99 | + m_MeshRenderer.enabled = true; | ||
100 | + | ||
101 | + _UpdateMeshIfNeeded(); | ||
102 | + } | ||
103 | + | ||
104 | + /// <summary> | ||
105 | + /// Initializes the DetectedPlaneVisualizer with a DetectedPlane. | ||
106 | + /// </summary> | ||
107 | + /// <param name="plane">The plane to vizualize.</param> | ||
108 | + public void Initialize(DetectedPlane plane) | ||
109 | + { | ||
110 | + m_DetectedPlane = plane; | ||
111 | + m_MeshRenderer.material.SetColor( | ||
112 | + "_GridColor", k_PlaneColors[s_PlaneCount++ % k_PlaneColors.Length]); | ||
113 | + m_MeshRenderer.material.SetFloat("_UvRotation", Random.Range(0.0f, 360.0f)); | ||
114 | + | ||
115 | + Update(); | ||
116 | + } | ||
117 | + | ||
118 | + /// <summary> | ||
119 | + /// Update mesh with a list of Vector3 and plane's center position. | ||
120 | + /// </summary> | ||
121 | + private void _UpdateMeshIfNeeded() | ||
122 | + { | ||
123 | + m_DetectedPlane.GetBoundaryPolygon(m_MeshVertices); | ||
124 | + | ||
125 | + if (_AreVerticesListsEqual(m_PreviousFrameMeshVertices, m_MeshVertices)) | ||
126 | + { | ||
127 | + return; | ||
128 | + } | ||
129 | + | ||
130 | + m_PreviousFrameMeshVertices.Clear(); | ||
131 | + m_PreviousFrameMeshVertices.AddRange(m_MeshVertices); | ||
132 | + | ||
133 | + m_PlaneCenter = m_DetectedPlane.CenterPose.position; | ||
134 | + | ||
135 | + Vector3 planeNormal = m_DetectedPlane.CenterPose.rotation * Vector3.up; | ||
136 | + | ||
137 | + m_MeshRenderer.material.SetVector("_PlaneNormal", planeNormal); | ||
138 | + | ||
139 | + int planePolygonCount = m_MeshVertices.Count; | ||
140 | + | ||
141 | + // The following code converts a polygon to a mesh with two polygons, inner polygon | ||
142 | + // renders with 100% opacity and fade out to outter polygon with opacity 0%, as shown | ||
143 | + // below. The indices shown in the diagram are used in comments below. | ||
144 | + // _______________ 0_______________1 | ||
145 | + // | | |4___________5| | ||
146 | + // | | | | | | | ||
147 | + // | | => | | | | | ||
148 | + // | | | | | | | ||
149 | + // | | |7-----------6| | ||
150 | + // --------------- 3---------------2 | ||
151 | + m_MeshColors.Clear(); | ||
152 | + | ||
153 | + // Fill transparent color to vertices 0 to 3. | ||
154 | + for (int i = 0; i < planePolygonCount; ++i) | ||
155 | + { | ||
156 | + m_MeshColors.Add(Color.clear); | ||
157 | + } | ||
158 | + | ||
159 | + // Feather distance 0.2 meters. | ||
160 | + const float featherLength = 0.2f; | ||
161 | + | ||
162 | + // Feather scale over the distance between plane center and vertices. | ||
163 | + const float featherScale = 0.2f; | ||
164 | + | ||
165 | + // Add vertex 4 to 7. | ||
166 | + for (int i = 0; i < planePolygonCount; ++i) | ||
167 | + { | ||
168 | + Vector3 v = m_MeshVertices[i]; | ||
169 | + | ||
170 | + // Vector from plane center to current point | ||
171 | + Vector3 d = v - m_PlaneCenter; | ||
172 | + | ||
173 | + float scale = 1.0f - Mathf.Min(featherLength / d.magnitude, featherScale); | ||
174 | + m_MeshVertices.Add((scale * d) + m_PlaneCenter); | ||
175 | + | ||
176 | + m_MeshColors.Add(Color.white); | ||
177 | + } | ||
178 | + | ||
179 | + m_MeshIndices.Clear(); | ||
180 | + int firstOuterVertex = 0; | ||
181 | + int firstInnerVertex = planePolygonCount; | ||
182 | + | ||
183 | + // Generate triangle (4, 5, 6) and (4, 6, 7). | ||
184 | + for (int i = 0; i < planePolygonCount - 2; ++i) | ||
185 | + { | ||
186 | + m_MeshIndices.Add(firstInnerVertex); | ||
187 | + m_MeshIndices.Add(firstInnerVertex + i + 1); | ||
188 | + m_MeshIndices.Add(firstInnerVertex + i + 2); | ||
189 | + } | ||
190 | + | ||
191 | + // Generate triangle (0, 1, 4), (4, 1, 5), (5, 1, 2), (5, 2, 6), (6, 2, 3), (6, 3, 7) | ||
192 | + // (7, 3, 0), (7, 0, 4) | ||
193 | + for (int i = 0; i < planePolygonCount; ++i) | ||
194 | + { | ||
195 | + int outerVertex1 = firstOuterVertex + i; | ||
196 | + int outerVertex2 = firstOuterVertex + ((i + 1) % planePolygonCount); | ||
197 | + int innerVertex1 = firstInnerVertex + i; | ||
198 | + int innerVertex2 = firstInnerVertex + ((i + 1) % planePolygonCount); | ||
199 | + | ||
200 | + m_MeshIndices.Add(outerVertex1); | ||
201 | + m_MeshIndices.Add(outerVertex2); | ||
202 | + m_MeshIndices.Add(innerVertex1); | ||
203 | + | ||
204 | + m_MeshIndices.Add(innerVertex1); | ||
205 | + m_MeshIndices.Add(outerVertex2); | ||
206 | + m_MeshIndices.Add(innerVertex2); | ||
207 | + } | ||
208 | + | ||
209 | + m_Mesh.Clear(); | ||
210 | + m_Mesh.SetVertices(m_MeshVertices); | ||
211 | + m_Mesh.SetTriangles(m_MeshIndices, 0); | ||
212 | + m_Mesh.SetColors(m_MeshColors); | ||
213 | + | ||
214 | + ar_meshCollider.sharedMesh = m_Mesh; //Abdul (used for collision detection) | ||
215 | + } | ||
216 | + | ||
217 | + private bool _AreVerticesListsEqual(List<Vector3> firstList, List<Vector3> secondList) | ||
218 | + { | ||
219 | + if (firstList.Count != secondList.Count) | ||
220 | + { | ||
221 | + return false; | ||
222 | + } | ||
223 | + | ||
224 | + for (int i = 0; i < firstList.Count; i++) | ||
225 | + { | ||
226 | + if (firstList[i] != secondList[i]) | ||
227 | + { | ||
228 | + return false; | ||
229 | + } | ||
230 | + } | ||
231 | + | ||
232 | + return true; | ||
233 | + } | ||
234 | + } | ||
235 | +} |
-
Please register or login to post a comment