using UnityEngine;
using System.Collections;
public class HighlighterSpectrum : HighlighterInteractive
{
public bool random = true;
public float velocity = 0.13f;
private float t;
#region MonoBehaviour
//
protected override void Awake()
{
base.Awake();
t = random ? Random.value : 0f;
}
//
protected override void Update()
{
base.Update();
h.ConstantOnImmediate(ColorTool.GetColor(t));
t += Time.deltaTime * velocity;
t %= 1f;
}
#endregion
}
What are you doing and what do you want to achieve?
if you want to change the behaviour of ColorTool when random == false then you need to check
if(!random)
{
//Pick specific colour
}
in Update(). It maybe it would make more sense to just do that once though, so you could specify the
colour elsewhere and set random to false and change your Update to:
protected override void Update()
{
base.Update();
if(random){
h.ConstantOnImmediate(ColorTool.GetColor(t));
t += Time.deltaTime * velocity;
t %= 1f;
}
}
You should edit your original question and give us some more info if that is not what you mean.