//创建数据块 public SoldierDataBlock CreateDataBlock(int dataCount) { SoldierDataBlock soldierDataBlock = new SoldierDataBlock(); soldierDataBlock.animationAsset = this; soldierDataBlock.Reset(dataCount); return(soldierDataBlock); }
private void Awake() { soldierDataBlock = animationAsset?.CreateDataBlock(1); if (soldierDataBlock == null) { Debug.LogErrorFormat("Awake animation control demo faile. Asset is null"); } soldierDataBlock.Reset(1); soldierDataBlock.atkAnimLength = animationAsset.attackAnimLength; soldierDataBlock.deathAnimLength = animationAsset.deathAnimLength; soldierDataBlock.matrixs[0] = transform.localToWorldMatrix; }