Files
gmtk-2021/Assets/DirectionPaddle.cs
Jan Groß ee7a16dd2e Finalized for game jam submission
Lots of bugfixes
New tasks
2021-06-13 20:37:07 +02:00

28 lines
687 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DirectionPaddle : MonoBehaviour
{
public GameObject piston;
public GameObject visuals;
public void Switch()
{
gameObject.SetActive(!gameObject.activeSelf);
}
public void InteractNode()
{
GetComponent<AudioSource>().Play();
this.GetComponent<Collider>().enabled = !this.GetComponent<Collider>().enabled;
this.GetComponent<MeshRenderer>().enabled = !this.GetComponent<MeshRenderer>().enabled;
piston.SetActive(!piston.activeSelf);
visuals.SetActive(!visuals.activeSelf);
}
}