Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e9c8196e4c | |||
| 3ed5cd974a | |||
| 3efd2a4018 | |||
| 24a02f9abc | |||
| 72f80fd838 | |||
| 7bf5df9b69 | |||
| bfa250ffd2 | |||
| a78ff6ce5d | |||
| c298401229 | |||
| e1e408580a | |||
| 17576b4713 | |||
| a173e5741f | |||
| 9c68c18384 | |||
| ace70b339d | |||
| ade1472080 | |||
| 1087f5faa3 | |||
| 72a91d052e |
@@ -552,13 +552,17 @@ public class BezierCurve : MonoBehaviour {
|
|||||||
distance -= totalLength;
|
distance -= totalLength;
|
||||||
return GetPoint(firstPoint, secondPoint, distance / curveLength);
|
return GetPoint(firstPoint, secondPoint, distance / curveLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector3 GetUniformPointAtDistance(float distance) {
|
private Vector3 GetAtPolylineDistance(float distance, bool returnDirection = false) {
|
||||||
|
Vector3 defaultDir = new Vector3(1, 0, 0);
|
||||||
if (distance <= 0) {
|
if (distance <= 0 || distance >= length) {
|
||||||
return points[0].position;
|
if (returnDirection) {
|
||||||
} else if (distance >= length) {
|
return defaultDir;
|
||||||
return points[points.Length - 1].position;
|
} else if (distance <= 0) {
|
||||||
|
return points[0].position;
|
||||||
|
} else {
|
||||||
|
return points[points.Length - 1].position;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float totalLength = 0;
|
float totalLength = 0;
|
||||||
@@ -581,22 +585,41 @@ public class BezierCurve : MonoBehaviour {
|
|||||||
//Calculate the very first line segment
|
//Calculate the very first line segment
|
||||||
Vector3 s1 = p1.position;
|
Vector3 s1 = p1.position;
|
||||||
Vector3 s2 = GetPoint(p1, p2, 1.0f / resolution);
|
Vector3 s2 = GetPoint(p1, p2, 1.0f / resolution);
|
||||||
float mag = (s2 - s1).magnitude;
|
Vector3 diff = s2 - s1;
|
||||||
|
Vector3 prevDiff = diff;
|
||||||
|
float mag = diff.magnitude;
|
||||||
float polylineLength = mag;
|
float polylineLength = mag;
|
||||||
|
|
||||||
//Keep calculating line segments until we have traveled more than curveDistance.
|
//Keep calculating line segments until we have traveled more than curveDistance.
|
||||||
for (int segmentIndex = 2; polylineLength < curveDistance; segmentIndex++) {
|
for (int segmentIndex = 2; polylineLength < curveDistance; segmentIndex++) {
|
||||||
|
prevDiff = diff;
|
||||||
s1 = s2;
|
s1 = s2;
|
||||||
s2 = GetPoint(p1, p2, (float)segmentIndex / resolution);
|
s2 = GetPoint(p1, p2, (float)segmentIndex / resolution);
|
||||||
mag = (s2 - s1).magnitude;
|
diff = s2 - s1;
|
||||||
|
mag = diff.magnitude;
|
||||||
polylineLength += mag;
|
polylineLength += mag;
|
||||||
}
|
}
|
||||||
//The desired position should be between s1 and s2.
|
if (returnDirection) {
|
||||||
//polylineLength should be slightly greater than curveDistance, the difference gives the 't' value.
|
//return diff; //This is the actual direction on the polyline, but it looks very jittery without interpolation.
|
||||||
return GetLinearPoint(s1, s2, 1 - (polylineLength - curveDistance) / mag);
|
return Vector3.Slerp(prevDiff.normalized, diff.normalized, 1 - (polylineLength - curveDistance) / mag);
|
||||||
|
} else {
|
||||||
|
//The desired position should be between s1 and s2.
|
||||||
|
//polylineLength should be slightly greater than curveDistance, the difference gives the 't' value.
|
||||||
|
return GetLinearPoint(s1, s2, 1 - (polylineLength - curveDistance) / mag);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Vector3.zero;
|
return returnDirection ? defaultDir : Vector3.zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vector3 GetDirectionAtDistance(float distance)
|
||||||
|
{
|
||||||
|
return GetAtPolylineDistance(distance, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vector3 GetUniformPointAtDistance(float distance)
|
||||||
|
{
|
||||||
|
return GetAtPolylineDistance(distance, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 912995729338dbb4aae9d6aa943b25bf
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1464292483
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 800 KiB |
@@ -0,0 +1,57 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 711b25ce3d0a68a4688b7a057fe2a426
|
||||||
|
timeCreated: 1464292695
|
||||||
|
licenseType: Free
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 0
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 7
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: -1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
textureType: -1
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,78 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ca652f1ffa90ce34b8b6c212b692ce91
|
||||||
|
timeCreated: 1464293075
|
||||||
|
licenseType: Free
|
||||||
|
ModelImporter:
|
||||||
|
serializedVersion: 19
|
||||||
|
fileIDToRecycleName:
|
||||||
|
100000: default
|
||||||
|
100002: //RootNode
|
||||||
|
400000: default
|
||||||
|
400002: //RootNode
|
||||||
|
2300000: default
|
||||||
|
3300000: default
|
||||||
|
4300000: default
|
||||||
|
materials:
|
||||||
|
importMaterials: 1
|
||||||
|
materialName: 0
|
||||||
|
materialSearch: 1
|
||||||
|
animations:
|
||||||
|
legacyGenerateAnimations: 4
|
||||||
|
bakeSimulation: 0
|
||||||
|
resampleRotations: 1
|
||||||
|
optimizeGameObjects: 0
|
||||||
|
motionNodeName:
|
||||||
|
animationImportErrors:
|
||||||
|
animationImportWarnings:
|
||||||
|
animationRetargetingWarnings:
|
||||||
|
animationDoRetargetingWarnings: 0
|
||||||
|
animationCompression: 1
|
||||||
|
animationRotationError: 0.5
|
||||||
|
animationPositionError: 0.5
|
||||||
|
animationScaleError: 0.5
|
||||||
|
animationWrapMode: 0
|
||||||
|
extraExposedTransformPaths: []
|
||||||
|
clipAnimations: []
|
||||||
|
isReadable: 1
|
||||||
|
meshes:
|
||||||
|
lODScreenPercentages: []
|
||||||
|
globalScale: 1
|
||||||
|
meshCompression: 0
|
||||||
|
addColliders: 0
|
||||||
|
importBlendShapes: 1
|
||||||
|
swapUVChannels: 0
|
||||||
|
generateSecondaryUV: 0
|
||||||
|
useFileUnits: 1
|
||||||
|
optimizeMeshForGPU: 1
|
||||||
|
keepQuads: 0
|
||||||
|
weldVertices: 1
|
||||||
|
secondaryUVAngleDistortion: 8
|
||||||
|
secondaryUVAreaDistortion: 15.000001
|
||||||
|
secondaryUVHardAngle: 88
|
||||||
|
secondaryUVPackMargin: 4
|
||||||
|
useFileScale: 1
|
||||||
|
tangentSpace:
|
||||||
|
normalSmoothAngle: 60
|
||||||
|
normalImportMode: 0
|
||||||
|
tangentImportMode: 3
|
||||||
|
importAnimation: 1
|
||||||
|
copyAvatar: 0
|
||||||
|
humanDescription:
|
||||||
|
human: []
|
||||||
|
skeleton: []
|
||||||
|
armTwist: 0.5
|
||||||
|
foreArmTwist: 0.5
|
||||||
|
upperLegTwist: 0.5
|
||||||
|
legTwist: 0.5
|
||||||
|
armStretch: 0.05
|
||||||
|
legStretch: 0.05
|
||||||
|
feetSpacing: 0
|
||||||
|
rootMotionBoneName:
|
||||||
|
hasTranslationDoF: 0
|
||||||
|
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||||
|
animationType: 0
|
||||||
|
humanoidOversampling: 1
|
||||||
|
additionalBone: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,78 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7b2e0bc3715f9654fb69d111eccb2f3b
|
||||||
|
timeCreated: 1464293075
|
||||||
|
licenseType: Free
|
||||||
|
ModelImporter:
|
||||||
|
serializedVersion: 19
|
||||||
|
fileIDToRecycleName:
|
||||||
|
100000: default
|
||||||
|
100002: //RootNode
|
||||||
|
400000: default
|
||||||
|
400002: //RootNode
|
||||||
|
2300000: default
|
||||||
|
3300000: default
|
||||||
|
4300000: default
|
||||||
|
materials:
|
||||||
|
importMaterials: 1
|
||||||
|
materialName: 0
|
||||||
|
materialSearch: 1
|
||||||
|
animations:
|
||||||
|
legacyGenerateAnimations: 4
|
||||||
|
bakeSimulation: 0
|
||||||
|
resampleRotations: 1
|
||||||
|
optimizeGameObjects: 0
|
||||||
|
motionNodeName:
|
||||||
|
animationImportErrors:
|
||||||
|
animationImportWarnings:
|
||||||
|
animationRetargetingWarnings:
|
||||||
|
animationDoRetargetingWarnings: 0
|
||||||
|
animationCompression: 1
|
||||||
|
animationRotationError: 0.5
|
||||||
|
animationPositionError: 0.5
|
||||||
|
animationScaleError: 0.5
|
||||||
|
animationWrapMode: 0
|
||||||
|
extraExposedTransformPaths: []
|
||||||
|
clipAnimations: []
|
||||||
|
isReadable: 1
|
||||||
|
meshes:
|
||||||
|
lODScreenPercentages: []
|
||||||
|
globalScale: 1
|
||||||
|
meshCompression: 0
|
||||||
|
addColliders: 0
|
||||||
|
importBlendShapes: 1
|
||||||
|
swapUVChannels: 0
|
||||||
|
generateSecondaryUV: 0
|
||||||
|
useFileUnits: 1
|
||||||
|
optimizeMeshForGPU: 1
|
||||||
|
keepQuads: 0
|
||||||
|
weldVertices: 1
|
||||||
|
secondaryUVAngleDistortion: 8
|
||||||
|
secondaryUVAreaDistortion: 15.000001
|
||||||
|
secondaryUVHardAngle: 88
|
||||||
|
secondaryUVPackMargin: 4
|
||||||
|
useFileScale: 1
|
||||||
|
tangentSpace:
|
||||||
|
normalSmoothAngle: 60
|
||||||
|
normalImportMode: 0
|
||||||
|
tangentImportMode: 3
|
||||||
|
importAnimation: 1
|
||||||
|
copyAvatar: 0
|
||||||
|
humanDescription:
|
||||||
|
human: []
|
||||||
|
skeleton: []
|
||||||
|
armTwist: 0.5
|
||||||
|
foreArmTwist: 0.5
|
||||||
|
upperLegTwist: 0.5
|
||||||
|
legTwist: 0.5
|
||||||
|
armStretch: 0.05
|
||||||
|
legStretch: 0.05
|
||||||
|
feetSpacing: 0
|
||||||
|
rootMotionBoneName:
|
||||||
|
hasTranslationDoF: 0
|
||||||
|
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||||
|
animationType: 0
|
||||||
|
humanoidOversampling: 1
|
||||||
|
additionalBone: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 800 KiB |
@@ -0,0 +1,57 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 27772411eb8d7d343b91d8dd1b5f5d90
|
||||||
|
timeCreated: 1464292695
|
||||||
|
licenseType: Free
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 0
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 7
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: -1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
textureType: -1
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 31355a9d11b36fd48906d913586af625
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1464293075
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3bebb187e9fb69840b7836e439cfda04
|
||||||
|
timeCreated: 1464293134
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 96327e05d43e0614db50f402dd5d3114
|
||||||
|
timeCreated: 1464293172
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3fea3da2da0476a44bf2b5e54374c12e
|
||||||
|
timeCreated: 1464303369
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 28768ecadc1a13e4d93899964ef4f390
|
||||||
|
timeCreated: 1464293075
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,78 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e2cee0ee452b7e446b9a299d41f22f0a
|
||||||
|
timeCreated: 1464293268
|
||||||
|
licenseType: Free
|
||||||
|
ModelImporter:
|
||||||
|
serializedVersion: 19
|
||||||
|
fileIDToRecycleName:
|
||||||
|
100000: default
|
||||||
|
100002: //RootNode
|
||||||
|
400000: default
|
||||||
|
400002: //RootNode
|
||||||
|
2300000: default
|
||||||
|
3300000: default
|
||||||
|
4300000: default
|
||||||
|
materials:
|
||||||
|
importMaterials: 1
|
||||||
|
materialName: 0
|
||||||
|
materialSearch: 1
|
||||||
|
animations:
|
||||||
|
legacyGenerateAnimations: 4
|
||||||
|
bakeSimulation: 0
|
||||||
|
resampleRotations: 1
|
||||||
|
optimizeGameObjects: 0
|
||||||
|
motionNodeName:
|
||||||
|
animationImportErrors:
|
||||||
|
animationImportWarnings:
|
||||||
|
animationRetargetingWarnings:
|
||||||
|
animationDoRetargetingWarnings: 0
|
||||||
|
animationCompression: 1
|
||||||
|
animationRotationError: 0.5
|
||||||
|
animationPositionError: 0.5
|
||||||
|
animationScaleError: 0.5
|
||||||
|
animationWrapMode: 0
|
||||||
|
extraExposedTransformPaths: []
|
||||||
|
clipAnimations: []
|
||||||
|
isReadable: 1
|
||||||
|
meshes:
|
||||||
|
lODScreenPercentages: []
|
||||||
|
globalScale: 1
|
||||||
|
meshCompression: 0
|
||||||
|
addColliders: 0
|
||||||
|
importBlendShapes: 1
|
||||||
|
swapUVChannels: 0
|
||||||
|
generateSecondaryUV: 0
|
||||||
|
useFileUnits: 1
|
||||||
|
optimizeMeshForGPU: 1
|
||||||
|
keepQuads: 0
|
||||||
|
weldVertices: 1
|
||||||
|
secondaryUVAngleDistortion: 8
|
||||||
|
secondaryUVAreaDistortion: 15.000001
|
||||||
|
secondaryUVHardAngle: 88
|
||||||
|
secondaryUVPackMargin: 4
|
||||||
|
useFileScale: 1
|
||||||
|
tangentSpace:
|
||||||
|
normalSmoothAngle: 60
|
||||||
|
normalImportMode: 0
|
||||||
|
tangentImportMode: 3
|
||||||
|
importAnimation: 1
|
||||||
|
copyAvatar: 0
|
||||||
|
humanDescription:
|
||||||
|
human: []
|
||||||
|
skeleton: []
|
||||||
|
armTwist: 0.5
|
||||||
|
foreArmTwist: 0.5
|
||||||
|
upperLegTwist: 0.5
|
||||||
|
legTwist: 0.5
|
||||||
|
armStretch: 0.05
|
||||||
|
legStretch: 0.05
|
||||||
|
feetSpacing: 0
|
||||||
|
rootMotionBoneName:
|
||||||
|
hasTranslationDoF: 0
|
||||||
|
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||||
|
animationType: 0
|
||||||
|
humanoidOversampling: 1
|
||||||
|
additionalBone: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,78 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f8e9876551e887d449dbb0e0116f0bc2
|
||||||
|
timeCreated: 1464303263
|
||||||
|
licenseType: Free
|
||||||
|
ModelImporter:
|
||||||
|
serializedVersion: 19
|
||||||
|
fileIDToRecycleName:
|
||||||
|
100000: default
|
||||||
|
100002: //RootNode
|
||||||
|
400000: default
|
||||||
|
400002: //RootNode
|
||||||
|
2300000: default
|
||||||
|
3300000: default
|
||||||
|
4300000: default
|
||||||
|
materials:
|
||||||
|
importMaterials: 1
|
||||||
|
materialName: 0
|
||||||
|
materialSearch: 1
|
||||||
|
animations:
|
||||||
|
legacyGenerateAnimations: 4
|
||||||
|
bakeSimulation: 0
|
||||||
|
resampleRotations: 1
|
||||||
|
optimizeGameObjects: 0
|
||||||
|
motionNodeName:
|
||||||
|
animationImportErrors:
|
||||||
|
animationImportWarnings:
|
||||||
|
animationRetargetingWarnings:
|
||||||
|
animationDoRetargetingWarnings: 0
|
||||||
|
animationCompression: 1
|
||||||
|
animationRotationError: 0.5
|
||||||
|
animationPositionError: 0.5
|
||||||
|
animationScaleError: 0.5
|
||||||
|
animationWrapMode: 0
|
||||||
|
extraExposedTransformPaths: []
|
||||||
|
clipAnimations: []
|
||||||
|
isReadable: 1
|
||||||
|
meshes:
|
||||||
|
lODScreenPercentages: []
|
||||||
|
globalScale: 1
|
||||||
|
meshCompression: 0
|
||||||
|
addColliders: 0
|
||||||
|
importBlendShapes: 1
|
||||||
|
swapUVChannels: 0
|
||||||
|
generateSecondaryUV: 0
|
||||||
|
useFileUnits: 1
|
||||||
|
optimizeMeshForGPU: 1
|
||||||
|
keepQuads: 0
|
||||||
|
weldVertices: 1
|
||||||
|
secondaryUVAngleDistortion: 8
|
||||||
|
secondaryUVAreaDistortion: 15.000001
|
||||||
|
secondaryUVHardAngle: 88
|
||||||
|
secondaryUVPackMargin: 4
|
||||||
|
useFileScale: 1
|
||||||
|
tangentSpace:
|
||||||
|
normalSmoothAngle: 60
|
||||||
|
normalImportMode: 0
|
||||||
|
tangentImportMode: 3
|
||||||
|
importAnimation: 1
|
||||||
|
copyAvatar: 0
|
||||||
|
humanDescription:
|
||||||
|
human: []
|
||||||
|
skeleton: []
|
||||||
|
armTwist: 0.5
|
||||||
|
foreArmTwist: 0.5
|
||||||
|
upperLegTwist: 0.5
|
||||||
|
legTwist: 0.5
|
||||||
|
armStretch: 0.05
|
||||||
|
legStretch: 0.05
|
||||||
|
feetSpacing: 0
|
||||||
|
rootMotionBoneName:
|
||||||
|
hasTranslationDoF: 0
|
||||||
|
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||||
|
animationType: 0
|
||||||
|
humanoidOversampling: 1
|
||||||
|
additionalBone: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 69 KiB |
@@ -0,0 +1,57 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2cb6a82d0e4fbff4fab0ceab7d1af00d
|
||||||
|
timeCreated: 1464303263
|
||||||
|
licenseType: Free
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 0
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 7
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: -1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
textureType: -1
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Regular → Executable
Regular → Executable
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b8b861d57adbe0c4abbdc5e33d07f9a7
|
||||||
|
timeCreated: 1464273398
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d9743f42607f262488f7fcadef7ff58e
|
||||||
|
timeCreated: 1464273668
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ea2aedfef7a357249b99040ce7a86d06
|
||||||
|
timeCreated: 1464274411
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2bc9c4fcdb2121d4b8383da9562d3282
|
||||||
|
timeCreated: 1464275163
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4f45ba05bd621894c8e2061f8e8d8a51
|
||||||
|
timeCreated: 1464281858
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 30776503cefd5ce4fb7d019ff3b4d7fc
|
||||||
|
timeCreated: 1464282388
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a25562228ee7b434bb78583f820c3009
|
||||||
|
timeCreated: 1464275702
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a5b8d0be60dae884d889481a7b7d561b
|
||||||
|
timeCreated: 1464293513
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e56c3c4ce0da74d4196c9d005840f90a
|
||||||
|
timeCreated: 1464303602
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Executable
BIN
Binary file not shown.
+8
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c1be310d4dc3f0741a75768cc27f107e
|
||||||
|
timeCreated: 1464323208
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Executable
BIN
Binary file not shown.
+8
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: afd179201f2b58d4aafb3069a8889929
|
||||||
|
timeCreated: 1464323284
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8382b3ab9ff439846b453005c3ab8513
|
||||||
|
timeCreated: 1464280539
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 09a41dbb2d4c40d45851ce278fd59691
|
||||||
|
timeCreated: 1464272886
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2781f3993f09a4843a05335c7a678d38
|
||||||
|
timeCreated: 1464274038
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d2c993f5cd7f4094199c55e90ccf71ac
|
||||||
|
timeCreated: 1464275426
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
@@ -1,20 +1,17 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
|
||||||
public class FurnitureMiniature : FurnitureObject {
|
public class FurnitureMiniature : MonoBehaviour {
|
||||||
public override void Grab(Transform attachment) {
|
|
||||||
|
public void Grab() {
|
||||||
transform.parent = null;
|
transform.parent = null;
|
||||||
foreach (var collider in GetComponentsInChildren<Collider>()) {
|
foreach (var collider in GetComponentsInChildren<Collider>()) {
|
||||||
collider.enabled = false;
|
collider.enabled = false;
|
||||||
}
|
}
|
||||||
GetComponent<Rigidbody>().isKinematic = true;
|
GetComponent<Rigidbody>().isKinematic = true;
|
||||||
|
|
||||||
var mini = gameObject.AddComponent<WarehouseMiniatureAnim>();
|
|
||||||
mini.DestinationAttachment = attachment;
|
|
||||||
mini.Duration = 0.33f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Release() {
|
public void Release() {
|
||||||
var mini = gameObject.GetComponent<WarehouseMiniatureAnim>();
|
var mini = gameObject.GetComponent<WarehouseMiniatureAnim>();
|
||||||
if (mini) {
|
if (mini) {
|
||||||
mini.End();
|
mini.End();
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
using UnityEngine;
|
|
||||||
using System.Collections;
|
|
||||||
|
|
||||||
public class FurnitureObject : MonoBehaviour {
|
|
||||||
public virtual void Grab(Transform attachment) { }
|
|
||||||
public virtual void Release() { }
|
|
||||||
}
|
|
||||||
Binary file not shown.
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3ad6504734da8c44eb99f4241e6e367c
|
||||||
|
timeCreated: 1464276022
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
+18
-15
@@ -3,16 +3,15 @@ using System.Collections;
|
|||||||
|
|
||||||
public class LeftController : MonoBehaviour {
|
public class LeftController : MonoBehaviour {
|
||||||
|
|
||||||
public bool AlwaysCenter = false;
|
public GameObject MainCamera;
|
||||||
|
public GameObject WarehouseCamera;
|
||||||
|
public GameObject NormalRoom;
|
||||||
|
public GameObject TransparentRoom;
|
||||||
|
|
||||||
Transform controllerRig;
|
Transform controllerRig;
|
||||||
SteamVR_ControllerEvents controllerEvents;
|
SteamVR_ControllerEvents controllerEvents;
|
||||||
|
|
||||||
GameObject mainCamera;
|
|
||||||
GameObject warehouseCamera;
|
|
||||||
|
|
||||||
CameraFade cameraFade;
|
CameraFade cameraFade;
|
||||||
SteamVR_Camera mainSteamVRCamera;
|
|
||||||
|
|
||||||
bool inWarehouse = false;
|
bool inWarehouse = false;
|
||||||
|
|
||||||
@@ -21,14 +20,11 @@ public class LeftController : MonoBehaviour {
|
|||||||
|
|
||||||
controllerEvents = GetComponent<SteamVR_ControllerEvents>();
|
controllerEvents = GetComponent<SteamVR_ControllerEvents>();
|
||||||
controllerEvents.TriggerAxisChanged += triggerAxisChanged;
|
controllerEvents.TriggerAxisChanged += triggerAxisChanged;
|
||||||
|
|
||||||
|
cameraFade = MainCamera.GetComponentInChildren<CameraFade>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Start () {
|
void Start () {
|
||||||
mainCamera = GameObject.Find("Main Camera (origin)");
|
|
||||||
warehouseCamera = GameObject.Find("Warehouse Camera (origin)");
|
|
||||||
|
|
||||||
cameraFade = mainCamera.GetComponentInChildren<CameraFade>();
|
|
||||||
mainSteamVRCamera = mainCamera.GetComponentInChildren<SteamVR_Camera>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void triggerAxisChanged(object sender, ControllerClickedEventArgs e) {
|
void triggerAxisChanged(object sender, ControllerClickedEventArgs e) {
|
||||||
@@ -36,18 +32,25 @@ public class LeftController : MonoBehaviour {
|
|||||||
if (alpha > 0.05) {
|
if (alpha > 0.05) {
|
||||||
cameraFade.SetFade(alpha);
|
cameraFade.SetFade(alpha);
|
||||||
if (!inWarehouse) {
|
if (!inWarehouse) {
|
||||||
controllerRig.SetParent(warehouseCamera.transform, false);
|
WarehouseCamera.SetActive(true);
|
||||||
if (AlwaysCenter) {
|
controllerRig.SetParent(WarehouseCamera.transform, false);
|
||||||
warehouseCamera.transform.localPosition = new Vector3(-mainSteamVRCamera.head.localPosition.x, warehouseCamera.transform.localPosition.y, -mainSteamVRCamera.head.localPosition.z);
|
|
||||||
}
|
|
||||||
inWarehouse = true;
|
inWarehouse = true;
|
||||||
|
NormalRoom.SetActive(false);
|
||||||
|
TransparentRoom.SetActive(true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cameraFade.SetFade(0.0f);
|
cameraFade.SetFade(0.0f);
|
||||||
if (inWarehouse) {
|
if (inWarehouse) {
|
||||||
controllerRig.SetParent(mainCamera.transform, false);
|
controllerRig.SetParent(MainCamera.transform, false);
|
||||||
|
WarehouseCamera.SetActive(false);
|
||||||
inWarehouse = false;
|
inWarehouse = false;
|
||||||
|
NormalRoom.SetActive(true);
|
||||||
|
TransparentRoom.SetActive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var measurement in GameObject.FindObjectsOfType<Measurement>()) {
|
||||||
|
measurement.InWarehouse = inWarehouse;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Executable
BIN
Binary file not shown.
Executable
+8
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5199afd07a1d6704f9f637d2c69589ef
|
||||||
|
timeCreated: 1464283623
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Executable
BIN
Binary file not shown.
Executable
+8
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 72f984ea83bdc9448af562fb6aae58f5
|
||||||
|
timeCreated: 1464283623
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Executable
BIN
Binary file not shown.
Executable
+8
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c26ef51d558cbfd4ea5aefd315c6bce2
|
||||||
|
timeCreated: 1464283623
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
BIN
Binary file not shown.
Regular → Executable
Binary file not shown.
Executable
BIN
Binary file not shown.
+8
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ad48742d936eb5f4d9712328a2fa4b78
|
||||||
|
timeCreated: 1464283623
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Executable
BIN
Binary file not shown.
Executable
+8
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3ed07849ee4a36e4bb43884947ad9d0b
|
||||||
|
timeCreated: 1464283623
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Executable
BIN
Binary file not shown.
Executable
+8
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 042e68e76d707f64d87ad81b1553689b
|
||||||
|
timeCreated: 1464283623
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Executable
BIN
Binary file not shown.
Executable
+8
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0a1e038fe41be8e46943649e975a4388
|
||||||
|
timeCreated: 1464283623
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Executable
BIN
Binary file not shown.
+8
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a6c72dd2f75ee0047aee409ee24fcc50
|
||||||
|
timeCreated: 1464283623
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
+8
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 268472f8b4d3fd544b30cbf900577455
|
||||||
|
timeCreated: 1464283623
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Executable
BIN
Binary file not shown.
Executable
+8
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 93beb8d361d6fa74783fe650a8ac8345
|
||||||
|
timeCreated: 1464283623
|
||||||
|
licenseType: Free
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
+84
-18
@@ -8,60 +8,126 @@ public class Measurement : MonoBehaviour {
|
|||||||
public Vector3 EndPosition;
|
public Vector3 EndPosition;
|
||||||
private float HoleSize = 0.1f;
|
private float HoleSize = 0.1f;
|
||||||
private Vector3 lineUp = new Vector3(0, 1, 0);
|
private Vector3 lineUp = new Vector3(0, 1, 0);
|
||||||
|
private float DefaultLineWith = 0.005f;
|
||||||
|
|
||||||
|
private Vector3 LocalStartPosition;
|
||||||
|
private Vector3 LocalEndPosition;
|
||||||
|
|
||||||
|
private float LineWidth;
|
||||||
|
|
||||||
|
public bool InWarehouse = false;
|
||||||
|
|
||||||
// Use this for initialization
|
// Use this for initialization
|
||||||
void Start () {
|
void Start () {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update () {
|
void Update ()
|
||||||
|
{
|
||||||
|
LocalStartPosition = transform.TransformPoint(StartPosition);
|
||||||
|
LocalEndPosition = transform.TransformPoint(EndPosition);
|
||||||
|
|
||||||
Transform line1Transform = transform.FindChild("Line1");
|
Transform line1Transform = transform.FindChild("Line1");
|
||||||
LineRenderer line1Renderer = line1Transform.GetComponent<LineRenderer>();
|
LineRenderer line1Renderer = line1Transform.GetComponent<LineRenderer>();
|
||||||
|
|
||||||
Transform line2Transform = transform.FindChild("Line2");
|
Transform line2Transform = transform.FindChild("Line2");
|
||||||
LineRenderer line2Renderer = line2Transform.GetComponent<LineRenderer>();
|
LineRenderer line2Renderer = line2Transform.GetComponent<LineRenderer>();
|
||||||
|
|
||||||
Vector3 middlePosition = (StartPosition + (EndPosition - StartPosition) / 2.0f);
|
Vector3 middlePosition = (LocalStartPosition + (LocalEndPosition - LocalStartPosition) / 2.0f);
|
||||||
|
|
||||||
float magnitude = (EndPosition - StartPosition).magnitude;
|
|
||||||
Vector3 direction = Vector3.Normalize(EndPosition - StartPosition);
|
|
||||||
|
|
||||||
line1Renderer.SetPosition(0, StartPosition);
|
float smallestScale = Mathf.Min(transform.lossyScale.x, Mathf.Min(transform.lossyScale.y, transform.lossyScale.z));
|
||||||
|
|
||||||
|
if(InWarehouse) {
|
||||||
|
smallestScale = smallestScale / 10.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (smallestScale < 0.4f)
|
||||||
|
{
|
||||||
|
HoleSize = 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
Vector3 startToEnd = LocalEndPosition - LocalStartPosition;
|
||||||
|
float magnitude = startToEnd.magnitude;
|
||||||
|
Vector3 direction = Vector3.Normalize(LocalEndPosition - LocalStartPosition);
|
||||||
|
|
||||||
|
line1Renderer.SetPosition(0, LocalStartPosition);
|
||||||
line1Renderer.SetPosition(1, middlePosition - (direction * HoleSize));
|
line1Renderer.SetPosition(1, middlePosition - (direction * HoleSize));
|
||||||
|
|
||||||
line2Renderer.SetPosition(0, middlePosition +(direction * HoleSize));
|
line2Renderer.SetPosition(0, middlePosition +(direction * HoleSize));
|
||||||
line2Renderer.SetPosition(1, EndPosition);
|
line2Renderer.SetPosition(1, LocalEndPosition);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Transform textTransform = transform.FindChild("Text");
|
|
||||||
|
Transform textTransform = transform.FindChild("Text");
|
||||||
textTransform.position = middlePosition;
|
textTransform.position = middlePosition;
|
||||||
|
|
||||||
if (Camera.current != null)
|
if (Camera.current != null)
|
||||||
{
|
{
|
||||||
textTransform.LookAt(Vector3.Normalize(textTransform.position - Camera.current.transform.position) + textTransform.position);
|
textTransform.LookAt(Vector3.Normalize(textTransform.position - Camera.current.transform.position) + textTransform.position);
|
||||||
lineUp = Vector3.Normalize(Vector3.Cross(middlePosition - Camera.current.transform.position, EndPosition - StartPosition));
|
lineUp = Vector3.Normalize(Vector3.Cross(middlePosition - Camera.current.transform.position, LocalEndPosition - LocalStartPosition));
|
||||||
}
|
}
|
||||||
|
|
||||||
TextMesh textMesh = textTransform.GetComponent<TextMesh>();
|
TextMesh textMesh = textTransform.GetComponent<TextMesh>();
|
||||||
textMesh.text = magnitude.ToString("0.00") + "m";
|
|
||||||
|
Vector3 inverseScale = new Vector3(1.0f / transform.lossyScale.x, 1.0f / transform.lossyScale.y, 1.0f / transform.lossyScale.z);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
textMesh.characterSize = Mathf.Max(0.001f * Math.Min(1.0f , magnitude), 0.0005f);
|
float textMagnitude = transform.InverseTransformVector(startToEnd).magnitude;
|
||||||
|
|
||||||
|
textMesh.text = textMagnitude.ToString("0.00") + "m";
|
||||||
|
|
||||||
|
|
||||||
|
textMesh.characterSize = Mathf.Max(0.0005f * Math.Min(1.0f , textMagnitude), 0.0005f);
|
||||||
|
|
||||||
HoleSize = Mathf.Max(0.1f * Math.Min(1.0f, magnitude), 0.05f);
|
HoleSize = Mathf.Max(0.1f * Math.Min(1.0f, magnitude), 0.05f);
|
||||||
|
|
||||||
Transform line1BaseTransform = transform.FindChild("Line1Base");
|
Transform line1BaseTransform = transform.FindChild("Line1Base");
|
||||||
LineRenderer line1BaseRenderer = line1BaseTransform.GetComponent<LineRenderer>();
|
LineRenderer line1BaseRenderer = line1BaseTransform.GetComponent<LineRenderer>();
|
||||||
|
|
||||||
line1BaseRenderer.SetPosition(0, StartPosition + lineUp * 0.01f);
|
line1BaseRenderer.SetPosition(0, LocalStartPosition + lineUp * 0.01f);
|
||||||
line1BaseRenderer.SetPosition(1, StartPosition - lineUp * 0.01f);
|
line1BaseRenderer.SetPosition(1, LocalStartPosition - lineUp * 0.01f);
|
||||||
|
|
||||||
|
|
||||||
Transform line2BaseTransform = transform.FindChild("Line2Base");
|
Transform line2BaseTransform = transform.FindChild("Line2Base");
|
||||||
LineRenderer line2BaseRenderer = line2BaseTransform.GetComponent<LineRenderer>();
|
LineRenderer line2BaseRenderer = line2BaseTransform.GetComponent<LineRenderer>();
|
||||||
|
|
||||||
line2BaseRenderer.SetPosition(0, EndPosition + lineUp * 0.01f);
|
line2BaseRenderer.SetPosition(0, LocalEndPosition + lineUp * 0.01f);
|
||||||
line2BaseRenderer.SetPosition(1, EndPosition - lineUp * 0.01f);
|
line2BaseRenderer.SetPosition(1, LocalEndPosition - lineUp * 0.01f);
|
||||||
}
|
|
||||||
|
if(InWarehouse) {
|
||||||
|
LineWidth = 0.007f;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LineWidth = Mathf.Min(DefaultLineWith * smallestScale, 0.003f);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
line1Renderer.SetWidth(LineWidth, LineWidth);
|
||||||
|
line2Renderer.SetWidth(LineWidth, LineWidth);
|
||||||
|
line1BaseRenderer.SetWidth(LineWidth, LineWidth);
|
||||||
|
line2BaseRenderer.SetWidth(LineWidth, LineWidth);
|
||||||
|
|
||||||
|
|
||||||
|
if (smallestScale < 0.4f)
|
||||||
|
{
|
||||||
|
Transform lineMiddleTransform = transform.FindChild("LineMiddle");
|
||||||
|
LineRenderer lineMiddleRenderer = line1BaseTransform.GetComponent<LineRenderer>();
|
||||||
|
lineMiddleRenderer.SetWidth(LineWidth, LineWidth);
|
||||||
|
|
||||||
|
Vector3 upDistance = new Vector3(0, 20.0f, 0);
|
||||||
|
upDistance = upDistance*smallestScale;
|
||||||
|
|
||||||
|
textTransform.position = middlePosition + upDistance*1.1f;
|
||||||
|
textMesh.characterSize = 0.005f;
|
||||||
|
|
||||||
|
lineMiddleRenderer.SetPosition(0, middlePosition);
|
||||||
|
lineMiddleRenderer.SetPosition(1, middlePosition + upDistance);
|
||||||
|
} else {
|
||||||
|
Transform lineMiddleTransform = transform.FindChild("LineMiddle");
|
||||||
|
LineRenderer lineMiddleRenderer = lineMiddleTransform.GetComponent<LineRenderer>();
|
||||||
|
lineMiddleRenderer.SetWidth(0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user