Lade till PickUps
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
public class BallController : MonoBehaviour {
|
||||
@@ -19,6 +20,10 @@ public class BallController : MonoBehaviour {
|
||||
CheckPlayerOut();
|
||||
}
|
||||
|
||||
void OnTriggerEnter(Collider other) {
|
||||
other.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
void CheckPlayerOut() {
|
||||
if (transform.position.y < outOfBounds) {
|
||||
transform.position = new Vector3(0, 1f, 0);
|
||||
|
||||
10
Assets/Scripts/Rotator.cs
Normal file
10
Assets/Scripts/Rotator.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Rotator : MonoBehaviour {
|
||||
int speed = 5;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update() {
|
||||
transform.Rotate(new Vector3(15, 30, 45) * (Time.deltaTime * speed));
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Rotator.cs.meta
Normal file
2
Assets/Scripts/Rotator.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 71666496d30926049b05c2c8cff6330a
|
||||
Reference in New Issue
Block a user