23 lines
391 B
C#
23 lines
391 B
C#
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);
|
|
}
|
|
}
|