started camera smooth zoom

This commit is contained in:
unknown 2015-08-12 21:05:40 -04:00
parent fdff933e13
commit 934f122179
4 changed files with 37 additions and 13 deletions

View File

@ -159,6 +159,7 @@ Camera:
m_OcclusionCulling: 1 m_OcclusionCulling: 1
m_StereoConvergence: 10 m_StereoConvergence: 10
m_StereoSeparation: .0219999999 m_StereoSeparation: .0219999999
m_StereoMirrorMode: 0
--- !u!4 &61719365 --- !u!4 &61719365
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -257,6 +258,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d0907c1567bad554c8b995de3459e517, type: 3} m_Script: {fileID: 11500000, guid: d0907c1567bad554c8b995de3459e517, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
nextPosition: {x: 0, y: 0, z: 0}
moveSpeed: 1
Link: {fileID: 11495142, guid: fab430cecad80ad4391987a06b550cb7, type: 2} Link: {fileID: 11495142, guid: fab430cecad80ad4391987a06b550cb7, type: 2}
Person: {fileID: 11406500, guid: 646dd6566f9e1374caa3af8ad37c43d3, type: 2} Person: {fileID: 11406500, guid: 646dd6566f9e1374caa3af8ad37c43d3, type: 2}
PointsAmount: 200 PointsAmount: 200

View File

@ -4,6 +4,11 @@ using System.Collections.Generic;
public class Center : MonoBehaviour public class Center : MonoBehaviour
{ {
//public float fov = Camera.main.fieldOfView;
public Vector3 nextPosition;
public float moveSpeed = 0;
public FriendshipLink Link; public FriendshipLink Link;
public PersonTest Person; public PersonTest Person;
public int PointsAmount = 50; public int PointsAmount = 50;
@ -50,7 +55,20 @@ public class Center : MonoBehaviour
dragging = false; dragging = false;
delta = new Vector3(); delta = new Vector3();
} }
//camera zoom
if (Input.GetAxis("Mouse ScrollWheel") != 0)
{
Debug.Log("Pressed middle click.");
//Camera.main.transform.position.z += (moveSpeed * Time.deltaTime);
//transform.position = Vector3.Lerp(transform.position, nextPosition, Time.deltaTime * moveSpeed);
//Camera.main.fieldOfView += Input.GetAxis("Mouse ScrollWheel") * 10f;
//Camera.main.transform
}
}
void FixedUpdate()
{
if (dragging) if (dragging)
{ {
MoveSphere(); MoveSphere();
@ -67,9 +85,8 @@ public class Center : MonoBehaviour
rb.angularVelocity *= 0.8f; rb.angularVelocity *= 0.8f;
} }
delta += new Vector3(deltaX, deltaY, 0); delta += new Vector3(deltaX, deltaY, 0);
//rigidbody.AddTorque(); rb.AddTorque(Vector3.down * delta.x * torqueForce * Time.fixedDeltaTime, ForceMode.Impulse);
rb.AddTorque(Vector3.down * delta.x * torqueForce * Time.deltaTime, ForceMode.Impulse); rb.AddTorque(Vector3.right * delta.y * torqueForce * Time.fixedDeltaTime, ForceMode.Impulse);
rb.AddTorque(Vector3.right * delta.y * torqueForce * Time.deltaTime, ForceMode.Impulse);
Debug.Log(delta.x + ", " + delta.y); Debug.Log(delta.x + ", " + delta.y);

View File

@ -19,7 +19,7 @@ InputManager:
snap: 1 snap: 1
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 2
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Vertical m_Name: Vertical

View File

@ -3,17 +3,14 @@
--- !u!129 &1 --- !u!129 &1
PlayerSettings: PlayerSettings:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
serializedVersion: 6 serializedVersion: 7
AndroidProfiler: 0 AndroidProfiler: 0
defaultScreenOrientation: 4 defaultScreenOrientation: 4
targetDevice: 2 targetDevice: 2
targetGlesGraphics: -1
targetIOSGraphics: -1
targetResolution: 0 targetResolution: 0
accelerometerFrequency: 60 accelerometerFrequency: 60
companyName: DefaultCompany companyName: DefaultCompany
productName: DeathBook productName: DeathBook
cloudProjectId:
defaultCursor: {fileID: 0} defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0} cursorHotspot: {x: 0, y: 0}
m_ShowUnitySplashScreen: 1 m_ShowUnitySplashScreen: 1
@ -26,7 +23,6 @@ PlayerSettings:
m_ActiveColorSpace: 0 m_ActiveColorSpace: 0
m_MTRendering: 1 m_MTRendering: 1
m_MobileMTRendering: 0 m_MobileMTRendering: 0
m_UseDX11: 1
m_Stereoscopic3D: 0 m_Stereoscopic3D: 0
iosShowActivityIndicatorOnLoading: -1 iosShowActivityIndicatorOnLoading: -1
androidShowActivityIndicatorOnLoading: -1 androidShowActivityIndicatorOnLoading: -1
@ -81,6 +77,7 @@ PlayerSettings:
metroEnableIndependentInputSource: 0 metroEnableIndependentInputSource: 0
metroEnableLowLatencyPresentationAPI: 0 metroEnableLowLatencyPresentationAPI: 0
xboxOneDisableKinectGpuReservation: 0 xboxOneDisableKinectGpuReservation: 0
virtualRealitySupported: 0
productGUID: 402278fad2098ce4eab29439139ae9ad productGUID: 402278fad2098ce4eab29439139ae9ad
AndroidBundleVersionCode: 1 AndroidBundleVersionCode: 1
AndroidMinSdkVersion: 9 AndroidMinSdkVersion: 9
@ -123,6 +120,7 @@ PlayerSettings:
iOSLaunchScreenCustomXibPath: iOSLaunchScreenCustomXibPath:
AndroidTargetDevice: 0 AndroidTargetDevice: 0
AndroidSplashScreenScale: 0 AndroidSplashScreenScale: 0
androidSplashScreen: {fileID: 0}
AndroidKeystoreName: AndroidKeystoreName:
AndroidKeyaliasName: AndroidKeyaliasName:
AndroidTVCompatibility: 1 AndroidTVCompatibility: 1
@ -136,6 +134,7 @@ PlayerSettings:
resolutionDialogBanner: {fileID: 0} resolutionDialogBanner: {fileID: 0}
m_BuildTargetIcons: [] m_BuildTargetIcons: []
m_BuildTargetBatching: [] m_BuildTargetBatching: []
m_BuildTargetGraphicsAPIs: []
webPlayerTemplate: APPLICATION:Default webPlayerTemplate: APPLICATION:Default
m_TemplateCustomTags: {} m_TemplateCustomTags: {}
actionOnDotNetUnhandledException: 1 actionOnDotNetUnhandledException: 1
@ -197,6 +196,7 @@ PlayerSettings:
ps4ApplicationParam2: 0 ps4ApplicationParam2: 0
ps4ApplicationParam3: 0 ps4ApplicationParam3: 0
ps4ApplicationParam4: 0 ps4ApplicationParam4: 0
ps4GarlicHeapSize: 2048
ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ
ps4pnSessions: 1 ps4pnSessions: 1
ps4pnPresence: 1 ps4pnPresence: 1
@ -339,8 +339,7 @@ PlayerSettings:
blackberrySquareSplashScreen: {fileID: 0} blackberrySquareSplashScreen: {fileID: 0}
tizenProductDescription: tizenProductDescription:
tizenProductURL: tizenProductURL:
tizenCertificatePath: tizenSigningProfileName:
tizenCertificatePassword:
tizenGPSPermissions: 0 tizenGPSPermissions: 0
tizenMicrophonePermissions: 0 tizenMicrophonePermissions: 0
stvDeviceAddress: stvDeviceAddress:
@ -398,4 +397,9 @@ PlayerSettings:
- WebGL::template - WebGL::template
WebGL::emscriptenArgs: WebGL::emscriptenArgs:
WebGL::template: APPLICATION:Default WebGL::template: APPLICATION:Default
firstStreamedLevelWithResources: 0 firstStreamedSceneWithResources: 0
cloudProjectId:
projectId:
projectName:
organizationId:
cloudEnabled: 0