Ein bisschen rumgeeiert
This commit is contained in:
36
3d Prototyp/Assets/Scripts/CameraScript.cs
Normal file
36
3d Prototyp/Assets/Scripts/CameraScript.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CameraScript : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private Character _character;
|
||||
|
||||
[SerializeField]
|
||||
private Camera _camera;
|
||||
|
||||
public float Distance = 5.0f;
|
||||
|
||||
void Start()
|
||||
{
|
||||
Vector4 position = new Vector4(0, 0, -Distance, 1.0f);
|
||||
|
||||
Matrix4x4 mat = Matrix4x4.Rotate(Quaternion.Euler(45, 0, 0));
|
||||
|
||||
_camera.transform.localPosition = mat * position;
|
||||
transform.position = _character.transform.position;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
transform.position = _character.transform.position;
|
||||
}
|
||||
|
||||
private void OnValidate()
|
||||
{
|
||||
Start();
|
||||
}
|
||||
}
|
||||
11
3d Prototyp/Assets/Scripts/CameraScript.cs.meta
Normal file
11
3d Prototyp/Assets/Scripts/CameraScript.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 69662b2e17f93e54d8e52fca91af8c51
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -148,6 +148,7 @@ public class Developer : MonoBehaviour
|
||||
_talkTimer = Random.Range(5.0f, 15.0f);
|
||||
_fingersLeft = _baseStats.Fingers;
|
||||
_privateContextBuffer = new CircularBuffer<string>(_maxPrivateContextBufferSize);
|
||||
|
||||
}
|
||||
|
||||
private void Update()
|
||||
|
||||
Reference in New Issue
Block a user