Example #1
0
        public void Update()
        {
            if (mrList != null)
            {
                for (int i = 0; i < damageDrawNum; i++)
                {
                    if (mrList[i] != null)
                    {
                        MeshRenderer tempMR = mrList[i];
                        for (int m = 0; m < damageUnitNum; m++)
                        {
                            BattleDamageNumUnit tempUnit = unitVec[i, m];
                            if (tempUnit.State == 1 || tempUnit.IsChange)
                            {
                                if (tempUnit.IsChange)
                                {
                                    tempUnit.IsChange = false;
                                }
                                tempMR.material.SetVector("fix" + m.ToString(), tempUnit.GetFix());
                            }
                        }

                        for (int n = 0; n < damageGroupNum; n++)
                        {
                            BattleDamageNumGroup tempGroup = groupVec[i, n];
                            if (tempGroup.State == 1 || tempGroup.IsChange)
                            {
                                if (tempGroup.IsChange)
                                {
                                    tempGroup.IsChange = false;
                                }
                                tempMR.material.SetVector("positions" + n.ToString(), tempGroup.GetPositionsVec());
                                tempMR.material.SetMatrix("myMatrix" + n.ToString(), tempGroup.GetMatrix());
                            }
                        }
                    }
                }
            }
        }