예제 #1
0
        public RuntimeAnimatorState GetStateByIndex(int pIndex, int pLayer, int pMechine = 0)
        {
            RuntimeAnimatorLayer tlayer = Layers[pLayer];

            if (tlayer == null)
            {
                Debug.LogError("Can't found layer by index " + pLayer);
                return(null);
            }
            if (tlayer[pMechine] == null)
            {
                Debug.LogError(string.Format("the layer is not have machine. layer = {0} pMechine = {1}", pLayer, pMechine));
                return(null);
            }
            return(tlayer[pMechine][pIndex]);
        }
예제 #2
0
        private RuntimeAnimatorState GetState(int pHashState, int pLayer, int pMechine = 0)
        {
            RuntimeAnimatorLayer tlayer = Layers[pLayer];

            if (tlayer == null)
            {
                Debug.LogError("Can't found layer by index " + pLayer);
                return(null);
            }
            if (tlayer[pMechine] == null)
            {
                Debug.LogError(string.Format("the layer is not have machine. layer = {0} pMechine = {1}", pLayer, pMechine));
                return(null);
            }

            return(pHashState == 0 ? tlayer[pMechine].defaultState : tlayer[pMechine].GetState(pHashState));
        }
        public override void InitNode(AnimationInstancing pAnimator)
        {
            var tpam = parameters;

            layerLength = layerListInfo.Count;
            LayerList   = new RuntimeAnimatorLayer[layerLength];
            for (int i = 0; i < layerLength; i++)
            {
                var item     = layerListInfo[i];
                var trtlayer = new RuntimeAnimatorLayer(item)
                {
                    parameters = tpam
                };
                trtlayer.InitNode(pAnimator);
                LayerList[i] = trtlayer;
            }
        }