| 1 | using System.Collections; |
| 2 | using System.Collections.Generic; |
| 3 | using UnityEngine; |
| 4 | |
| 5 | public class FlipSwitch : Connectable |
| 6 | { |
| 7 | [SerializeField] private Transform flipper; |
| 8 | [SerializeField] private float offRotation, onRotation; |
| 9 | public bool IsFlipped { get; private set; } |
| 10 | |
| 11 | public override void Activate() |
| 12 | { |
| 13 | base.Activate(); |
| 14 | |
| 15 | SFXSpawner.StartSFX(SFXSpawner.Sounds.Click, transform.position); |
| 16 | |
| 17 | IsFlipped = !IsFlipped; |
| 18 | |
| 19 | flipper.transform.localRotation = Quaternion.Euler(IsFlipped ? onRotation : offRotation, 90, 90); |
| 20 | } |
| 21 | } |