Looking-Glass/Assets/props/key objects/code panel/KeyPanelLockable.cs

24 lines
588 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class KeyPanelLockable : Lockable
{
Material material;
public AudioSource reject;
public AudioSource accept;
public AudioSource puzzlecomplete;
public bool finalStep = false;
public override void StartUnlock(){
material = GetComponent<MeshRenderer>().material;
material.color = Color.green;
accept.Play();
if(finalStep){
puzzlecomplete.Play();
}
}
public override void FailedUnlock(){
reject.Play();
}
}