TaiZhouChangChu/Assets/HighlightingSystemDemo/Scripts/Basic/JSHighlighterController.js

25 lines
612 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma strict
// Windows Store Apps: You cant access C# classes from JS scripts unless you check .NET Core Partially in Compilation Overrides in PlayerSettings
#if !UNITY_WSA
import HighlightingSystem;
#endif
class JSHighlighterController extends MonoBehaviour
{
#if !UNITY_WSA
protected var h : HighlightingSystem.Highlighter;
//
function Awake()
{
h = GetComponent(HighlightingSystem.Highlighter);
if (h == null) { h = gameObject.AddComponent(HighlightingSystem.Highlighter); }
}
//
function Start()
{
h.FlashingOn(new Color(1f, 1f, 0f, 0f), new Color(1f, 1f, 0f, 1f), 2f);
}
#endif
}