using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HighlightPlus;
public class Hight_light_test : MonoBehaviour
{
HighlightEffect[] effects;
// Start is called before the first frame update
void Start()
{
effects = FindObjectsOfType<HighlightEffect>();
if (effects != null)
{
for (int i = 0; i < effects.Length; i++)
{
effects[i].highlighted = true;
}
}
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.Alpha1))
{
for (int i = 0; i < effects.Length; i++)
{
effects[i].highlighted = false;
}
}
if (Input.GetKeyDown(KeyCode.Alpha2))
{
for (int i = 0; i < effects.Length; i++)
{
effects[i].highlighted = true;
}
}
if (Input.GetKeyDown(KeyCode.Alpha3))
{
for (int i = 0; i < effects.Length; i++)
{
effects[i].overlayColor = Color.blue;
}
}
if (Input.GetKeyDown(KeyCode.Alpha4))
{
for (int i = 0; i < effects.Length; i++)
{
effects[i].targetFXTexture = Resources.Load<Texture2D>("篮球");
effects[i].targetFX = true;
}
}
}
private void OnGUI()
{
GUIStyle titleStyle2 = new GUIStyle();
titleStyle2.fontSize = 20;
titleStyle2.normal.textColor = Color.cyan;
GUI.Label(new Rect(10, 10, 500, 100), "按下 Alpha1 全部熄灭", titleStyle2);
GUI.Label(new Rect(10, 60, 500, 100), "按下 Alpha2 全部激活", titleStyle2);
GUI.Label(new Rect(10, 110, 500, 100), "按下 Alpha3 overlayColor 变蓝色", titleStyle2);
GUI.Label(new Rect(10, 160, 500, 100), "按下 Alpha4 target 变化与激活", titleStyle2);
}
}