Alpha commit
This commit is contained in:
@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Security.Permissions;
|
||||
using UnityEngine;
|
||||
|
||||
public class legacy_CameraController : MonoBehaviour
|
||||
{
|
||||
GameObject player;
|
||||
GameObject[] cameras;
|
||||
int camIterator;
|
||||
float storedPosition;
|
||||
|
||||
//Every time player height changes by 10, adjust depending on whether it was decreased or increased
|
||||
void Start()
|
||||
{
|
||||
player = GameObject.FindWithTag("Player");
|
||||
cameras = GameObject.FindGameObjectsWithTag("MainCamera");
|
||||
foreach(GameObject g in cameras)
|
||||
{
|
||||
if(g.name == "Cam0") { continue; }
|
||||
UnityEngine.Debug.Log(g);
|
||||
g.SetActive(false);
|
||||
}
|
||||
camIterator = 0;
|
||||
storedPosition = player.transform.position.y;
|
||||
UnityEngine.Debug.Log(storedPosition);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if((player.transform.position.y - storedPosition) > 10)
|
||||
{
|
||||
storedPosition += 9;
|
||||
camIterator += 1;
|
||||
cameras[camIterator].SetActive(true);
|
||||
cameras[camIterator - 1].SetActive(false);
|
||||
}
|
||||
|
||||
if ((storedPosition - player.transform.position.y) > 2)
|
||||
{
|
||||
storedPosition -= 9;
|
||||
camIterator -= 1;
|
||||
cameras[camIterator].SetActive(true);
|
||||
cameras[camIterator + 1].SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ac9afa7358b55e443b298bc32c4b4882
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user