├── FractionalLineAlgorithm.cs
├── FractionalLineAlgorithm.cs.meta
├── FractionalLineAlgorithmTest.cs
├── FractionalLineAlgorithmTest.cs.meta
├── LICENSE
├── LICENSE.meta
├── README.md
├── README.md.meta
├── TestScene.unity
└── TestScene.unity.meta
/FractionalLineAlgorithm.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System;
3 | using Debug = UnityEngine.Debug;
4 |
5 | namespace PanLineAlgorithm
6 | {
7 | public static class FractionalLineAlgorithm
8 | {
9 | ///
10 | /// Function for tracing a line. Note: Reasonably deterministic - safe to use with LSF simulation.
11 | ///
12 | /// Start x.
13 | /// Start y.
14 | /// End x.
15 | /// End y.
16 | public static IEnumerable Trace(double startX, double startY, double endX, double endY)
17 | {
18 | //TODO: Make it look prettier
19 | const double one = 1;
20 | const double half = .5d;
21 |
22 | double deltaX = endX - startX;
23 | double deltaY = endY - startY;
24 | double absDeltaX = Math.Abs(deltaX);
25 | double absDeltaY = Math.Abs(deltaY);
26 | int directionX = Math.Sign(deltaX);
27 | int directionY = Math.Sign(deltaY);
28 | int gridX = (int)Math.Round(startX);
29 | int gridY = (int)Math.Round(startY);
30 | double lastChangePosition;
31 | if (deltaX == 0)
32 | {
33 | yield return new Coordinate(gridX, gridY);
34 |
35 | if (deltaY == 0)
36 | {
37 | yield break;
38 | }
39 |
40 | //Vertical
41 | //Copy-paste galore
42 | lastChangePosition = startY;
43 |
44 | double lastChangeDif = absDeltaY;
45 | if (lastChangeDif < one)
46 | {
47 |
48 | double roundDirection = directionY > 0 ? half : -half;
49 | double compare = Math.Abs(Math.Round(lastChangePosition) + roundDirection - lastChangePosition);
50 | if (lastChangeDif > compare)
51 | {
52 | gridY += directionY;
53 | yield return new Coordinate(gridX, gridY);
54 | }
55 | } else
56 | {
57 | for (double y = 0d;; y += one)
58 | {
59 | if (y + 1 > lastChangeDif)
60 | {
61 | double roundDirection = directionY > 0 ? half : -half;
62 | lastChangeDif -= y;
63 | double compare = Math.Abs(Math.Round(lastChangePosition) + roundDirection - lastChangePosition);
64 | if (lastChangeDif > compare)
65 | {
66 | gridY += directionY;
67 | yield return new Coordinate(gridX, gridY);
68 |
69 | }
70 | break;
71 | }
72 | gridY += directionY;
73 | yield return new Coordinate(gridX, gridY);
74 |
75 | if (y + 1 == lastChangeDif)
76 | break;
77 |
78 | }
79 | }
80 |
81 | yield break;
82 | }
83 |
84 | double positionX = startX;
85 | double positionY = startY;
86 | double slope = Math.Abs(deltaY / deltaX);
87 |
88 | lastChangePosition = positionY;
89 |
90 | double used = 0d;
91 |
92 | //Getting X to align with a vertical edge of the grid... easier to calculate coordinates
93 | if (positionX % half != 0 || positionX % 1 == 0)
94 | {
95 | double newPositionX = directionX > 0 ? Math.Round(positionX) + .5f : Math.Round(positionX) - .5f;
96 | if ((directionX > 0 && newPositionX > endX) ||
97 | (directionX < 0 && newPositionX < endX))
98 | {
99 | newPositionX = endX;
100 | }
101 | double difX = newPositionX - positionX;
102 |
103 | double absDifX = Math.Abs(difX);
104 |
105 | double difY = absDifX * slope * directionY;
106 | double newPositionY = positionY + difY;
107 | if (
108 | (directionY > 0 && newPositionY > endY) ||
109 | (directionY < 0 && newPositionY < endY))
110 | {
111 | newPositionY = endY;
112 | } else
113 | {
114 |
115 | double lastChangeDif = Math.Abs(newPositionY - lastChangePosition);
116 |
117 | bool yPassed = false;
118 | yield return new Coordinate(gridX, gridY);
119 |
120 | if (lastChangeDif < one)
121 | {
122 |
123 | double roundDirection = directionY > 0 ? half : -half;
124 | double compare = Math.Abs(Math.Round(lastChangePosition) + roundDirection - lastChangePosition);
125 | if (lastChangeDif > compare)
126 | {
127 | yPassed = true;
128 | gridY += directionY;
129 | yield return new Coordinate(gridX, gridY);
130 |
131 | }
132 |
133 | } else
134 | {
135 | yPassed = true;
136 | for (double y = 0d;; y += one)
137 | {
138 | if (y + 1 > lastChangeDif)
139 | {
140 | double roundDirection = directionY > 0 ? half : -half;
141 | lastChangeDif -= y;
142 | double compare = Math.Abs(Math.Round(lastChangePosition) + roundDirection - lastChangePosition);
143 | if (lastChangeDif > compare)
144 | {
145 | yPassed = true;
146 | gridY += directionY;
147 | yield return new Coordinate(gridX, gridY);
148 |
149 | }
150 | break;
151 | }
152 | gridY += directionY;
153 | yield return new Coordinate(gridX, gridY);
154 |
155 | if (y + 1 == lastChangeDif)
156 | break;
157 |
158 | }
159 | }
160 |
161 | if (yPassed)
162 | {
163 | lastChangePosition = newPositionY;
164 | }
165 | }
166 | gridX += directionX;
167 | positionX = newPositionX;
168 | positionY = newPositionY;
169 | }
170 |
171 | bool doBreak = false;
172 | for (double x = used;; x += one)
173 | {
174 | double difX = directionX;
175 | if (x + one >= absDeltaX)
176 | {
177 |
178 | int gridEndX = (int)Math.Round(endX);
179 | if (gridX == gridEndX)
180 | {
181 | doBreak = true;
182 | } else
183 | {
184 | break;
185 | }
186 | }
187 | double newPositionX = positionX + difX;
188 |
189 | double absDifX = Math.Abs(difX);
190 | double difY = absDifX * slope * directionY;
191 | double newPositionY = positionY + difY;
192 |
193 | if (
194 | (directionY > 0 && newPositionY > endY) ||
195 | (directionY < 0 && newPositionY < endY))
196 | {
197 | newPositionY = endY;
198 | }
199 |
200 | //God, give me nested functions plzzzzz
201 | double lastChangeDif = Math.Abs(newPositionY - lastChangePosition);
202 | bool yPassed = false;
203 | yield return new Coordinate(gridX, gridY);
204 |
205 | if (lastChangeDif < one)
206 | {
207 |
208 | double roundDirection = directionY > 0 ? half : -half;
209 | double compare = Math.Abs(Math.Round(lastChangePosition) + roundDirection - lastChangePosition);
210 | if (lastChangeDif > compare)
211 | {
212 | yPassed = true;
213 | gridY += directionY;
214 | yield return new Coordinate(gridX, gridY);
215 | }
216 |
217 | } else
218 | {
219 | yPassed = true;
220 | for (double y = 0d;; y += one)
221 | {
222 | if (y + 1 > lastChangeDif)
223 | {
224 | double roundDirection = directionY > 0 ? half : -half;
225 | lastChangeDif -= y;
226 | double compare = Math.Abs(Math.Round(lastChangePosition) + roundDirection - lastChangePosition);
227 | if (lastChangeDif > compare)
228 | {
229 | yPassed = true;
230 | gridY += directionY;
231 | yield return new Coordinate(gridX, gridY);
232 |
233 | }
234 | break;
235 | }
236 | gridY += directionY;
237 | yield return new Coordinate(gridX, gridY);
238 |
239 | if (y + 1 == lastChangeDif)
240 | break;
241 |
242 | }
243 | }
244 |
245 | if (yPassed)
246 | {
247 | lastChangePosition = newPositionY;
248 | }
249 | if (doBreak)
250 | break;
251 |
252 |
253 | gridX += directionX;
254 | positionX = newPositionX;
255 | positionY = newPositionY;
256 |
257 |
258 | }
259 | }
260 |
261 | public struct Coordinate
262 | {
263 | public Coordinate(int x, int y)
264 | {
265 | X = x;
266 | Y = y;
267 | }
268 |
269 | public int X;
270 | public int Y;
271 |
272 | public override string ToString()
273 | {
274 | return string.Format("({0}, {1})", X, Y);
275 | }
276 |
277 | public override int GetHashCode()
278 | {
279 | return X.GetHashCode() ^ Y.GetHashCode();
280 | }
281 | }
282 |
283 | }
284 | }
--------------------------------------------------------------------------------
/FractionalLineAlgorithm.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2d1d4a46f1511435aa35bf61d8669921
3 | timeCreated: 1450987106
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/FractionalLineAlgorithmTest.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System.Collections;
3 | using System;
4 | using System.Collections.Generic;
5 |
6 | namespace PanLineAlgorithm.Test
7 | {
8 | public class FractionalLineAlgorithmTest : MonoBehaviour
9 | {
10 | const int size = 64;
11 | bool[,] Outlined = new bool[size, size];
12 | public Transform start;
13 | public Transform end;
14 |
15 | void OnDrawGizmos()
16 | {
17 | Array.Clear(Outlined, 0, Outlined.Length);
18 | int offset = Outlined.GetLength(0) / 2;
19 |
20 | double startX = (double)start.position.x;
21 | double startY = (double)start.position.z;
22 | double endX = (double)end.position.x;
23 | double endY = (double)end.position.z;
24 |
25 | //irony lolz
26 | HashSet redundancyChecker = new HashSet();
27 |
28 | foreach (FractionalLineAlgorithm.Coordinate coor in (FractionalLineAlgorithm.Trace (startX,startY,endX,endY)))
29 | {
30 | if (!redundancyChecker.Add(coor))
31 | {
32 | Debug.LogErrorFormat("Redundancy detected for {0}", coor);
33 | }
34 |
35 | Outlined [coor.X + offset, coor.Y + offset] = true;
36 | }
37 | Vector3 size = new Vector3(1, .1f, 1);
38 | Vector3 fillSize = new Vector3(.9f, .1f, .9f);
39 | float posOffset = 0f;
40 | for (int i = 0; i < Outlined.GetLength(0); i++)
41 | {
42 | for (int j = 0; j < Outlined.GetLength(1); j++)
43 | {
44 | Vector3 drawPos = new Vector3(i - offset + posOffset, 0, j - offset + posOffset);
45 | if (Outlined [i, j])
46 | {
47 | Gizmos.color = Color.red;
48 | } else
49 | {
50 | Gizmos.color = Color.green;
51 | }
52 | Gizmos.DrawCube(drawPos, fillSize);
53 |
54 | Gizmos.color = Color.black;
55 |
56 | Gizmos.DrawWireCube(drawPos, size);
57 |
58 | }
59 | }
60 |
61 | float lineHeight = 0f;
62 | Gizmos.color = Color.white;
63 | Gizmos.DrawLine(new Vector3((float)startX, lineHeight, (float)startY), new Vector3((float)endX, lineHeight, (float)endY));
64 | }
65 | }
66 | }
--------------------------------------------------------------------------------
/FractionalLineAlgorithmTest.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 22db5a5c12f614a8b8ee257fdeb5a8a9
3 | timeCreated: 1450991213
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 John Pan
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/LICENSE.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e3f126a7d5ede411b8add16e110ff549
3 | timeCreated: 1450986348
4 | licenseType: Pro
5 | DefaultImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | FractionalLineAlgorithm.Trace (startX, startY, endX, endY) will return a series of coordinates that overlap the line segment formed by the positions (startX, startY) and (endX, endY) with approximately 0(N) performance based on magnitude of the line.
2 |
--------------------------------------------------------------------------------
/README.md.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ebf45f1f9973846dd978d201d1f8f32a
3 | timeCreated: 1451067380
4 | licenseType: Pro
5 | DefaultImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/TestScene.unity:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!29 &1
4 | SceneSettings:
5 | m_ObjectHideFlags: 0
6 | m_PVSData:
7 | m_PVSObjectsArray: []
8 | m_PVSPortalsArray: []
9 | m_OcclusionBakeSettings:
10 | smallestOccluder: 5
11 | smallestHole: 0.25
12 | backfaceThreshold: 100
13 | --- !u!104 &2
14 | RenderSettings:
15 | m_ObjectHideFlags: 0
16 | serializedVersion: 6
17 | m_Fog: 0
18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
19 | m_FogMode: 3
20 | m_FogDensity: 0.01
21 | m_LinearFogStart: 0
22 | m_LinearFogEnd: 300
23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
26 | m_AmbientIntensity: 1
27 | m_AmbientMode: 0
28 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
29 | m_HaloStrength: 0.5
30 | m_FlareStrength: 1
31 | m_FlareFadeSpeed: 3
32 | m_HaloTexture: {fileID: 0}
33 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
34 | m_DefaultReflectionMode: 0
35 | m_DefaultReflectionResolution: 128
36 | m_ReflectionBounces: 1
37 | m_ReflectionIntensity: 1
38 | m_CustomReflection: {fileID: 0}
39 | m_Sun: {fileID: 0}
40 | --- !u!157 &3
41 | LightmapSettings:
42 | m_ObjectHideFlags: 0
43 | serializedVersion: 6
44 | m_GIWorkflowMode: 0
45 | m_LightmapsMode: 1
46 | m_GISettings:
47 | serializedVersion: 2
48 | m_BounceScale: 1
49 | m_IndirectOutputScale: 1
50 | m_AlbedoBoost: 1
51 | m_TemporalCoherenceThreshold: 1
52 | m_EnvironmentLightingMode: 0
53 | m_EnableBakedLightmaps: 1
54 | m_EnableRealtimeLightmaps: 1
55 | m_LightmapEditorSettings:
56 | serializedVersion: 3
57 | m_Resolution: 2
58 | m_BakeResolution: 40
59 | m_TextureWidth: 1024
60 | m_TextureHeight: 1024
61 | m_AOMaxDistance: 1
62 | m_Padding: 2
63 | m_CompAOExponent: 0
64 | m_LightmapParameters: {fileID: 0}
65 | m_TextureCompression: 1
66 | m_FinalGather: 0
67 | m_FinalGatherRayCount: 1024
68 | m_ReflectionCompression: 2
69 | m_LightingDataAsset: {fileID: 0}
70 | m_RuntimeCPUUsage: 25
71 | --- !u!196 &4
72 | NavMeshSettings:
73 | serializedVersion: 2
74 | m_ObjectHideFlags: 0
75 | m_BuildSettings:
76 | serializedVersion: 2
77 | agentRadius: 0.5
78 | agentHeight: 2
79 | agentSlope: 45
80 | agentClimb: 0.4
81 | ledgeDropHeight: 0
82 | maxJumpAcrossDistance: 0
83 | accuratePlacement: 0
84 | minRegionArea: 2
85 | cellSize: 0.16666667
86 | manualCellSize: 0
87 | m_NavMeshData: {fileID: 0}
88 | --- !u!1 &31372930
89 | GameObject:
90 | m_ObjectHideFlags: 0
91 | m_PrefabParentObject: {fileID: 0}
92 | m_PrefabInternal: {fileID: 0}
93 | serializedVersion: 4
94 | m_Component:
95 | - 4: {fileID: 31372936}
96 | - 20: {fileID: 31372935}
97 | - 92: {fileID: 31372934}
98 | - 124: {fileID: 31372933}
99 | - 81: {fileID: 31372932}
100 | - 114: {fileID: 31372931}
101 | m_Layer: 0
102 | m_Name: Main Camera
103 | m_TagString: MainCamera
104 | m_Icon: {fileID: 0}
105 | m_NavMeshLayer: 0
106 | m_StaticEditorFlags: 0
107 | m_IsActive: 1
108 | --- !u!114 &31372931
109 | MonoBehaviour:
110 | m_ObjectHideFlags: 0
111 | m_PrefabParentObject: {fileID: 0}
112 | m_PrefabInternal: {fileID: 0}
113 | m_GameObject: {fileID: 31372930}
114 | m_Enabled: 1
115 | m_EditorHideFlags: 0
116 | m_Script: {fileID: 11500000, guid: 22db5a5c12f614a8b8ee257fdeb5a8a9, type: 3}
117 | m_Name:
118 | m_EditorClassIdentifier:
119 | start: {fileID: 1475523872}
120 | end: {fileID: 227206215}
121 | --- !u!81 &31372932
122 | AudioListener:
123 | m_ObjectHideFlags: 0
124 | m_PrefabParentObject: {fileID: 0}
125 | m_PrefabInternal: {fileID: 0}
126 | m_GameObject: {fileID: 31372930}
127 | m_Enabled: 1
128 | --- !u!124 &31372933
129 | Behaviour:
130 | m_ObjectHideFlags: 0
131 | m_PrefabParentObject: {fileID: 0}
132 | m_PrefabInternal: {fileID: 0}
133 | m_GameObject: {fileID: 31372930}
134 | m_Enabled: 1
135 | --- !u!92 &31372934
136 | Behaviour:
137 | m_ObjectHideFlags: 0
138 | m_PrefabParentObject: {fileID: 0}
139 | m_PrefabInternal: {fileID: 0}
140 | m_GameObject: {fileID: 31372930}
141 | m_Enabled: 1
142 | --- !u!20 &31372935
143 | Camera:
144 | m_ObjectHideFlags: 0
145 | m_PrefabParentObject: {fileID: 0}
146 | m_PrefabInternal: {fileID: 0}
147 | m_GameObject: {fileID: 31372930}
148 | m_Enabled: 1
149 | serializedVersion: 2
150 | m_ClearFlags: 1
151 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844}
152 | m_NormalizedViewPortRect:
153 | serializedVersion: 2
154 | x: 0
155 | y: 0
156 | width: 1
157 | height: 1
158 | near clip plane: 0.3
159 | far clip plane: 1000
160 | field of view: 60
161 | orthographic: 0
162 | orthographic size: 5
163 | m_Depth: -1
164 | m_CullingMask:
165 | serializedVersion: 2
166 | m_Bits: 4294967295
167 | m_RenderingPath: -1
168 | m_TargetTexture: {fileID: 0}
169 | m_TargetDisplay: 0
170 | m_TargetEye: 3
171 | m_HDR: 0
172 | m_OcclusionCulling: 1
173 | m_StereoConvergence: 10
174 | m_StereoSeparation: 0.022
175 | m_StereoMirrorMode: 0
176 | --- !u!4 &31372936
177 | Transform:
178 | m_ObjectHideFlags: 0
179 | m_PrefabParentObject: {fileID: 0}
180 | m_PrefabInternal: {fileID: 0}
181 | m_GameObject: {fileID: 31372930}
182 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
183 | m_LocalPosition: {x: -7.02, y: 1, z: -0.5}
184 | m_LocalScale: {x: 1, y: 1, z: 1}
185 | m_Children: []
186 | m_Father: {fileID: 0}
187 | m_RootOrder: 0
188 | --- !u!1 &227206211
189 | GameObject:
190 | m_ObjectHideFlags: 0
191 | m_PrefabParentObject: {fileID: 0}
192 | m_PrefabInternal: {fileID: 0}
193 | serializedVersion: 4
194 | m_Component:
195 | - 4: {fileID: 227206215}
196 | - 33: {fileID: 227206214}
197 | - 135: {fileID: 227206213}
198 | - 23: {fileID: 227206212}
199 | m_Layer: 0
200 | m_Name: Sphere
201 | m_TagString: Untagged
202 | m_Icon: {fileID: 0}
203 | m_NavMeshLayer: 0
204 | m_StaticEditorFlags: 0
205 | m_IsActive: 1
206 | --- !u!23 &227206212
207 | MeshRenderer:
208 | m_ObjectHideFlags: 0
209 | m_PrefabParentObject: {fileID: 0}
210 | m_PrefabInternal: {fileID: 0}
211 | m_GameObject: {fileID: 227206211}
212 | m_Enabled: 1
213 | m_CastShadows: 1
214 | m_ReceiveShadows: 1
215 | m_Materials:
216 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
217 | m_SubsetIndices:
218 | m_StaticBatchRoot: {fileID: 0}
219 | m_UseLightProbes: 1
220 | m_ReflectionProbeUsage: 1
221 | m_ProbeAnchor: {fileID: 0}
222 | m_ScaleInLightmap: 1
223 | m_PreserveUVs: 1
224 | m_IgnoreNormalsForChartDetection: 0
225 | m_ImportantGI: 0
226 | m_MinimumChartSize: 4
227 | m_AutoUVMaxDistance: 0.5
228 | m_AutoUVMaxAngle: 89
229 | m_LightmapParameters: {fileID: 0}
230 | m_SortingLayerID: 0
231 | m_SortingOrder: 0
232 | --- !u!135 &227206213
233 | SphereCollider:
234 | m_ObjectHideFlags: 0
235 | m_PrefabParentObject: {fileID: 0}
236 | m_PrefabInternal: {fileID: 0}
237 | m_GameObject: {fileID: 227206211}
238 | m_Material: {fileID: 0}
239 | m_IsTrigger: 0
240 | m_Enabled: 1
241 | serializedVersion: 2
242 | m_Radius: 0.5
243 | m_Center: {x: 0, y: 0, z: 0}
244 | --- !u!33 &227206214
245 | MeshFilter:
246 | m_ObjectHideFlags: 0
247 | m_PrefabParentObject: {fileID: 0}
248 | m_PrefabInternal: {fileID: 0}
249 | m_GameObject: {fileID: 227206211}
250 | m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
251 | --- !u!4 &227206215
252 | Transform:
253 | m_ObjectHideFlags: 0
254 | m_PrefabParentObject: {fileID: 0}
255 | m_PrefabInternal: {fileID: 0}
256 | m_GameObject: {fileID: 227206211}
257 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
258 | m_LocalPosition: {x: -2, y: 0, z: 1.5}
259 | m_LocalScale: {x: 0.5, y: 0.2, z: 0.5}
260 | m_Children: []
261 | m_Father: {fileID: 0}
262 | m_RootOrder: 2
263 | --- !u!1 &1475523868
264 | GameObject:
265 | m_ObjectHideFlags: 0
266 | m_PrefabParentObject: {fileID: 0}
267 | m_PrefabInternal: {fileID: 0}
268 | serializedVersion: 4
269 | m_Component:
270 | - 4: {fileID: 1475523872}
271 | - 33: {fileID: 1475523871}
272 | - 65: {fileID: 1475523870}
273 | - 23: {fileID: 1475523869}
274 | m_Layer: 0
275 | m_Name: Start
276 | m_TagString: Untagged
277 | m_Icon: {fileID: 0}
278 | m_NavMeshLayer: 0
279 | m_StaticEditorFlags: 0
280 | m_IsActive: 1
281 | --- !u!23 &1475523869
282 | MeshRenderer:
283 | m_ObjectHideFlags: 0
284 | m_PrefabParentObject: {fileID: 0}
285 | m_PrefabInternal: {fileID: 0}
286 | m_GameObject: {fileID: 1475523868}
287 | m_Enabled: 1
288 | m_CastShadows: 1
289 | m_ReceiveShadows: 1
290 | m_Materials:
291 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
292 | m_SubsetIndices:
293 | m_StaticBatchRoot: {fileID: 0}
294 | m_UseLightProbes: 1
295 | m_ReflectionProbeUsage: 1
296 | m_ProbeAnchor: {fileID: 0}
297 | m_ScaleInLightmap: 1
298 | m_PreserveUVs: 1
299 | m_IgnoreNormalsForChartDetection: 0
300 | m_ImportantGI: 0
301 | m_MinimumChartSize: 4
302 | m_AutoUVMaxDistance: 0.5
303 | m_AutoUVMaxAngle: 89
304 | m_LightmapParameters: {fileID: 0}
305 | m_SortingLayerID: 0
306 | m_SortingOrder: 0
307 | --- !u!65 &1475523870
308 | BoxCollider:
309 | m_ObjectHideFlags: 0
310 | m_PrefabParentObject: {fileID: 0}
311 | m_PrefabInternal: {fileID: 0}
312 | m_GameObject: {fileID: 1475523868}
313 | m_Material: {fileID: 0}
314 | m_IsTrigger: 0
315 | m_Enabled: 1
316 | serializedVersion: 2
317 | m_Size: {x: 1, y: 1, z: 1}
318 | m_Center: {x: 0, y: 0, z: 0}
319 | --- !u!33 &1475523871
320 | MeshFilter:
321 | m_ObjectHideFlags: 0
322 | m_PrefabParentObject: {fileID: 0}
323 | m_PrefabInternal: {fileID: 0}
324 | m_GameObject: {fileID: 1475523868}
325 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
326 | --- !u!4 &1475523872
327 | Transform:
328 | m_ObjectHideFlags: 0
329 | m_PrefabParentObject: {fileID: 0}
330 | m_PrefabInternal: {fileID: 0}
331 | m_GameObject: {fileID: 1475523868}
332 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
333 | m_LocalPosition: {x: 8.93, y: 0, z: 0.22}
334 | m_LocalScale: {x: 0.5, y: 0.2, z: 0.5}
335 | m_Children: []
336 | m_Father: {fileID: 0}
337 | m_RootOrder: 1
338 |
--------------------------------------------------------------------------------
/TestScene.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: aabdae50f89ca4ed689e83c3db118d1b
3 | timeCreated: 1450992066
4 | licenseType: Pro
5 | DefaultImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------