// Use this for initialization void Start() { if (current != null && current != this) { Debug.LogWarning("There is more than one active 'RangeFadeController' scripts in the scene.\n", current.gameObject); } current = this; LoadID(); }
// Update is called once per frame void Update() { current = this; if (rangeFadeMin != rangeFadeMin_Current || rangeFadeMax_Current != rangeFadeMax) { rangeFadeMin_Current = rangeFadeMin; rangeFadeMax_Current = rangeFadeMax; Shader.SetGlobalVector(rangeFadeID, new Vector2(rangeFadeMin, rangeFadeMax)); } }