Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class Lightswitch : UsableEntity
- {
- public Light targetLight;
- public override string Action { get { return "Activate"; } }
- public override void OnUse()
- {
- if(targetLight == null)
- return;
- targetLight.enabled = !targetLight.enabled;
- StartCoroutine(OnSwitch());
- }
- private IEnumerator OnSwitch()
- {
- State = UsableState.Disabled;
- yield return new WaitForSeconds(3);
- State = UsableState.Enabled;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement