//创建数据块
        public SoldierDataBlock CreateDataBlock(int dataCount)
        {
            SoldierDataBlock soldierDataBlock = new SoldierDataBlock();

            soldierDataBlock.animationAsset = this;
            soldierDataBlock.Reset(dataCount);
            return(soldierDataBlock);
        }
Exemple #2
0
        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;
        }