using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Act_Disable : ActivableObject {

	Light MainLight;
	float MainLightBaseIntensity = 1.0f;

	void Start () {
		MainLight = GetComponent<Light>();
		if(MainLight) MainLightBaseIntensity = MainLight.intensity;
	}

	public override void SetGauge(Switcher Obj, float Gauge) {
		if(MainLight) {
			float Flash = Gauge>0.9 ? Mathf.Clamp01( Mathf.Sin(Time.time * 30.0f) * 10.0f ) : 1.0f;
			//MainLight.intensity = MainLightBaseIntensity * Flash;
			gameObject.SetActive(Flash>0.5f);
		}
	}

	public override void SetState(Switcher Obj, bool NewState) {
		base.SetState(Obj, NewState);
		gameObject.SetActive(NewState);
	}
}
