updated game with new start screen
This commit is contained in:
37
Assets/Packages/SpaceSkies Free/Demo/Scripts/LookCamera.cs
Normal file
37
Assets/Packages/SpaceSkies Free/Demo/Scripts/LookCamera.cs
Normal file
@ -0,0 +1,37 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class LookCamera : MonoBehaviour
|
||||
{
|
||||
public float speedNormal = 10.0f;
|
||||
public float speedFast = 50.0f;
|
||||
|
||||
public float mouseSensitivityX = 5.0f;
|
||||
public float mouseSensitivityY = 5.0f;
|
||||
|
||||
float rotY = 0.0f;
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (GetComponent<Rigidbody>())
|
||||
GetComponent<Rigidbody>().freezeRotation = true;
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
// rotation
|
||||
if (Input.GetMouseButton(1))
|
||||
{
|
||||
float rotX = transform.localEulerAngles.y + Input.GetAxis("Mouse X") * mouseSensitivityX;
|
||||
rotY += Input.GetAxis("Mouse Y") * mouseSensitivityY;
|
||||
rotY = Mathf.Clamp(rotY, -89.5f, 89.5f);
|
||||
transform.localEulerAngles = new Vector3(-rotY, rotX, 0.0f);
|
||||
}
|
||||
|
||||
if (Input.GetKey(KeyCode.U))
|
||||
{
|
||||
gameObject.transform.localPosition = new Vector3(0.0f, 3500.0f, 0.0f);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a3e5f51e31f79c4fb340e92ffc286e8
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -0,0 +1,20 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class SkyboxChanger : MonoBehaviour
|
||||
{
|
||||
public Material[] Skyboxes;
|
||||
private Dropdown _dropdown;
|
||||
|
||||
public void Awake()
|
||||
{
|
||||
_dropdown = GetComponent<Dropdown>();
|
||||
//var options = Skyboxes.Select(skybox => skybox.name).ToList();
|
||||
//_dropdown.AddOptions(options);
|
||||
}
|
||||
|
||||
public void ChangeSkybox()
|
||||
{
|
||||
RenderSettings.skybox = Skyboxes[_dropdown.value];
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dca6002b33ac5bc48b39588e222296fb
|
||||
timeCreated: 1459805230
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user