Initial commit
This commit is contained in:
5
Game/Assets/Standard Assets/Character Controllers.meta
Normal file
5
Game/Assets/Standard Assets/Character Controllers.meta
Normal file
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 54216e9ed42974e30967824b7f0b2806
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9d4133d5d30b644bd87802a347eaccbe
|
||||
NativeFormatImporter:
|
||||
userData:
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7e0b0a994d8934541a387e092630b5db
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c81df2918c80c054ca3d436e62090893
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,289 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 449b48f7eb5d87a4baaa5fb73f875a59
|
||||
ModelImporter:
|
||||
serializedVersion: 16
|
||||
fileIDToRecycleName:
|
||||
100000: Bip001 R Finger1
|
||||
100002: Bip001 R Finger21
|
||||
100004: Bip001 R Finger11
|
||||
100006: Bip001 R Finger02
|
||||
100010: Bip001 R Finger12
|
||||
100012: Bip001 R Finger41
|
||||
100014: Bip001 R Finger4
|
||||
100018: Bip001 R Finger32
|
||||
100020: Bip001 R Finger31
|
||||
100022: Bip001 R Finger3
|
||||
100026: hip_adjustment_bone_right
|
||||
100028: Bip001 R Finger42
|
||||
100032: hip_adjustment_bone_left
|
||||
100034: Bip001 R Finger2
|
||||
100036: Bip001 R Finger22
|
||||
100040: Bip001 R UpperArm
|
||||
100042: Bip001 R Forearm
|
||||
100044: Bip001 R Finger0
|
||||
100046: Bip001 R Finger01
|
||||
100052: //RootNode
|
||||
100054: Bip001 R Clavicle
|
||||
100058: Bip001 L Finger3
|
||||
100060: Bip001 L Finger31
|
||||
100062: Bip001 L Finger32
|
||||
100066: Bip001 L Finger4
|
||||
100068: Bip001 L Finger41
|
||||
100070: Bip001 L Finger42
|
||||
100074: Bip001 L Finger22
|
||||
100076: Bip001 L Finger02
|
||||
100080: Bip001 L Finger1
|
||||
100082: Bip001 L Finger11
|
||||
100084: Bip001 L Finger12
|
||||
100088: Bip001 L Finger2
|
||||
100090: Bip001 L Finger21
|
||||
100092: Bip001 L Finger0
|
||||
100094: Bip001 L Finger01
|
||||
100096: Bip001 L Forearm
|
||||
100098: Bip001 L UpperArm
|
||||
100100: Bip001 L Clavicle
|
||||
100102: construction_worker
|
||||
100104: Bip001 R Toe0
|
||||
100106: Bip001 R Foot
|
||||
100108: Bip001 R Calf
|
||||
100110: Bip001 R Thigh
|
||||
100112: Bip001 L Toe0
|
||||
100114: Bip001 L Foot
|
||||
100116: Bip001 L Calf
|
||||
100118: Bip001 L Thigh
|
||||
100120: helmet_bone
|
||||
100124: Bip001 Head
|
||||
100126: wrench
|
||||
100128: Bip001 R Hand
|
||||
100130: Bip001 L Hand
|
||||
100132: Bip001 Neck
|
||||
100134: Bip001 Spine1
|
||||
100136: Bip001 Spine
|
||||
100138: Bip001 Pelvis
|
||||
100140: Bip001
|
||||
400000: Bip001 R Finger1
|
||||
400002: Bip001 R Finger21
|
||||
400004: Bip001 R Finger11
|
||||
400006: Bip001 R Finger02
|
||||
400010: Bip001 R Finger12
|
||||
400012: Bip001 R Finger41
|
||||
400014: Bip001 R Finger4
|
||||
400018: Bip001 R Finger32
|
||||
400020: Bip001 R Finger31
|
||||
400022: Bip001 R Finger3
|
||||
400026: hip_adjustment_bone_right
|
||||
400028: Bip001 R Finger42
|
||||
400032: hip_adjustment_bone_left
|
||||
400034: Bip001 R Finger2
|
||||
400036: Bip001 R Finger22
|
||||
400040: Bip001 R UpperArm
|
||||
400042: Bip001 R Forearm
|
||||
400044: Bip001 R Finger0
|
||||
400046: Bip001 R Finger01
|
||||
400052: //RootNode
|
||||
400054: Bip001 R Clavicle
|
||||
400058: Bip001 L Finger3
|
||||
400060: Bip001 L Finger31
|
||||
400062: Bip001 L Finger32
|
||||
400066: Bip001 L Finger4
|
||||
400068: Bip001 L Finger41
|
||||
400070: Bip001 L Finger42
|
||||
400074: Bip001 L Finger22
|
||||
400076: Bip001 L Finger02
|
||||
400080: Bip001 L Finger1
|
||||
400082: Bip001 L Finger11
|
||||
400084: Bip001 L Finger12
|
||||
400088: Bip001 L Finger2
|
||||
400090: Bip001 L Finger21
|
||||
400092: Bip001 L Finger0
|
||||
400094: Bip001 L Finger01
|
||||
400096: Bip001 L Forearm
|
||||
400098: Bip001 L UpperArm
|
||||
400100: Bip001 L Clavicle
|
||||
400102: construction_worker
|
||||
400104: Bip001 R Toe0
|
||||
400106: Bip001 R Foot
|
||||
400108: Bip001 R Calf
|
||||
400110: Bip001 R Thigh
|
||||
400112: Bip001 L Toe0
|
||||
400114: Bip001 L Foot
|
||||
400116: Bip001 L Calf
|
||||
400118: Bip001 L Thigh
|
||||
400120: helmet_bone
|
||||
400124: Bip001 Head
|
||||
400126: wrench
|
||||
400128: Bip001 R Hand
|
||||
400130: Bip001 L Hand
|
||||
400132: Bip001 Neck
|
||||
400134: Bip001 Spine1
|
||||
400136: Bip001 Spine
|
||||
400138: Bip001 Pelvis
|
||||
400140: Bip001
|
||||
2300000: wrench
|
||||
3300000: wrench
|
||||
4300000: construction_worker
|
||||
4300002: wrench
|
||||
7400012: idle
|
||||
7400014: run
|
||||
7400016: walk
|
||||
7400018: jump_pose
|
||||
11100000: //RootNode
|
||||
13700000: Bip001 Pelvis
|
||||
materials:
|
||||
importMaterials: 1
|
||||
materialName: 3
|
||||
materialSearch: 1
|
||||
animations:
|
||||
legacyGenerateAnimations: 3
|
||||
bakeSimulation: 0
|
||||
optimizeGameObjects: 0
|
||||
motionNodeName:
|
||||
animationCompression: 0
|
||||
animationRotationError: .5
|
||||
animationPositionError: .5
|
||||
animationScaleError: .5
|
||||
animationWrapMode: 0
|
||||
extraExposedTransformPaths: []
|
||||
clipAnimations:
|
||||
- serializedVersion: 16
|
||||
name: idle
|
||||
takeName:
|
||||
firstFrame: 2
|
||||
lastFrame: 62
|
||||
wrapMode: 2
|
||||
orientationOffsetY: 0
|
||||
level: 0
|
||||
cycleOffset: 0
|
||||
loop: 0
|
||||
loopTime: 0
|
||||
loopBlend: 0
|
||||
loopBlendOrientation: 0
|
||||
loopBlendPositionY: 0
|
||||
loopBlendPositionXZ: 0
|
||||
keepOriginalOrientation: 0
|
||||
keepOriginalPositionY: 1
|
||||
keepOriginalPositionXZ: 0
|
||||
heightFromFeet: 0
|
||||
mirror: 0
|
||||
bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
|
||||
curves: []
|
||||
events: []
|
||||
transformMask: []
|
||||
maskType: 0
|
||||
maskSource: {instanceID: 0}
|
||||
- serializedVersion: 16
|
||||
name: run
|
||||
takeName:
|
||||
firstFrame: 65
|
||||
lastFrame: 81
|
||||
wrapMode: 2
|
||||
orientationOffsetY: 0
|
||||
level: 0
|
||||
cycleOffset: 0
|
||||
loop: 0
|
||||
loopTime: 0
|
||||
loopBlend: 0
|
||||
loopBlendOrientation: 0
|
||||
loopBlendPositionY: 0
|
||||
loopBlendPositionXZ: 0
|
||||
keepOriginalOrientation: 0
|
||||
keepOriginalPositionY: 1
|
||||
keepOriginalPositionXZ: 0
|
||||
heightFromFeet: 0
|
||||
mirror: 0
|
||||
bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
|
||||
curves: []
|
||||
events: []
|
||||
transformMask: []
|
||||
maskType: 0
|
||||
maskSource: {instanceID: 0}
|
||||
- serializedVersion: 16
|
||||
name: walk
|
||||
takeName:
|
||||
firstFrame: 84
|
||||
lastFrame: 116
|
||||
wrapMode: 2
|
||||
orientationOffsetY: 0
|
||||
level: 0
|
||||
cycleOffset: 0
|
||||
loop: 0
|
||||
loopTime: 0
|
||||
loopBlend: 0
|
||||
loopBlendOrientation: 0
|
||||
loopBlendPositionY: 0
|
||||
loopBlendPositionXZ: 0
|
||||
keepOriginalOrientation: 0
|
||||
keepOriginalPositionY: 1
|
||||
keepOriginalPositionXZ: 0
|
||||
heightFromFeet: 0
|
||||
mirror: 0
|
||||
bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
|
||||
curves: []
|
||||
events: []
|
||||
transformMask: []
|
||||
maskType: 0
|
||||
maskSource: {instanceID: 0}
|
||||
- serializedVersion: 16
|
||||
name: jump_pose
|
||||
takeName:
|
||||
firstFrame: 118
|
||||
lastFrame: 123
|
||||
wrapMode: 0
|
||||
orientationOffsetY: 0
|
||||
level: 0
|
||||
cycleOffset: 0
|
||||
loop: 0
|
||||
loopTime: 0
|
||||
loopBlend: 0
|
||||
loopBlendOrientation: 0
|
||||
loopBlendPositionY: 0
|
||||
loopBlendPositionXZ: 0
|
||||
keepOriginalOrientation: 0
|
||||
keepOriginalPositionY: 1
|
||||
keepOriginalPositionXZ: 0
|
||||
heightFromFeet: 0
|
||||
mirror: 0
|
||||
bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
|
||||
curves: []
|
||||
events: []
|
||||
transformMask: []
|
||||
maskType: 0
|
||||
maskSource: {instanceID: 0}
|
||||
isReadable: 1
|
||||
meshes:
|
||||
lODScreenPercentages: []
|
||||
globalScale: .00999999978
|
||||
meshCompression: 0
|
||||
addColliders: 0
|
||||
importBlendShapes: 1
|
||||
swapUVChannels: 0
|
||||
generateSecondaryUV: 0
|
||||
useFileUnits: 1
|
||||
optimizeMeshForGPU: 1
|
||||
weldVertices: 1
|
||||
secondaryUVAngleDistortion: 8
|
||||
secondaryUVAreaDistortion: 15.000001
|
||||
secondaryUVHardAngle: 88
|
||||
secondaryUVPackMargin: 4
|
||||
tangentSpace:
|
||||
normalSmoothAngle: 60
|
||||
splitTangentsAcrossUV: 1
|
||||
normalImportMode: 0
|
||||
tangentImportMode: 1
|
||||
importAnimation: 1
|
||||
copyAvatar: 0
|
||||
humanDescription:
|
||||
human: []
|
||||
skeleton: []
|
||||
armTwist: .5
|
||||
foreArmTwist: .5
|
||||
upperLegTwist: .5
|
||||
legTwist: .5
|
||||
armStretch: .0500000007
|
||||
legStretch: .0500000007
|
||||
feetSpacing: 0
|
||||
rootMotionBoneName:
|
||||
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||
animationType: 1
|
||||
additionalBone: 0
|
||||
userData:
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e53c8c3dcc4ff59438bc9e86cb45c3f6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ca49380a71a2bb64c830d06bd421b9d1
|
||||
NativeFormatImporter:
|
||||
userData:
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b365e6042890d4b1987423ed6bb8a08c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
Binary file not shown.
After Width: | Height: | Size: 678 KiB |
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 97b050d43ac7c4d2b9f6cbb587650761
|
||||
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: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: -1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
Binary file not shown.
After Width: | Height: | Size: 1.2 MiB |
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 531c14f8d5cdc4e5baa83ee6e16f783a
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 1
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 1
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: 1
|
||||
aniso: -1
|
||||
mipBias: -1
|
||||
wrapMode: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: 1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f781c091d1c8647c380d5230adfaee54
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
@ -0,0 +1,587 @@
|
||||
#pragma strict
|
||||
#pragma implicit
|
||||
#pragma downcast
|
||||
|
||||
// Does this script currently respond to input?
|
||||
var canControl : boolean = true;
|
||||
|
||||
var useFixedUpdate : boolean = true;
|
||||
|
||||
// For the next variables, @System.NonSerialized tells Unity to not serialize the variable or show it in the inspector view.
|
||||
// Very handy for organization!
|
||||
|
||||
// The current global direction we want the character to move in.
|
||||
@System.NonSerialized
|
||||
var inputMoveDirection : Vector3 = Vector3.zero;
|
||||
|
||||
// Is the jump button held down? We use this interface instead of checking
|
||||
// for the jump button directly so this script can also be used by AIs.
|
||||
@System.NonSerialized
|
||||
var inputJump : boolean = false;
|
||||
|
||||
class CharacterMotorMovement {
|
||||
// The maximum horizontal speed when moving
|
||||
var maxForwardSpeed : float = 10.0;
|
||||
var maxSidewaysSpeed : float = 10.0;
|
||||
var maxBackwardsSpeed : float = 10.0;
|
||||
|
||||
// Curve for multiplying speed based on slope (negative = downwards)
|
||||
var slopeSpeedMultiplier : AnimationCurve = AnimationCurve(Keyframe(-90, 1), Keyframe(0, 1), Keyframe(90, 0));
|
||||
|
||||
// How fast does the character change speeds? Higher is faster.
|
||||
var maxGroundAcceleration : float = 30.0;
|
||||
var maxAirAcceleration : float = 20.0;
|
||||
|
||||
// The gravity for the character
|
||||
var gravity : float = 10.0;
|
||||
var maxFallSpeed : float = 20.0;
|
||||
|
||||
// For the next variables, @System.NonSerialized tells Unity to not serialize the variable or show it in the inspector view.
|
||||
// Very handy for organization!
|
||||
|
||||
// The last collision flags returned from controller.Move
|
||||
@System.NonSerialized
|
||||
var collisionFlags : CollisionFlags;
|
||||
|
||||
// We will keep track of the character's current velocity,
|
||||
@System.NonSerialized
|
||||
var velocity : Vector3;
|
||||
|
||||
// This keeps track of our current velocity while we're not grounded
|
||||
@System.NonSerialized
|
||||
var frameVelocity : Vector3 = Vector3.zero;
|
||||
|
||||
@System.NonSerialized
|
||||
var hitPoint : Vector3 = Vector3.zero;
|
||||
|
||||
@System.NonSerialized
|
||||
var lastHitPoint : Vector3 = Vector3(Mathf.Infinity, 0, 0);
|
||||
}
|
||||
|
||||
var movement : CharacterMotorMovement = CharacterMotorMovement();
|
||||
|
||||
enum MovementTransferOnJump {
|
||||
None, // The jump is not affected by velocity of floor at all.
|
||||
InitTransfer, // Jump gets its initial velocity from the floor, then gradualy comes to a stop.
|
||||
PermaTransfer, // Jump gets its initial velocity from the floor, and keeps that velocity until landing.
|
||||
PermaLocked // Jump is relative to the movement of the last touched floor and will move together with that floor.
|
||||
}
|
||||
|
||||
// We will contain all the jumping related variables in one helper class for clarity.
|
||||
class CharacterMotorJumping {
|
||||
// Can the character jump?
|
||||
var enabled : boolean = true;
|
||||
|
||||
// How high do we jump when pressing jump and letting go immediately
|
||||
var baseHeight : float = 1.0;
|
||||
|
||||
// We add extraHeight units (meters) on top when holding the button down longer while jumping
|
||||
var extraHeight : float = 4.1;
|
||||
|
||||
// How much does the character jump out perpendicular to the surface on walkable surfaces?
|
||||
// 0 means a fully vertical jump and 1 means fully perpendicular.
|
||||
var perpAmount : float = 0.0;
|
||||
|
||||
// How much does the character jump out perpendicular to the surface on too steep surfaces?
|
||||
// 0 means a fully vertical jump and 1 means fully perpendicular.
|
||||
var steepPerpAmount : float = 0.5;
|
||||
|
||||
// For the next variables, @System.NonSerialized tells Unity to not serialize the variable or show it in the inspector view.
|
||||
// Very handy for organization!
|
||||
|
||||
// Are we jumping? (Initiated with jump button and not grounded yet)
|
||||
// To see if we are just in the air (initiated by jumping OR falling) see the grounded variable.
|
||||
@System.NonSerialized
|
||||
var jumping : boolean = false;
|
||||
|
||||
@System.NonSerialized
|
||||
var holdingJumpButton : boolean = false;
|
||||
|
||||
// the time we jumped at (Used to determine for how long to apply extra jump power after jumping.)
|
||||
@System.NonSerialized
|
||||
var lastStartTime : float = 0.0;
|
||||
|
||||
@System.NonSerialized
|
||||
var lastButtonDownTime : float = -100;
|
||||
|
||||
@System.NonSerialized
|
||||
var jumpDir : Vector3 = Vector3.up;
|
||||
}
|
||||
|
||||
var jumping : CharacterMotorJumping = CharacterMotorJumping();
|
||||
|
||||
class CharacterMotorMovingPlatform {
|
||||
var enabled : boolean = true;
|
||||
|
||||
var movementTransfer : MovementTransferOnJump = MovementTransferOnJump.PermaTransfer;
|
||||
|
||||
@System.NonSerialized
|
||||
var hitPlatform : Transform;
|
||||
|
||||
@System.NonSerialized
|
||||
var activePlatform : Transform;
|
||||
|
||||
@System.NonSerialized
|
||||
var activeLocalPoint : Vector3;
|
||||
|
||||
@System.NonSerialized
|
||||
var activeGlobalPoint : Vector3;
|
||||
|
||||
@System.NonSerialized
|
||||
var activeLocalRotation : Quaternion;
|
||||
|
||||
@System.NonSerialized
|
||||
var activeGlobalRotation : Quaternion;
|
||||
|
||||
@System.NonSerialized
|
||||
var lastMatrix : Matrix4x4;
|
||||
|
||||
@System.NonSerialized
|
||||
var platformVelocity : Vector3;
|
||||
|
||||
@System.NonSerialized
|
||||
var newPlatform : boolean;
|
||||
}
|
||||
|
||||
var movingPlatform : CharacterMotorMovingPlatform = CharacterMotorMovingPlatform();
|
||||
|
||||
class CharacterMotorSliding {
|
||||
// Does the character slide on too steep surfaces?
|
||||
var enabled : boolean = true;
|
||||
|
||||
// How fast does the character slide on steep surfaces?
|
||||
var slidingSpeed : float = 15;
|
||||
|
||||
// How much can the player control the sliding direction?
|
||||
// If the value is 0.5 the player can slide sideways with half the speed of the downwards sliding speed.
|
||||
var sidewaysControl : float = 1.0;
|
||||
|
||||
// How much can the player influence the sliding speed?
|
||||
// If the value is 0.5 the player can speed the sliding up to 150% or slow it down to 50%.
|
||||
var speedControl : float = 0.4;
|
||||
}
|
||||
|
||||
var sliding : CharacterMotorSliding = CharacterMotorSliding();
|
||||
|
||||
@System.NonSerialized
|
||||
var grounded : boolean = true;
|
||||
|
||||
@System.NonSerialized
|
||||
var groundNormal : Vector3 = Vector3.zero;
|
||||
|
||||
private var lastGroundNormal : Vector3 = Vector3.zero;
|
||||
|
||||
private var tr : Transform;
|
||||
|
||||
private var controller : CharacterController;
|
||||
|
||||
function Awake () {
|
||||
controller = GetComponent (CharacterController);
|
||||
tr = transform;
|
||||
}
|
||||
|
||||
private function UpdateFunction () {
|
||||
// We copy the actual velocity into a temporary variable that we can manipulate.
|
||||
var velocity : Vector3 = movement.velocity;
|
||||
|
||||
// Update velocity based on input
|
||||
velocity = ApplyInputVelocityChange(velocity);
|
||||
|
||||
// Apply gravity and jumping force
|
||||
velocity = ApplyGravityAndJumping (velocity);
|
||||
|
||||
// Moving platform support
|
||||
var moveDistance : Vector3 = Vector3.zero;
|
||||
if (MoveWithPlatform()) {
|
||||
var newGlobalPoint : Vector3 = movingPlatform.activePlatform.TransformPoint(movingPlatform.activeLocalPoint);
|
||||
moveDistance = (newGlobalPoint - movingPlatform.activeGlobalPoint);
|
||||
if (moveDistance != Vector3.zero)
|
||||
controller.Move(moveDistance);
|
||||
|
||||
// Support moving platform rotation as well:
|
||||
var newGlobalRotation : Quaternion = movingPlatform.activePlatform.rotation * movingPlatform.activeLocalRotation;
|
||||
var rotationDiff : Quaternion = newGlobalRotation * Quaternion.Inverse(movingPlatform.activeGlobalRotation);
|
||||
|
||||
var yRotation = rotationDiff.eulerAngles.y;
|
||||
if (yRotation != 0) {
|
||||
// Prevent rotation of the local up vector
|
||||
tr.Rotate(0, yRotation, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Save lastPosition for velocity calculation.
|
||||
var lastPosition : Vector3 = tr.position;
|
||||
|
||||
// We always want the movement to be framerate independent. Multiplying by Time.deltaTime does this.
|
||||
var currentMovementOffset : Vector3 = velocity * Time.deltaTime;
|
||||
|
||||
// Find out how much we need to push towards the ground to avoid loosing grouning
|
||||
// when walking down a step or over a sharp change in slope.
|
||||
var pushDownOffset : float = Mathf.Max(controller.stepOffset, Vector3(currentMovementOffset.x, 0, currentMovementOffset.z).magnitude);
|
||||
if (grounded)
|
||||
currentMovementOffset -= pushDownOffset * Vector3.up;
|
||||
|
||||
// Reset variables that will be set by collision function
|
||||
movingPlatform.hitPlatform = null;
|
||||
groundNormal = Vector3.zero;
|
||||
|
||||
// Move our character!
|
||||
movement.collisionFlags = controller.Move (currentMovementOffset);
|
||||
|
||||
movement.lastHitPoint = movement.hitPoint;
|
||||
lastGroundNormal = groundNormal;
|
||||
|
||||
if (movingPlatform.enabled && movingPlatform.activePlatform != movingPlatform.hitPlatform) {
|
||||
if (movingPlatform.hitPlatform != null) {
|
||||
movingPlatform.activePlatform = movingPlatform.hitPlatform;
|
||||
movingPlatform.lastMatrix = movingPlatform.hitPlatform.localToWorldMatrix;
|
||||
movingPlatform.newPlatform = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate the velocity based on the current and previous position.
|
||||
// This means our velocity will only be the amount the character actually moved as a result of collisions.
|
||||
var oldHVelocity : Vector3 = new Vector3(velocity.x, 0, velocity.z);
|
||||
movement.velocity = (tr.position - lastPosition) / Time.deltaTime;
|
||||
var newHVelocity : Vector3 = new Vector3(movement.velocity.x, 0, movement.velocity.z);
|
||||
|
||||
// The CharacterController can be moved in unwanted directions when colliding with things.
|
||||
// We want to prevent this from influencing the recorded velocity.
|
||||
if (oldHVelocity == Vector3.zero) {
|
||||
movement.velocity = new Vector3(0, movement.velocity.y, 0);
|
||||
}
|
||||
else {
|
||||
var projectedNewVelocity : float = Vector3.Dot(newHVelocity, oldHVelocity) / oldHVelocity.sqrMagnitude;
|
||||
movement.velocity = oldHVelocity * Mathf.Clamp01(projectedNewVelocity) + movement.velocity.y * Vector3.up;
|
||||
}
|
||||
|
||||
if (movement.velocity.y < velocity.y - 0.001) {
|
||||
if (movement.velocity.y < 0) {
|
||||
// Something is forcing the CharacterController down faster than it should.
|
||||
// Ignore this
|
||||
movement.velocity.y = velocity.y;
|
||||
}
|
||||
else {
|
||||
// The upwards movement of the CharacterController has been blocked.
|
||||
// This is treated like a ceiling collision - stop further jumping here.
|
||||
jumping.holdingJumpButton = false;
|
||||
}
|
||||
}
|
||||
|
||||
// We were grounded but just loosed grounding
|
||||
if (grounded && !IsGroundedTest()) {
|
||||
grounded = false;
|
||||
|
||||
// Apply inertia from platform
|
||||
if (movingPlatform.enabled &&
|
||||
(movingPlatform.movementTransfer == MovementTransferOnJump.InitTransfer ||
|
||||
movingPlatform.movementTransfer == MovementTransferOnJump.PermaTransfer)
|
||||
) {
|
||||
movement.frameVelocity = movingPlatform.platformVelocity;
|
||||
movement.velocity += movingPlatform.platformVelocity;
|
||||
}
|
||||
|
||||
SendMessage("OnFall", SendMessageOptions.DontRequireReceiver);
|
||||
// We pushed the character down to ensure it would stay on the ground if there was any.
|
||||
// But there wasn't so now we cancel the downwards offset to make the fall smoother.
|
||||
tr.position += pushDownOffset * Vector3.up;
|
||||
}
|
||||
// We were not grounded but just landed on something
|
||||
else if (!grounded && IsGroundedTest()) {
|
||||
grounded = true;
|
||||
jumping.jumping = false;
|
||||
SubtractNewPlatformVelocity();
|
||||
|
||||
SendMessage("OnLand", SendMessageOptions.DontRequireReceiver);
|
||||
}
|
||||
|
||||
// Moving platforms support
|
||||
if (MoveWithPlatform()) {
|
||||
// Use the center of the lower half sphere of the capsule as reference point.
|
||||
// This works best when the character is standing on moving tilting platforms.
|
||||
movingPlatform.activeGlobalPoint = tr.position + Vector3.up * (controller.center.y - controller.height*0.5 + controller.radius);
|
||||
movingPlatform.activeLocalPoint = movingPlatform.activePlatform.InverseTransformPoint(movingPlatform.activeGlobalPoint);
|
||||
|
||||
// Support moving platform rotation as well:
|
||||
movingPlatform.activeGlobalRotation = tr.rotation;
|
||||
movingPlatform.activeLocalRotation = Quaternion.Inverse(movingPlatform.activePlatform.rotation) * movingPlatform.activeGlobalRotation;
|
||||
}
|
||||
}
|
||||
|
||||
function FixedUpdate () {
|
||||
if (movingPlatform.enabled) {
|
||||
if (movingPlatform.activePlatform != null) {
|
||||
if (!movingPlatform.newPlatform) {
|
||||
var lastVelocity : Vector3 = movingPlatform.platformVelocity;
|
||||
|
||||
movingPlatform.platformVelocity = (
|
||||
movingPlatform.activePlatform.localToWorldMatrix.MultiplyPoint3x4(movingPlatform.activeLocalPoint)
|
||||
- movingPlatform.lastMatrix.MultiplyPoint3x4(movingPlatform.activeLocalPoint)
|
||||
) / Time.deltaTime;
|
||||
}
|
||||
movingPlatform.lastMatrix = movingPlatform.activePlatform.localToWorldMatrix;
|
||||
movingPlatform.newPlatform = false;
|
||||
}
|
||||
else {
|
||||
movingPlatform.platformVelocity = Vector3.zero;
|
||||
}
|
||||
}
|
||||
|
||||
if (useFixedUpdate)
|
||||
UpdateFunction();
|
||||
}
|
||||
|
||||
function Update () {
|
||||
if (!useFixedUpdate)
|
||||
UpdateFunction();
|
||||
}
|
||||
|
||||
private function ApplyInputVelocityChange (velocity : Vector3) {
|
||||
if (!canControl)
|
||||
inputMoveDirection = Vector3.zero;
|
||||
|
||||
// Find desired velocity
|
||||
var desiredVelocity : Vector3;
|
||||
if (grounded && TooSteep()) {
|
||||
// The direction we're sliding in
|
||||
desiredVelocity = Vector3(groundNormal.x, 0, groundNormal.z).normalized;
|
||||
// Find the input movement direction projected onto the sliding direction
|
||||
var projectedMoveDir = Vector3.Project(inputMoveDirection, desiredVelocity);
|
||||
// Add the sliding direction, the spped control, and the sideways control vectors
|
||||
desiredVelocity = desiredVelocity + projectedMoveDir * sliding.speedControl + (inputMoveDirection - projectedMoveDir) * sliding.sidewaysControl;
|
||||
// Multiply with the sliding speed
|
||||
desiredVelocity *= sliding.slidingSpeed;
|
||||
}
|
||||
else
|
||||
desiredVelocity = GetDesiredHorizontalVelocity();
|
||||
|
||||
if (movingPlatform.enabled && movingPlatform.movementTransfer == MovementTransferOnJump.PermaTransfer) {
|
||||
desiredVelocity += movement.frameVelocity;
|
||||
desiredVelocity.y = 0;
|
||||
}
|
||||
|
||||
if (grounded)
|
||||
desiredVelocity = AdjustGroundVelocityToNormal(desiredVelocity, groundNormal);
|
||||
else
|
||||
velocity.y = 0;
|
||||
|
||||
// Enforce max velocity change
|
||||
var maxVelocityChange : float = GetMaxAcceleration(grounded) * Time.deltaTime;
|
||||
var velocityChangeVector : Vector3 = (desiredVelocity - velocity);
|
||||
if (velocityChangeVector.sqrMagnitude > maxVelocityChange * maxVelocityChange) {
|
||||
velocityChangeVector = velocityChangeVector.normalized * maxVelocityChange;
|
||||
}
|
||||
// If we're in the air and don't have control, don't apply any velocity change at all.
|
||||
// If we're on the ground and don't have control we do apply it - it will correspond to friction.
|
||||
if (grounded || canControl)
|
||||
velocity += velocityChangeVector;
|
||||
|
||||
if (grounded) {
|
||||
// When going uphill, the CharacterController will automatically move up by the needed amount.
|
||||
// Not moving it upwards manually prevent risk of lifting off from the ground.
|
||||
// When going downhill, DO move down manually, as gravity is not enough on steep hills.
|
||||
velocity.y = Mathf.Min(velocity.y, 0);
|
||||
}
|
||||
|
||||
return velocity;
|
||||
}
|
||||
|
||||
private function ApplyGravityAndJumping (velocity : Vector3) {
|
||||
|
||||
if (!inputJump || !canControl) {
|
||||
jumping.holdingJumpButton = false;
|
||||
jumping.lastButtonDownTime = -100;
|
||||
}
|
||||
|
||||
if (inputJump && jumping.lastButtonDownTime < 0 && canControl)
|
||||
jumping.lastButtonDownTime = Time.time;
|
||||
|
||||
if (grounded)
|
||||
velocity.y = Mathf.Min(0, velocity.y) - movement.gravity * Time.deltaTime;
|
||||
else {
|
||||
velocity.y = movement.velocity.y - movement.gravity * Time.deltaTime;
|
||||
|
||||
// When jumping up we don't apply gravity for some time when the user is holding the jump button.
|
||||
// This gives more control over jump height by pressing the button longer.
|
||||
if (jumping.jumping && jumping.holdingJumpButton) {
|
||||
// Calculate the duration that the extra jump force should have effect.
|
||||
// If we're still less than that duration after the jumping time, apply the force.
|
||||
if (Time.time < jumping.lastStartTime + jumping.extraHeight / CalculateJumpVerticalSpeed(jumping.baseHeight)) {
|
||||
// Negate the gravity we just applied, except we push in jumpDir rather than jump upwards.
|
||||
velocity += jumping.jumpDir * movement.gravity * Time.deltaTime;
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure we don't fall any faster than maxFallSpeed. This gives our character a terminal velocity.
|
||||
velocity.y = Mathf.Max (velocity.y, -movement.maxFallSpeed);
|
||||
}
|
||||
|
||||
if (grounded) {
|
||||
// Jump only if the jump button was pressed down in the last 0.2 seconds.
|
||||
// We use this check instead of checking if it's pressed down right now
|
||||
// because players will often try to jump in the exact moment when hitting the ground after a jump
|
||||
// and if they hit the button a fraction of a second too soon and no new jump happens as a consequence,
|
||||
// it's confusing and it feels like the game is buggy.
|
||||
if (jumping.enabled && canControl && (Time.time - jumping.lastButtonDownTime < 0.2)) {
|
||||
grounded = false;
|
||||
jumping.jumping = true;
|
||||
jumping.lastStartTime = Time.time;
|
||||
jumping.lastButtonDownTime = -100;
|
||||
jumping.holdingJumpButton = true;
|
||||
|
||||
// Calculate the jumping direction
|
||||
if (TooSteep())
|
||||
jumping.jumpDir = Vector3.Slerp(Vector3.up, groundNormal, jumping.steepPerpAmount);
|
||||
else
|
||||
jumping.jumpDir = Vector3.Slerp(Vector3.up, groundNormal, jumping.perpAmount);
|
||||
|
||||
// Apply the jumping force to the velocity. Cancel any vertical velocity first.
|
||||
velocity.y = 0;
|
||||
velocity += jumping.jumpDir * CalculateJumpVerticalSpeed (jumping.baseHeight);
|
||||
|
||||
// Apply inertia from platform
|
||||
if (movingPlatform.enabled &&
|
||||
(movingPlatform.movementTransfer == MovementTransferOnJump.InitTransfer ||
|
||||
movingPlatform.movementTransfer == MovementTransferOnJump.PermaTransfer)
|
||||
) {
|
||||
movement.frameVelocity = movingPlatform.platformVelocity;
|
||||
velocity += movingPlatform.platformVelocity;
|
||||
}
|
||||
|
||||
SendMessage("OnJump", SendMessageOptions.DontRequireReceiver);
|
||||
}
|
||||
else {
|
||||
jumping.holdingJumpButton = false;
|
||||
}
|
||||
}
|
||||
|
||||
return velocity;
|
||||
}
|
||||
|
||||
function OnControllerColliderHit (hit : ControllerColliderHit) {
|
||||
if (hit.normal.y > 0 && hit.normal.y > groundNormal.y && hit.moveDirection.y < 0) {
|
||||
if ((hit.point - movement.lastHitPoint).sqrMagnitude > 0.001 || lastGroundNormal == Vector3.zero)
|
||||
groundNormal = hit.normal;
|
||||
else
|
||||
groundNormal = lastGroundNormal;
|
||||
|
||||
movingPlatform.hitPlatform = hit.collider.transform;
|
||||
movement.hitPoint = hit.point;
|
||||
movement.frameVelocity = Vector3.zero;
|
||||
}
|
||||
}
|
||||
|
||||
private function SubtractNewPlatformVelocity () {
|
||||
// When landing, subtract the velocity of the new ground from the character's velocity
|
||||
// since movement in ground is relative to the movement of the ground.
|
||||
if (movingPlatform.enabled &&
|
||||
(movingPlatform.movementTransfer == MovementTransferOnJump.InitTransfer ||
|
||||
movingPlatform.movementTransfer == MovementTransferOnJump.PermaTransfer)
|
||||
) {
|
||||
// If we landed on a new platform, we have to wait for two FixedUpdates
|
||||
// before we know the velocity of the platform under the character
|
||||
if (movingPlatform.newPlatform) {
|
||||
var platform : Transform = movingPlatform.activePlatform;
|
||||
yield WaitForFixedUpdate();
|
||||
yield WaitForFixedUpdate();
|
||||
if (grounded && platform == movingPlatform.activePlatform)
|
||||
yield 1;
|
||||
}
|
||||
movement.velocity -= movingPlatform.platformVelocity;
|
||||
}
|
||||
}
|
||||
|
||||
private function MoveWithPlatform () : boolean {
|
||||
return (
|
||||
movingPlatform.enabled
|
||||
&& (grounded || movingPlatform.movementTransfer == MovementTransferOnJump.PermaLocked)
|
||||
&& movingPlatform.activePlatform != null
|
||||
);
|
||||
}
|
||||
|
||||
private function GetDesiredHorizontalVelocity () {
|
||||
// Find desired velocity
|
||||
var desiredLocalDirection : Vector3 = tr.InverseTransformDirection(inputMoveDirection);
|
||||
var maxSpeed : float = MaxSpeedInDirection(desiredLocalDirection);
|
||||
if (grounded) {
|
||||
// Modify max speed on slopes based on slope speed multiplier curve
|
||||
var movementSlopeAngle = Mathf.Asin(movement.velocity.normalized.y) * Mathf.Rad2Deg;
|
||||
maxSpeed *= movement.slopeSpeedMultiplier.Evaluate(movementSlopeAngle);
|
||||
}
|
||||
return tr.TransformDirection(desiredLocalDirection * maxSpeed);
|
||||
}
|
||||
|
||||
private function AdjustGroundVelocityToNormal (hVelocity : Vector3, groundNormal : Vector3) : Vector3 {
|
||||
var sideways : Vector3 = Vector3.Cross(Vector3.up, hVelocity);
|
||||
return Vector3.Cross(sideways, groundNormal).normalized * hVelocity.magnitude;
|
||||
}
|
||||
|
||||
private function IsGroundedTest () {
|
||||
return (groundNormal.y > 0.01);
|
||||
}
|
||||
|
||||
function GetMaxAcceleration (grounded : boolean) : float {
|
||||
// Maximum acceleration on ground and in air
|
||||
if (grounded)
|
||||
return movement.maxGroundAcceleration;
|
||||
else
|
||||
return movement.maxAirAcceleration;
|
||||
}
|
||||
|
||||
function CalculateJumpVerticalSpeed (targetJumpHeight : float) {
|
||||
// From the jump height and gravity we deduce the upwards speed
|
||||
// for the character to reach at the apex.
|
||||
return Mathf.Sqrt (2 * targetJumpHeight * movement.gravity);
|
||||
}
|
||||
|
||||
function IsJumping () {
|
||||
return jumping.jumping;
|
||||
}
|
||||
|
||||
function IsSliding () {
|
||||
return (grounded && sliding.enabled && TooSteep());
|
||||
}
|
||||
|
||||
function IsTouchingCeiling () {
|
||||
return (movement.collisionFlags & CollisionFlags.CollidedAbove) != 0;
|
||||
}
|
||||
|
||||
function IsGrounded () {
|
||||
return grounded;
|
||||
}
|
||||
|
||||
function TooSteep () {
|
||||
return (groundNormal.y <= Mathf.Cos(controller.slopeLimit * Mathf.Deg2Rad));
|
||||
}
|
||||
|
||||
function GetDirection () {
|
||||
return inputMoveDirection;
|
||||
}
|
||||
|
||||
function SetControllable (controllable : boolean) {
|
||||
canControl = controllable;
|
||||
}
|
||||
|
||||
// Project a direction onto elliptical quater segments based on forward, sideways, and backwards speed.
|
||||
// The function returns the length of the resulting vector.
|
||||
function MaxSpeedInDirection (desiredMovementDirection : Vector3) : float {
|
||||
if (desiredMovementDirection == Vector3.zero)
|
||||
return 0;
|
||||
else {
|
||||
var zAxisEllipseMultiplier : float = (desiredMovementDirection.z > 0 ? movement.maxForwardSpeed : movement.maxBackwardsSpeed) / movement.maxSidewaysSpeed;
|
||||
var temp : Vector3 = new Vector3(desiredMovementDirection.x, 0, desiredMovementDirection.z / zAxisEllipseMultiplier).normalized;
|
||||
var length : float = new Vector3(temp.x, 0, temp.z * zAxisEllipseMultiplier).magnitude * movement.maxSidewaysSpeed;
|
||||
return length;
|
||||
}
|
||||
}
|
||||
|
||||
function SetVelocity (velocity : Vector3) {
|
||||
grounded = false;
|
||||
movement.velocity = velocity;
|
||||
movement.frameVelocity = Vector3.zero;
|
||||
SendMessage("OnExternalVelocity");
|
||||
}
|
||||
|
||||
// Require a character controller to be attached to the same game object
|
||||
@script RequireComponent (CharacterController)
|
||||
@script AddComponentMenu ("Character/Character Motor")
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0ab79d7f243824f5d9826bd83522c8df
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
@ -0,0 +1,37 @@
|
||||
private var motor : CharacterMotor;
|
||||
|
||||
// Use this for initialization
|
||||
function Awake () {
|
||||
motor = GetComponent(CharacterMotor);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
function Update () {
|
||||
// Get the input vector from keyboard or analog stick
|
||||
var directionVector = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
|
||||
|
||||
if (directionVector != Vector3.zero) {
|
||||
// Get the length of the directon vector and then normalize it
|
||||
// Dividing by the length is cheaper than normalizing when we already have the length anyway
|
||||
var directionLength = directionVector.magnitude;
|
||||
directionVector = directionVector / directionLength;
|
||||
|
||||
// Make sure the length is no bigger than 1
|
||||
directionLength = Mathf.Min(1, directionLength);
|
||||
|
||||
// Make the input vector more sensitive towards the extremes and less sensitive in the middle
|
||||
// This makes it easier to control slow speeds when using analog sticks
|
||||
directionLength = directionLength * directionLength;
|
||||
|
||||
// Multiply the normalized direction vector by the modified length
|
||||
directionVector = directionVector * directionLength;
|
||||
}
|
||||
|
||||
// Apply the direction to the CharacterMotor
|
||||
motor.inputMoveDirection = transform.rotation * directionVector;
|
||||
motor.inputJump = Input.GetButton("Jump");
|
||||
}
|
||||
|
||||
// Require a character controller to be attached to the same game object
|
||||
@script RequireComponent (CharacterMotor)
|
||||
@script AddComponentMenu ("Character/FPS Input Controller")
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 60bca8f58a0b8478e946e6e86658cb29
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
@ -0,0 +1,63 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
/// MouseLook rotates the transform based on the mouse delta.
|
||||
/// Minimum and Maximum values can be used to constrain the possible rotation
|
||||
|
||||
/// To make an FPS style character:
|
||||
/// - Create a capsule.
|
||||
/// - Add the MouseLook script to the capsule.
|
||||
/// -> Set the mouse look to use LookX. (You want to only turn character but not tilt it)
|
||||
/// - Add FPSInputController script to the capsule
|
||||
/// -> A CharacterMotor and a CharacterController component will be automatically added.
|
||||
|
||||
/// - Create a camera. Make the camera a child of the capsule. Reset it's transform.
|
||||
/// - Add a MouseLook script to the camera.
|
||||
/// -> Set the mouse look to use LookY. (You want the camera to tilt up and down like a head. The character already turns.)
|
||||
[AddComponentMenu("Camera-Control/Mouse Look")]
|
||||
public class MouseLook : MonoBehaviour {
|
||||
|
||||
public enum RotationAxes { MouseXAndY = 0, MouseX = 1, MouseY = 2 }
|
||||
public RotationAxes axes = RotationAxes.MouseXAndY;
|
||||
public float sensitivityX = 15F;
|
||||
public float sensitivityY = 15F;
|
||||
|
||||
public float minimumX = -360F;
|
||||
public float maximumX = 360F;
|
||||
|
||||
public float minimumY = -60F;
|
||||
public float maximumY = 60F;
|
||||
|
||||
float rotationY = 0F;
|
||||
|
||||
void Update ()
|
||||
{
|
||||
if (axes == RotationAxes.MouseXAndY)
|
||||
{
|
||||
float rotationX = transform.localEulerAngles.y + Input.GetAxis("Mouse X") * sensitivityX;
|
||||
|
||||
rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
|
||||
rotationY = Mathf.Clamp (rotationY, minimumY, maximumY);
|
||||
|
||||
transform.localEulerAngles = new Vector3(-rotationY, rotationX, 0);
|
||||
}
|
||||
else if (axes == RotationAxes.MouseX)
|
||||
{
|
||||
transform.Rotate(0, Input.GetAxis("Mouse X") * sensitivityX, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
|
||||
rotationY = Mathf.Clamp (rotationY, minimumY, maximumY);
|
||||
|
||||
transform.localEulerAngles = new Vector3(-rotationY, transform.localEulerAngles.y, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void Start ()
|
||||
{
|
||||
// Make the rigid body not change rotation
|
||||
if (GetComponent<Rigidbody>())
|
||||
GetComponent<Rigidbody>().freezeRotation = true;
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 68ec2fe99d1108b9d0006a298d76c639
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
@ -0,0 +1,68 @@
|
||||
// This makes the character turn to face the current movement speed per default.
|
||||
var autoRotate : boolean = true;
|
||||
var maxRotationSpeed : float = 360;
|
||||
|
||||
private var motor : CharacterMotor;
|
||||
|
||||
// Use this for initialization
|
||||
function Awake () {
|
||||
motor = GetComponent(CharacterMotor);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
function Update () {
|
||||
// Get the input vector from keyboard or analog stick
|
||||
var directionVector = new Vector3(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"), 0);
|
||||
|
||||
if (directionVector != Vector3.zero) {
|
||||
// Get the length of the directon vector and then normalize it
|
||||
// Dividing by the length is cheaper than normalizing when we already have the length anyway
|
||||
var directionLength = directionVector.magnitude;
|
||||
directionVector = directionVector / directionLength;
|
||||
|
||||
// Make sure the length is no bigger than 1
|
||||
directionLength = Mathf.Min(1, directionLength);
|
||||
|
||||
// Make the input vector more sensitive towards the extremes and less sensitive in the middle
|
||||
// This makes it easier to control slow speeds when using analog sticks
|
||||
directionLength = directionLength * directionLength;
|
||||
|
||||
// Multiply the normalized direction vector by the modified length
|
||||
directionVector = directionVector * directionLength;
|
||||
}
|
||||
|
||||
// Rotate the input vector into camera space so up is camera's up and right is camera's right
|
||||
directionVector = Camera.main.transform.rotation * directionVector;
|
||||
|
||||
// Rotate input vector to be perpendicular to character's up vector
|
||||
var camToCharacterSpace = Quaternion.FromToRotation(-Camera.main.transform.forward, transform.up);
|
||||
directionVector = (camToCharacterSpace * directionVector);
|
||||
|
||||
// Apply the direction to the CharacterMotor
|
||||
motor.inputMoveDirection = directionVector;
|
||||
motor.inputJump = Input.GetButton("Jump");
|
||||
|
||||
// Set rotation to the move direction
|
||||
if (autoRotate && directionVector.sqrMagnitude > 0.01) {
|
||||
var newForward : Vector3 = ConstantSlerp(
|
||||
transform.forward,
|
||||
directionVector,
|
||||
maxRotationSpeed * Time.deltaTime
|
||||
);
|
||||
newForward = ProjectOntoPlane(newForward, transform.up);
|
||||
transform.rotation = Quaternion.LookRotation(newForward, transform.up);
|
||||
}
|
||||
}
|
||||
|
||||
function ProjectOntoPlane (v : Vector3, normal : Vector3) {
|
||||
return v - Vector3.Project(v, normal);
|
||||
}
|
||||
|
||||
function ConstantSlerp (from : Vector3, to : Vector3, angle : float) {
|
||||
var value : float = Mathf.Min(1, angle / Vector3.Angle(from, to));
|
||||
return Vector3.Slerp(from, to, value);
|
||||
}
|
||||
|
||||
// Require a character controller to be attached to the same game object
|
||||
@script RequireComponent (CharacterMotor)
|
||||
@script AddComponentMenu ("Character/Platform Input Controller")
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: da93ddd6928094e24bb1f3f665f143d3
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
BIN
Game/Assets/Standard Assets/New Material.mat
Normal file
BIN
Game/Assets/Standard Assets/New Material.mat
Normal file
Binary file not shown.
4
Game/Assets/Standard Assets/New Material.mat.meta
Normal file
4
Game/Assets/Standard Assets/New Material.mat.meta
Normal file
@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 459f66c86c775d24b9a261341915b549
|
||||
NativeFormatImporter:
|
||||
userData:
|
5
Game/Assets/Standard Assets/Terrain Assets.meta
Normal file
5
Game/Assets/Standard Assets/Terrain Assets.meta
Normal file
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7e6f84bf81c8d4de280f1133cff7e601
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f2af333648c334319bd43c214449ab50
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2c528fec5d95e4ac28cf46399b887662
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 2
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapMode: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: 0
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d6cdc79ec19714fcd980ca3f6ac01a0a
|
||||
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: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapMode: 0
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: -1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cba4562cece794697b418ce8e7c04b3c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 18214e9d6af6248559d501391856f1c7
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 2
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapMode: 0
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: 0
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bfd675cc0db1d4656b75dc6d6ba91142
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 2
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapMode: 0
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: 0
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c6e0767b1f8c34890ac245217f4b9731
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 2
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 512
|
||||
textureSettings:
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapMode: 0
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: 0
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 440eb36db91ca410f800ff3cfe43572f
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 2
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapMode: 0
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: 0
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ac865f55780124eeabc4a99d6d0b0115
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5710a1f47af2947699139509aae39149
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 527393b10fb66418bbaa072e104f5a30
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e5bdb6135a74b444d8cebd065dbf9d08
|
||||
NativeFormatImporter:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3186f38ca67e7441e8299da2e169f9f9
|
||||
NativeFormatImporter:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,65 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c85abd0a4d974473b97e81d10a3a6bc
|
||||
ModelImporter:
|
||||
serializedVersion: 16
|
||||
fileIDToRecycleName:
|
||||
100000: //RootNode
|
||||
400000: //RootNode
|
||||
2300000: //RootNode
|
||||
3300000: //RootNode
|
||||
4300000: polySurface1
|
||||
11100000: //RootNode
|
||||
materials:
|
||||
importMaterials: 1
|
||||
materialName: 3
|
||||
materialSearch: 1
|
||||
animations:
|
||||
legacyGenerateAnimations: 0
|
||||
bakeSimulation: 0
|
||||
optimizeGameObjects: 0
|
||||
motionNodeName:
|
||||
animationCompression: 1
|
||||
animationRotationError: .5
|
||||
animationPositionError: .5
|
||||
animationScaleError: .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
|
||||
weldVertices: 1
|
||||
secondaryUVAngleDistortion: 8
|
||||
secondaryUVAreaDistortion: 15.000001
|
||||
secondaryUVHardAngle: 88
|
||||
secondaryUVPackMargin: 4
|
||||
tangentSpace:
|
||||
normalSmoothAngle: 60
|
||||
splitTangentsAcrossUV: 0
|
||||
normalImportMode: 0
|
||||
tangentImportMode: 1
|
||||
importAnimation: 1
|
||||
copyAvatar: 0
|
||||
humanDescription:
|
||||
human: []
|
||||
skeleton: []
|
||||
armTwist: .5
|
||||
foreArmTwist: .5
|
||||
upperLegTwist: .5
|
||||
legTwist: .5
|
||||
armStretch: .0500000007
|
||||
legStretch: .0500000007
|
||||
feetSpacing: 0
|
||||
rootMotionBoneName:
|
||||
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||
animationType: 1
|
||||
additionalBone: 1
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f7d5f039a8e7848e889e1546d37dc39e
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 2
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 1
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapMode: 0
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: 0
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 54e03e659ab274dd9b12c0538a9c4983
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 2
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 1024
|
||||
textureSettings:
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapMode: 0
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: 0
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
5
Game/Assets/Standard Assets/Water (Basic).meta
Normal file
5
Game/Assets/Standard Assets/Water (Basic).meta
Normal file
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dc7abfa0435174ded902b073322d67cc
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9485b0c79d11e2e4d0007da98d76c639
|
||||
NativeFormatImporter:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6b436d069d11415d1100ab9b44295342
|
||||
NativeFormatImporter:
|
||||
userData:
|
5
Game/Assets/Standard Assets/Water (Basic)/Sources.meta
Normal file
5
Game/Assets/Standard Assets/Water (Basic)/Sources.meta
Normal file
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 70a4c3571f5624280bd8605def97056d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 706eadfad28bc4c1c9bb137b31052b14
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 52b7d70b1de7c4ce09662b77c14d9fda
|
||||
NativeFormatImporter:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c55afdc4a8a3b4890b07cc7d176510bb
|
||||
NativeFormatImporter:
|
||||
userData:
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2fd60b04f7c434a4dafd253d09bfa783
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 40b01469ebddf42bc84870ba2f3d8c4c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 30abebfd9bf1c49d8a2d26e61e66bc15
|
||||
NativeFormatImporter:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,68 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce8d79c79d11b8f9d00076e98d76c639
|
||||
ModelImporter:
|
||||
serializedVersion: 16
|
||||
fileIDToRecycleName:
|
||||
100000: //RootNode
|
||||
400000: //RootNode
|
||||
2300000: //RootNode
|
||||
3300000: //RootNode
|
||||
4300000: pPlane1
|
||||
4300002: nurbsToPoly1
|
||||
4300004: pCylinder1
|
||||
4300006: waterPlaneMesh
|
||||
11100000: //RootNode
|
||||
materials:
|
||||
importMaterials: 1
|
||||
materialName: 3
|
||||
materialSearch: 1
|
||||
animations:
|
||||
legacyGenerateAnimations: 0
|
||||
bakeSimulation: 0
|
||||
optimizeGameObjects: 0
|
||||
motionNodeName:
|
||||
animationCompression: 1
|
||||
animationRotationError: .5
|
||||
animationPositionError: .5
|
||||
animationScaleError: .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
|
||||
weldVertices: 1
|
||||
secondaryUVAngleDistortion: 8
|
||||
secondaryUVAreaDistortion: 15
|
||||
secondaryUVHardAngle: 88
|
||||
secondaryUVPackMargin: 4
|
||||
tangentSpace:
|
||||
normalSmoothAngle: 60
|
||||
splitTangentsAcrossUV: 0
|
||||
normalImportMode: 0
|
||||
tangentImportMode: 1
|
||||
importAnimation: 1
|
||||
copyAvatar: 0
|
||||
humanDescription:
|
||||
human: []
|
||||
skeleton: []
|
||||
armTwist: .5
|
||||
foreArmTwist: .5
|
||||
upperLegTwist: .5
|
||||
legTwist: .5
|
||||
armStretch: .0500000007
|
||||
legStretch: .0500000007
|
||||
feetSpacing: 0
|
||||
rootMotionBoneName:
|
||||
lastHumanDescriptionAvatarSource: {instanceID: 0}
|
||||
animationType: 1
|
||||
additionalBone: 1
|
||||
userData:
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ac85670a1b2274f22905d6a43940371a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
@ -0,0 +1,32 @@
|
||||
using UnityEngine;
|
||||
|
||||
// Sets up transformation matrices to scale&scroll water waves
|
||||
// for the case where graphics card does not support vertex programs.
|
||||
|
||||
[ExecuteInEditMode]
|
||||
public class WaterSimple : MonoBehaviour
|
||||
{
|
||||
void Update()
|
||||
{
|
||||
if( !GetComponent<Renderer>() )
|
||||
return;
|
||||
Material mat = GetComponent<Renderer>().sharedMaterial;
|
||||
if( !mat )
|
||||
return;
|
||||
|
||||
Vector4 waveSpeed = mat.GetVector( "WaveSpeed" );
|
||||
float waveScale = mat.GetFloat( "_WaveScale" );
|
||||
float t = Time.time / 20.0f;
|
||||
|
||||
Vector4 offset4 = waveSpeed * (t * waveScale);
|
||||
Vector4 offsetClamped = new Vector4(Mathf.Repeat(offset4.x,1.0f), Mathf.Repeat(offset4.y,1.0f), Mathf.Repeat(offset4.z,1.0f), Mathf.Repeat(offset4.w,1.0f));
|
||||
mat.SetVector( "_WaveOffset", offsetClamped );
|
||||
|
||||
Vector3 scale = new Vector3( 1.0f/waveScale, 1.0f/waveScale, 1 );
|
||||
Matrix4x4 scrollMatrix = Matrix4x4.TRS( new Vector3(offsetClamped.x,offsetClamped.y,0), Quaternion.identity, scale );
|
||||
mat.SetMatrix( "_WaveMatrix", scrollMatrix );
|
||||
|
||||
scrollMatrix = Matrix4x4.TRS( new Vector3(offsetClamped.z,offsetClamped.w,0), Quaternion.identity, scale * 0.45f );
|
||||
mat.SetMatrix( "_WaveMatrix2", scrollMatrix );
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d2f50a8e0bb841a5aaa90ae55db8849
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c8e96a067d1ef4982b454cf5a686f648
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
@ -0,0 +1,140 @@
|
||||
Shader "FX/Water (simple)" {
|
||||
Properties {
|
||||
_horizonColor ("Horizon color", COLOR) = ( .172 , .463 , .435 , 0)
|
||||
_WaveScale ("Wave scale", Range (0.02,0.15)) = .07
|
||||
_ColorControl ("Reflective color (RGB) fresnel (A) ", 2D) = "" { }
|
||||
_ColorControlCube ("Reflective color cube (RGB) fresnel (A) ", Cube) = "" { TexGen CubeReflect }
|
||||
_BumpMap ("Waves Normalmap ", 2D) = "" { }
|
||||
WaveSpeed ("Wave speed (map1 x,y; map2 x,y)", Vector) = (19,9,-16,-7)
|
||||
_MainTex ("Fallback texture", 2D) = "" { }
|
||||
}
|
||||
|
||||
CGINCLUDE
|
||||
// -----------------------------------------------------------
|
||||
// This section is included in all program sections below
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
uniform float4 _horizonColor;
|
||||
|
||||
uniform float4 WaveSpeed;
|
||||
uniform float _WaveScale;
|
||||
uniform float4 _WaveOffset;
|
||||
|
||||
struct appdata {
|
||||
float4 vertex : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 bumpuv[2] : TEXCOORD0;
|
||||
float3 viewDir : TEXCOORD2;
|
||||
};
|
||||
|
||||
v2f vert(appdata v)
|
||||
{
|
||||
v2f o;
|
||||
float4 s;
|
||||
|
||||
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
|
||||
|
||||
// scroll bump waves
|
||||
float4 temp;
|
||||
temp.xyzw = v.vertex.xzxz * _WaveScale / unity_Scale.w + _WaveOffset;
|
||||
o.bumpuv[0] = temp.xy * float2(.4, .45);
|
||||
o.bumpuv[1] = temp.wz;
|
||||
|
||||
// object space view direction
|
||||
o.viewDir.xzy = normalize( ObjSpaceViewDir(v.vertex) );
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
|
||||
// -----------------------------------------------------------
|
||||
// Fragment program
|
||||
|
||||
Subshader {
|
||||
Tags { "RenderType"="Opaque" }
|
||||
Pass {
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma fragmentoption ARB_precision_hint_fastest
|
||||
|
||||
sampler2D _BumpMap;
|
||||
sampler2D _ColorControl;
|
||||
|
||||
half4 frag( v2f i ) : COLOR
|
||||
{
|
||||
half3 bump1 = UnpackNormal(tex2D( _BumpMap, i.bumpuv[0] )).rgb;
|
||||
half3 bump2 = UnpackNormal(tex2D( _BumpMap, i.bumpuv[1] )).rgb;
|
||||
half3 bump = (bump1 + bump2) * 0.5;
|
||||
|
||||
half fresnel = dot( i.viewDir, bump );
|
||||
half4 water = tex2D( _ColorControl, float2(fresnel,fresnel) );
|
||||
|
||||
half4 col;
|
||||
col.rgb = lerp( water.rgb, _horizonColor.rgb, water.a );
|
||||
col.a = _horizonColor.a;
|
||||
return col;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------
|
||||
// Old cards
|
||||
|
||||
// three texture, cubemaps
|
||||
Subshader {
|
||||
Tags { "RenderType"="Opaque" }
|
||||
Pass {
|
||||
Color (0.5,0.5,0.5,0.5)
|
||||
SetTexture [_MainTex] {
|
||||
Matrix [_WaveMatrix]
|
||||
combine texture * primary
|
||||
}
|
||||
SetTexture [_MainTex] {
|
||||
Matrix [_WaveMatrix2]
|
||||
combine texture * primary + previous
|
||||
}
|
||||
SetTexture [_ColorControlCube] {
|
||||
combine texture +- previous, primary
|
||||
Matrix [_Reflection]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// dual texture, cubemaps
|
||||
Subshader {
|
||||
Tags { "RenderType"="Opaque" }
|
||||
Pass {
|
||||
Color (0.5,0.5,0.5,0.5)
|
||||
SetTexture [_MainTex] {
|
||||
Matrix [_WaveMatrix]
|
||||
combine texture
|
||||
}
|
||||
SetTexture [_ColorControlCube] {
|
||||
combine texture +- previous, primary
|
||||
Matrix [_Reflection]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// single texture
|
||||
Subshader {
|
||||
Tags { "RenderType"="Opaque" }
|
||||
Pass {
|
||||
Color (0.5,0.5,0.5,0)
|
||||
SetTexture [_MainTex] {
|
||||
Matrix [_WaveMatrix]
|
||||
combine texture, primary
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9dccc8e8f0da4494991c26ef59019551
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33850b67ffcaa4b6c9a7146e4be0b917
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
userData:
|
Binary file not shown.
After Width: | Height: | Size: 156 KiB |
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c2ef94ff9d11915d1100a04b44295342
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 2
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 512
|
||||
textureSettings:
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapMode: 0
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: 0
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
Binary file not shown.
After Width: | Height: | Size: 135 KiB |
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a53cf5449d11a15d1100a04b44295342
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 1
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 2
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 1
|
||||
externalNormalMap: 1
|
||||
heightScale: .0164516103
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 512
|
||||
textureSettings:
|
||||
filterMode: 1
|
||||
aniso: 3
|
||||
mipBias: 0
|
||||
wrapMode: 0
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: 1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,48 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 006a5f739d1105f6a000538a2aef8c59
|
||||
TextureImporter:
|
||||
fileIDToRecycleName:
|
||||
8900000: generatedCubemap
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 2
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .100000001
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 3
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 32
|
||||
textureSettings:
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapMode: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: -1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8403d3349d112ba4d000be1be39e7c39
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 2
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .100000001
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 32
|
||||
textureSettings:
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapMode: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: 0
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,47 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 047330f39d11745ad0004adb8d76c639
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 2
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .100000001
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 32
|
||||
textureSettings:
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapMode: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: 0
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
Binary file not shown.
@ -0,0 +1,48 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 98c330f39d11745ad0004adb8d76c639
|
||||
TextureImporter:
|
||||
fileIDToRecycleName:
|
||||
8900000: generatedCubemap
|
||||
serializedVersion: 2
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
linearTexture: 0
|
||||
correctGamma: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapFadeDistanceStart: 2
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: .100000001
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 3
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 12
|
||||
maxTextureSize: 32
|
||||
textureSettings:
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapMode: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: .5, y: .5}
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spritePixelsToUnits: 100
|
||||
alphaIsTransparency: 0
|
||||
textureType: -1
|
||||
buildTargetSettings: []
|
||||
spriteSheet:
|
||||
sprites: []
|
||||
spritePackingTag:
|
||||
userData:
|
Reference in New Issue
Block a user