using DG.Tweening; using System.Collections; using System.Collections.Generic; using UnityEngine; public class WaveLineSelEffect : MonoBehaviour { public int waveLineId; protected Material mCurMat; protected float setSelTime = 0.0f; protected bool bInSel = false; /// /// 设置当前的WaveLine为选中状态 /// /// public void SetWaveLineSel( bool sel) { if( sel) { setSelTime = 0.2f; if (!bInSel) mCurMat.DOColor(new Color(1.0f, 1.0f, 1.0f, 1.0f), 0.4f); bInSel = true; } } // Start is called before the first frame update void Start() { mCurMat = this.GetComponent().material; } // Update is called once per frame void Update() { if (setSelTime <= 0) return; setSelTime -= Time.deltaTime; if( setSelTime <= 0) { bInSel = false; setSelTime = 0.0f; mCurMat.DOColor(new Color(1.0f, 1.0f, 1.0f, 0.0f), 0.2f); } } }