diff --git a/IronToad_UnityProject/Assets/Art/Models/lightHouse_LOW.obj.meta b/IronToad_UnityProject/Assets/Art/Models/lightHouse_LOW.obj.meta deleted file mode 100644 index d94fc60..0000000 --- a/IronToad_UnityProject/Assets/Art/Models/lightHouse_LOW.obj.meta +++ /dev/null @@ -1,82 +0,0 @@ -fileFormatVersion: 2 -guid: 919eb0dba9aa0da44aec3a80f1cf98ea -timeCreated: 1485000000 -licenseType: Free -ModelImporter: - serializedVersion: 19 - fileIDToRecycleName: - 100000: lighthouse - 100002: //RootNode - 400000: lighthouse - 400002: //RootNode - 2300000: lighthouse - 3300000: lighthouse - 4300000: lighthouse - materials: - importMaterials: 1 - materialName: 0 - materialSearch: 1 - animations: - legacyGenerateAnimations: 4 - bakeSimulation: 0 - resampleCurves: 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: - serializedVersion: 2 - human: [] - skeleton: [] - armTwist: 0.5 - foreArmTwist: 0.5 - upperLegTwist: 0.5 - legTwist: 0.5 - armStretch: 0.05 - legStretch: 0.05 - feetSpacing: 0 - rootMotionBoneName: - rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} - hasTranslationDoF: 0 - hasExtraRoot: 0 - skeletonHasParents: 1 - lastHumanDescriptionAvatarSource: {instanceID: 0} - animationType: 0 - humanoidOversampling: 1 - additionalBone: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/Art/Models/pier.obj.meta b/IronToad_UnityProject/Assets/Art/Models/pier.obj.meta deleted file mode 100644 index 92a0183..0000000 --- a/IronToad_UnityProject/Assets/Art/Models/pier.obj.meta +++ /dev/null @@ -1,82 +0,0 @@ -fileFormatVersion: 2 -guid: 37549450629db464abffe54861590cf3 -timeCreated: 1485008673 -licenseType: Free -ModelImporter: - serializedVersion: 19 - fileIDToRecycleName: - 100000: pCylinder3 - 100002: //RootNode - 400000: pCylinder3 - 400002: //RootNode - 2300000: pCylinder3 - 3300000: pCylinder3 - 4300000: pCylinder3 - materials: - importMaterials: 1 - materialName: 0 - materialSearch: 1 - animations: - legacyGenerateAnimations: 4 - bakeSimulation: 0 - resampleCurves: 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: - serializedVersion: 2 - human: [] - skeleton: [] - armTwist: 0.5 - foreArmTwist: 0.5 - upperLegTwist: 0.5 - legTwist: 0.5 - armStretch: 0.05 - legStretch: 0.05 - feetSpacing: 0 - rootMotionBoneName: - rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} - hasTranslationDoF: 0 - hasExtraRoot: 0 - skeletonHasParents: 1 - lastHumanDescriptionAvatarSource: {instanceID: 0} - animationType: 0 - humanoidOversampling: 1 - additionalBone: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/Scripts/CustomSmoothFollow.cs b/IronToad_UnityProject/Assets/Scripts/CustomSmoothFollow.cs index 5f29e43..2a36673 100644 --- a/IronToad_UnityProject/Assets/Scripts/CustomSmoothFollow.cs +++ b/IronToad_UnityProject/Assets/Scripts/CustomSmoothFollow.cs @@ -12,6 +12,8 @@ public class CustomSmoothFollow : MonoBehaviour public Vector3 damping; public string layerToMask = "CameraObstruct"; private int layerMask; + [Range (0,360)] + public float offsetAngle = 90; // Use this for initialization void Start() @@ -33,6 +35,10 @@ public class CustomSmoothFollow : MonoBehaviour bool isBlocked = false; Vector3 wantedPos = new Vector3(wantedSide, wantedHeight, wantedDistance); + + wantedPos = RotatePointAroundPivot(wantedPos, target.transform.position, offsetAngle); + + RaycastHit hitInfo; if (Physics.Raycast(wantedPos, target.position-wantedPos, out hitInfo, (target.position-wantedPos).magnitude * 2f)) { @@ -50,21 +56,37 @@ public class CustomSmoothFollow : MonoBehaviour float currentDistance = transform.position.z; float currentSide = transform.position.x; + + // Damp the height - currentHeight = Mathf.Lerp(currentHeight, wantedHeight, damping.y * Time.deltaTime); - currentDistance = Mathf.Lerp(currentDistance, wantedDistance, damping.z * Time.deltaTime); - currentSide = Mathf.Lerp(currentSide, wantedSide, damping.x * Time.deltaTime); + currentHeight = Mathf.Lerp(currentHeight, wantedPos.y, damping.y * Time.deltaTime); + currentDistance = Mathf.Lerp(currentDistance, wantedPos.z, damping.z * Time.deltaTime); + currentSide = Mathf.Lerp(currentSide, wantedPos.x, damping.x * Time.deltaTime); // Set the position of the camera on the x-z plane to: // distance meters behind the target transform.position = target.position; + + // Set the height of the camera transform.position = new Vector3(currentSide, currentHeight, currentDistance); + // Always look at the target Vector3 lookTarget = target.position; - lookTarget.x = transform.position.x; + lookTarget.z = transform.position.z; transform.LookAt(lookTarget); + + + + } + + private Vector3 RotatePointAroundPivot(Vector3 point,Vector3 pivot,float angles ) { + Vector3 dir = point - pivot; // get point direction relative to pivot + dir = Quaternion.Euler(angles * Vector3.up) * dir; // rotate it + point = dir + pivot; // calculate rotated point + return point; // return it + } } diff --git a/IronToad_UnityProject/Assets/Scripts/DontRotate.cs b/IronToad_UnityProject/Assets/Scripts/DontRotate.cs index 1ef8c6f..646b547 100644 --- a/IronToad_UnityProject/Assets/Scripts/DontRotate.cs +++ b/IronToad_UnityProject/Assets/Scripts/DontRotate.cs @@ -4,7 +4,7 @@ using UnityEngine; public class DontRotate : MonoBehaviour { - private Quaternion originalRot; + public Quaternion originalRot; public float maxAngle; diff --git a/IronToad_UnityProject/Assets/Sound.meta b/IronToad_UnityProject/Assets/Sound.meta new file mode 100644 index 0000000..f8e9b50 --- /dev/null +++ b/IronToad_UnityProject/Assets/Sound.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 844c4f25011b45348a5db5bc5b4f956e +folderAsset: yes +timeCreated: 1485037848 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/Sound/Music.meta b/IronToad_UnityProject/Assets/Sound/Music.meta new file mode 100644 index 0000000..b3ddd5b --- /dev/null +++ b/IronToad_UnityProject/Assets/Sound/Music.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1715d56e0d2b68246a82993db31014ab +folderAsset: yes +timeCreated: 1485038927 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/Sound/SFX.meta b/IronToad_UnityProject/Assets/Sound/SFX.meta new file mode 100644 index 0000000..795aecf --- /dev/null +++ b/IronToad_UnityProject/Assets/Sound/SFX.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: de5a3adcedb96f64183518ac89622ade +folderAsset: yes +timeCreated: 1485038927 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/Textures.meta b/IronToad_UnityProject/Assets/Textures.meta new file mode 100644 index 0000000..ffdd440 --- /dev/null +++ b/IronToad_UnityProject/Assets/Textures.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 2a6e699820a38a544acfc0015eb679a2 +folderAsset: yes +timeCreated: 1484972317 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/IronToad_UnityProject/Assets/_Scenes/GreyBox_Prototype.meta b/IronToad_UnityProject/Assets/_Scenes/GreyBox_Prototype.meta new file mode 100644 index 0000000..47507ca --- /dev/null +++ b/IronToad_UnityProject/Assets/_Scenes/GreyBox_Prototype.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 338533d5d159c00478a9fb5321b7d922 +folderAsset: yes +timeCreated: 1485007190 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: