stuff made here
This commit is contained in:
40
Assets/Scripts/MenuMouse.cs
Normal file
40
Assets/Scripts/MenuMouse.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class MenuMouse : MonoBehaviour
|
||||
{
|
||||
public Vector3 pos;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
pos.y -= 4.69f;
|
||||
pos.x -= 8.66f;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
pos.x += Input.GetAxisRaw("Mouse X") * Time.deltaTime * 40f;
|
||||
pos.y += Input.GetAxisRaw("Mouse Y") * Time.deltaTime * 40f;
|
||||
pos.z = -8f;
|
||||
if (pos.x > 8.62f){
|
||||
pos.x = 8.62f;
|
||||
}
|
||||
if (pos.x < -8.62f){
|
||||
pos.x = -8.62f;
|
||||
}
|
||||
if (pos.y > 4.81f){
|
||||
pos.y = 4.81f;
|
||||
}
|
||||
if (pos.y < -4.68f){
|
||||
pos.y = -4.68f;
|
||||
}
|
||||
transform.position = pos;
|
||||
|
||||
}
|
||||
public void play(){
|
||||
SceneManager.LoadScene("Tutorial");
|
||||
}
|
||||
}
|
11
Assets/Scripts/MenuMouse.cs.meta
Normal file
11
Assets/Scripts/MenuMouse.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8b13e4194826a0141840f6217ae392ae
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
30
Assets/Scripts/MenuZoom.cs
Normal file
30
Assets/Scripts/MenuZoom.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class MenuZoom : MonoBehaviour
|
||||
{
|
||||
public Camera cam;
|
||||
public GameObject objects;
|
||||
bool firstrun = true;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (firstrun){
|
||||
firstrun = false;
|
||||
while(cam.fieldOfView > 3f){
|
||||
cam.fieldOfView -= 0.001f;
|
||||
}
|
||||
objects.SetActive(true);
|
||||
while(cam.fieldOfView < 5f){
|
||||
cam.fieldOfView += 0.001f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/MenuZoom.cs.meta
Normal file
11
Assets/Scripts/MenuZoom.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 73a32f65cd2316b4dab35662fa4f4cca
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -6,28 +6,22 @@ using UnityEngine;
|
||||
public class RotateAroundSelfAxis : MonoBehaviour
|
||||
{
|
||||
public bool right_rotation = true;
|
||||
public bool flipping = false;
|
||||
[Range(0, (float)Math.PI * 2)] [SerializeField] public float flip_angle = 0;
|
||||
[Range(0, 60)] [SerializeField] public float speed = 1;
|
||||
[Range(0f, 600f)] [SerializeField] public float speed = 1;
|
||||
|
||||
|
||||
Quaternion rotation;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
rotation = transform.rotation;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
if(right_rotation) {
|
||||
transform.localRotation *= Quaternion.AngleAxis(speed * Time.deltaTime, new Vector3(0f, 0f, -1f));
|
||||
} else {
|
||||
transform.localRotation *= Quaternion.AngleAxis(speed * Time.deltaTime, new Vector3(0f, 0f, 1f));
|
||||
}
|
||||
|
||||
Debug.Log(rotation[2]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user