update
This commit is contained in:
BIN
3D/Assets/Assets/Models/map1.blend
Normal file
BIN
3D/Assets/Assets/Models/map1.blend
Normal file
Binary file not shown.
102
3D/Assets/Assets/Models/map1.blend.meta
Normal file
102
3D/Assets/Assets/Models/map1.blend.meta
Normal file
@@ -0,0 +1,102 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 910da85b9980587469a455dc1cbca10e
|
||||
ModelImporter:
|
||||
serializedVersion: 20200
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
materials:
|
||||
materialImportMode: 2
|
||||
materialName: 0
|
||||
materialSearch: 1
|
||||
materialLocation: 1
|
||||
animations:
|
||||
legacyGenerateAnimations: 4
|
||||
bakeSimulation: 0
|
||||
resampleCurves: 1
|
||||
optimizeGameObjects: 0
|
||||
motionNodeName:
|
||||
rigImportErrors:
|
||||
rigImportWarnings:
|
||||
animationImportErrors:
|
||||
animationImportWarnings:
|
||||
animationRetargetingWarnings:
|
||||
animationDoRetargetingWarnings: 0
|
||||
importAnimatedCustomProperties: 0
|
||||
importConstraints: 0
|
||||
animationCompression: 1
|
||||
animationRotationError: 0.5
|
||||
animationPositionError: 0.5
|
||||
animationScaleError: 0.5
|
||||
animationWrapMode: 0
|
||||
extraExposedTransformPaths: []
|
||||
extraUserProperties: []
|
||||
clipAnimations: []
|
||||
isReadable: 0
|
||||
meshes:
|
||||
lODScreenPercentages: []
|
||||
globalScale: 1
|
||||
meshCompression: 0
|
||||
addColliders: 0
|
||||
useSRGBMaterialColor: 1
|
||||
sortHierarchyByName: 1
|
||||
importVisibility: 1
|
||||
importBlendShapes: 1
|
||||
importCameras: 1
|
||||
importLights: 1
|
||||
fileIdsGeneration: 2
|
||||
swapUVChannels: 0
|
||||
generateSecondaryUV: 0
|
||||
useFileUnits: 1
|
||||
keepQuads: 0
|
||||
weldVertices: 1
|
||||
bakeAxisConversion: 0
|
||||
preserveHierarchy: 0
|
||||
skinWeightsMode: 0
|
||||
maxBonesPerVertex: 4
|
||||
minBoneWeight: 0.001
|
||||
meshOptimizationFlags: -1
|
||||
indexFormat: 0
|
||||
secondaryUVAngleDistortion: 8
|
||||
secondaryUVAreaDistortion: 15.000001
|
||||
secondaryUVHardAngle: 88
|
||||
secondaryUVMarginMethod: 1
|
||||
secondaryUVMinLightmapResolution: 40
|
||||
secondaryUVMinObjectScale: 1
|
||||
secondaryUVPackMargin: 4
|
||||
useFileScale: 1
|
||||
tangentSpace:
|
||||
normalSmoothAngle: 60
|
||||
normalImportMode: 0
|
||||
tangentImportMode: 3
|
||||
normalCalculationMode: 4
|
||||
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
|
||||
blendShapeNormalImportMode: 1
|
||||
normalSmoothingSource: 0
|
||||
referencedClips: []
|
||||
importAnimation: 1
|
||||
humanDescription:
|
||||
serializedVersion: 3
|
||||
human: []
|
||||
skeleton: []
|
||||
armTwist: 0.5
|
||||
foreArmTwist: 0.5
|
||||
upperLegTwist: 0.5
|
||||
legTwist: 0.5
|
||||
armStretch: 0.05
|
||||
legStretch: 0.05
|
||||
feetSpacing: 0
|
||||
globalScale: 1
|
||||
rootMotionBoneName:
|
||||
hasTranslationDoF: 0
|
||||
hasExtraRoot: 0
|
||||
skeletonHasParents: 1
|
||||
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||
autoGenerateAvatarMappingIfUnspecified: 1
|
||||
animationType: 2
|
||||
humanoidOversampling: 1
|
||||
avatarSetup: 0
|
||||
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
|
||||
additionalBone: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,12 +5,14 @@ using UnityEngine;
|
||||
public class TestMovement : MonoBehaviour
|
||||
{
|
||||
public CharacterController controller;
|
||||
//public Transform gameobject;
|
||||
|
||||
public float speed = 15f;
|
||||
public float turnSmoothness = 0.1f;
|
||||
public float targetAngle, angle;
|
||||
float turnSmoothVelocity;
|
||||
float x, y;
|
||||
Vector3 direction;
|
||||
public Vector3 direction;
|
||||
|
||||
void Update()
|
||||
{
|
||||
@@ -19,10 +21,11 @@ public class TestMovement : MonoBehaviour
|
||||
direction = new Vector3(x, 0f, y).normalized;
|
||||
|
||||
if (direction.magnitude >= 0.1f) {
|
||||
float targetAngle = Mathf.Atan2(direction.x, direction.z) * Mathf.Rad2Deg;
|
||||
float angle = Mathf.SmoothDampAngle(transform.eulerAngles.z, targetAngle, ref turnSmoothVelocity, turnSmoothness);
|
||||
targetAngle = Mathf.Atan2(direction.x, direction.z) * Mathf.Rad2Deg; //+ gameobject.eulerAngles.y
|
||||
angle = Mathf.SmoothDampAngle(transform.eulerAngles.y, targetAngle, ref turnSmoothVelocity, turnSmoothness);
|
||||
transform.rotation = Quaternion.Euler(-90f, angle, 0f);
|
||||
|
||||
//Vector3 moveDir = Quaternion.Euler(0f, targetAngle, 0f) * Vector3.forward;
|
||||
controller.Move(direction * speed * Time.deltaTime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,5 +4,8 @@
|
||||
EditorBuildSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Scenes: []
|
||||
m_Scenes:
|
||||
- enabled: 1
|
||||
path: Assets/Scenes/Main.unity
|
||||
guid: 8affbd857429e524fb295f491f139722
|
||||
m_configObjects: {}
|
||||
|
||||
Reference in New Issue
Block a user