Moved ViewControl to Scripts folder

This commit is contained in:
adrenalx 2016-06-25 11:39:59 -04:00
parent 45b3f1633e
commit 7154f75c01
10 changed files with 148 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e30c07fb6559541af858338a37440da7
timeCreated: 1466818119
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Red_Brick_Wall.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

View File

@ -0,0 +1,57 @@
fileFormatVersion: 2
guid: 11f13d469daed41edb2648f1d1b461b2
timeCreated: 1466818973
licenseType: Free
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: 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:

9
Assets/Scripts.meta Normal file
View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 585294b74b6b54cae92293ffbd3a2088
folderAsset: yes
timeCreated: 1466869142
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 55ee7f3d2d53247daa31f81beccb99d8
timeCreated: 1466869142
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,42 @@
using UnityEngine;
using System.Collections;
public class ViewControl : MonoBehaviour
{
// Speed at which the camera will catch up to the mouse pointer location
public float smoothing = 1.5f;
public float mouseSensitivity = 100.0f;
public float clampAngle = 80.0f;
private float rotY = 0.0f;
// rotation around the up/y axis
private float rotX = 0.0f;
// rotation around the right/x axis
// Use this for initialization
void Start()
{
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
Vector3 rot = transform.localRotation.eulerAngles;
rotY = rot.y;
rotX = rot.x;
}
// Called once every physics update
void FixedUpdate()
{
float mouseX = Input.GetAxis("Mouse X");
float mouseY = -Input.GetAxis("Mouse Y");
rotY += mouseX * mouseSensitivity * Time.deltaTime;
rotX += mouseY * mouseSensitivity * Time.deltaTime;
rotX = Mathf.Clamp(rotX, -clampAngle, clampAngle);
Quaternion localRotation = Quaternion.Euler(rotX, rotY, 0.0f);
transform.rotation = localRotation;
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 2c2ae6eb7fab0437791fe2f4ad415052
timeCreated: 1466818849
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/TestMaterial.mat Normal file

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 852c4d218cedd4ae5b088ddcdedccad4
timeCreated: 1466818559
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant: