public void Update() { if (mr != null) { for (int i = 0; i < hpBarNum; i++) { BattleHeroHpBarUnit unit = unitVec[i]; if (unit.IsChange || unit.State == 1) { if (unit.IsChange) { unit.IsChange = false; } unit.GetPositionsVec(mr.material); unit.GetFixVec(mr.material); unit.GetStateInfoVec(mr.material); unit.GetScaleFix(mr.material); } } } }
public void Update() { if (mr != null) { for (int i = 0; i < hpBarNum; i++) { BattleHeroHpBarUnit unit = unitVec[i]; if (unit.IsChange || unit.State == 1) { if (unit.IsChange) { unit.IsChange = false; } Vector4 pos = unit.GetPositionsVec(); mr.material.SetVector("positions" + i.ToString(), pos); mr.material.SetVector("fix" + i.ToString(), unit.GetFixVec()); mr.material.SetVector("stateInfo" + i.ToString(), unit.GetStateInfoVec()); mr.material.SetMatrix("myMatrix" + i.ToString(), unit.GetMatrix()); } } } }