Arena version of Land_Of_Death (KF)
This commit is contained in:
675081
Assets/Scenes/Land_01/Land_Of_Death_ARENAS.unity
Normal file
675081
Assets/Scenes/Land_01/Land_Of_Death_ARENAS.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Scenes/Land_01/Land_Of_Death_ARENAS.unity.meta
Normal file
7
Assets/Scenes/Land_01/Land_Of_Death_ARENAS.unity.meta
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3ac39dab4b05aa540af7a4bbd73b2a5a
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Scripts/TEMP_SCRIPTS.meta
Normal file
8
Assets/Scripts/TEMP_SCRIPTS.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b3e4881967119d54ca5592cf73e2c2e4
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
31
Assets/Scripts/TEMP_SCRIPTS/TEMP_GATE_CONTROLLER.cs
Normal file
31
Assets/Scripts/TEMP_SCRIPTS/TEMP_GATE_CONTROLLER.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class GateController : MonoBehaviour
|
||||||
|
{
|
||||||
|
public Vector3 openOffset = new Vector3(0, 3, 0);
|
||||||
|
public float openSpeed = 2f;
|
||||||
|
|
||||||
|
private Vector3 closedPosition;
|
||||||
|
private Vector3 targetPosition;
|
||||||
|
private bool isOpening = false;
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
closedPosition = transform.position;
|
||||||
|
targetPosition = closedPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if (isOpening)
|
||||||
|
{
|
||||||
|
transform.position = Vector3.MoveTowards(transform.position, targetPosition, openSpeed * Time.deltaTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OpenGate()
|
||||||
|
{
|
||||||
|
targetPosition = closedPosition + openOffset;
|
||||||
|
isOpening = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
2
Assets/Scripts/TEMP_SCRIPTS/TEMP_GATE_CONTROLLER.cs.meta
Normal file
2
Assets/Scripts/TEMP_SCRIPTS/TEMP_GATE_CONTROLLER.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3d14f51c2e002824d94d20413bcf42b0
|
||||||
22
Assets/Scripts/TEMP_SCRIPTS/TEMP_LEVER_INTERACTION.cs
Normal file
22
Assets/Scripts/TEMP_SCRIPTS/TEMP_LEVER_INTERACTION.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class LeverInteraction : MonoBehaviour
|
||||||
|
{
|
||||||
|
public GateController gate;
|
||||||
|
private bool isActivated = false;
|
||||||
|
|
||||||
|
void OnMouseDown()
|
||||||
|
{
|
||||||
|
if (!isActivated)
|
||||||
|
{
|
||||||
|
isActivated = true;
|
||||||
|
gate.OpenGate();
|
||||||
|
AnimateLever();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AnimateLever()
|
||||||
|
{
|
||||||
|
transform.Rotate(-45f, 0f, 0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e50a6748cf0dce64d9d0ca7a7982889d
|
||||||
Reference in New Issue
Block a user