2023-05-09 19:09:37 +02:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
// Kann sein das das nur für statische Objekte funktioniert
|
|
|
|
public class DimShift : MonoBehaviour
|
|
|
|
{
|
|
|
|
// 0 = inactive in Dimension 1
|
|
|
|
// 1 = active in Dimension 1
|
|
|
|
public bool inFirstDim;
|
2023-05-11 15:55:30 +02:00
|
|
|
GameObject Dim1;
|
|
|
|
GameObject Dim2;
|
|
|
|
|
2023-05-09 19:09:37 +02:00
|
|
|
void Start()
|
|
|
|
{
|
2023-05-11 15:55:30 +02:00
|
|
|
Dim1 = GameObject.Find("Dim1");
|
|
|
|
Dim2 = GameObject.Find("Dim2");
|
2023-05-09 19:09:37 +02:00
|
|
|
|
|
|
|
if (inFirstDim)
|
|
|
|
{
|
2023-05-11 15:55:30 +02:00
|
|
|
Dim1.SetActive(true);
|
|
|
|
Dim2.SetActive(false);
|
2023-05-09 19:09:37 +02:00
|
|
|
|
|
|
|
} else
|
|
|
|
{
|
2023-05-11 15:55:30 +02:00
|
|
|
Dim2.SetActive(true);
|
|
|
|
Dim1.SetActive(false);
|
2023-05-09 19:09:37 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Update()
|
|
|
|
{
|
|
|
|
if (Input.GetKeyDown(KeyCode.LeftShift)&&inFirstDim)
|
|
|
|
{
|
2023-05-11 15:55:30 +02:00
|
|
|
Dim2.SetActive(true);
|
|
|
|
Dim1.SetActive(false);
|
2023-05-09 19:09:37 +02:00
|
|
|
inFirstDim = !inFirstDim;
|
|
|
|
} else
|
|
|
|
{
|
|
|
|
if (Input.GetKeyDown(KeyCode.LeftShift)&&!inFirstDim)
|
|
|
|
{
|
2023-05-11 15:55:30 +02:00
|
|
|
Dim1.SetActive(true);
|
|
|
|
Dim2.SetActive(false);
|
2023-05-09 19:09:37 +02:00
|
|
|
inFirstDim = !inFirstDim;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|