Dimensionsshift added und Character Controller in Script Ordner
verschoben
This commit is contained in:
parent
73351d7273
commit
ae790642dd
47
Assets/AssetsFORELLE/Script/DimShift.cs
Normal file
47
Assets/AssetsFORELLE/Script/DimShift.cs
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
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;
|
||||||
|
BoxCollider2D col;
|
||||||
|
SpriteRenderer rend;
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
col = GetComponent<BoxCollider2D>();
|
||||||
|
rend = GetComponent<SpriteRenderer>();
|
||||||
|
|
||||||
|
if (inFirstDim)
|
||||||
|
{
|
||||||
|
col.enabled = true;
|
||||||
|
rend.enabled = true;
|
||||||
|
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
col.enabled = false;
|
||||||
|
rend.enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if (Input.GetKeyDown(KeyCode.LeftShift)&&inFirstDim)
|
||||||
|
{
|
||||||
|
col.enabled = false;
|
||||||
|
rend.enabled = false;
|
||||||
|
inFirstDim = !inFirstDim;
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
if (Input.GetKeyDown(KeyCode.LeftShift)&&!inFirstDim)
|
||||||
|
{
|
||||||
|
col.enabled = true;
|
||||||
|
rend.enabled = true;
|
||||||
|
inFirstDim = !inFirstDim;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
Assets/AssetsFORELLE/Script/DimShift.cs.meta
generated
Normal file
11
Assets/AssetsFORELLE/Script/DimShift.cs.meta
generated
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bef524aa2ad305d4faf6b90a610e5be4
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
28
Assets/Scenes/BoxMovable.unity
generated
28
Assets/Scenes/BoxMovable.unity
generated
@ -1165,6 +1165,7 @@ GameObject:
|
|||||||
- component: {fileID: 1678984579}
|
- component: {fileID: 1678984579}
|
||||||
- component: {fileID: 1678984578}
|
- component: {fileID: 1678984578}
|
||||||
- component: {fileID: 1678984577}
|
- component: {fileID: 1678984577}
|
||||||
|
- component: {fileID: 1678984580}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: "Schr\xE4geRunter"
|
m_Name: "Schr\xE4geRunter"
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@ -1265,6 +1266,19 @@ Transform:
|
|||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 7
|
m_RootOrder: 7
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: -21.629}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: -21.629}
|
||||||
|
--- !u!114 &1678984580
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1678984576}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: bef524aa2ad305d4faf6b90a610e5be4, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
inFirstDim: 0
|
||||||
--- !u!1 &2028016239
|
--- !u!1 &2028016239
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -1276,6 +1290,7 @@ GameObject:
|
|||||||
- component: {fileID: 2028016242}
|
- component: {fileID: 2028016242}
|
||||||
- component: {fileID: 2028016241}
|
- component: {fileID: 2028016241}
|
||||||
- component: {fileID: 2028016240}
|
- component: {fileID: 2028016240}
|
||||||
|
- component: {fileID: 2028016243}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: "Schr\xE4geHoch"
|
m_Name: "Schr\xE4geHoch"
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@ -1376,3 +1391,16 @@ Transform:
|
|||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 6
|
m_RootOrder: 6
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 26.312}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 26.312}
|
||||||
|
--- !u!114 &2028016243
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2028016239}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: bef524aa2ad305d4faf6b90a610e5be4, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
inFirstDim: 0
|
||||||
|
28
Assets/Scenes/SampleScene.unity
generated
28
Assets/Scenes/SampleScene.unity
generated
@ -632,6 +632,7 @@ GameObject:
|
|||||||
- component: {fileID: 921148901}
|
- component: {fileID: 921148901}
|
||||||
- component: {fileID: 921148900}
|
- component: {fileID: 921148900}
|
||||||
- component: {fileID: 921148902}
|
- component: {fileID: 921148902}
|
||||||
|
- component: {fileID: 921148903}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Platform
|
m_Name: Platform
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@ -732,6 +733,19 @@ BoxCollider2D:
|
|||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Size: {x: 1, y: 1}
|
m_Size: {x: 1, y: 1}
|
||||||
m_EdgeRadius: 0
|
m_EdgeRadius: 0
|
||||||
|
--- !u!114 &921148903
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 921148899}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: bef524aa2ad305d4faf6b90a610e5be4, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
inFirstDim: 1
|
||||||
--- !u!1 &2021624529
|
--- !u!1 &2021624529
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -743,6 +757,7 @@ GameObject:
|
|||||||
- component: {fileID: 2021624531}
|
- component: {fileID: 2021624531}
|
||||||
- component: {fileID: 2021624530}
|
- component: {fileID: 2021624530}
|
||||||
- component: {fileID: 2021624532}
|
- component: {fileID: 2021624532}
|
||||||
|
- component: {fileID: 2021624533}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Wall
|
m_Name: Wall
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@ -843,3 +858,16 @@ BoxCollider2D:
|
|||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Size: {x: 1, y: 1}
|
m_Size: {x: 1, y: 1}
|
||||||
m_EdgeRadius: 0
|
m_EdgeRadius: 0
|
||||||
|
--- !u!114 &2021624533
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2021624529}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: bef524aa2ad305d4faf6b90a610e5be4, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
inFirstDim: 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user