예제 #1
0
            public void CopyData(UnityEditor.Animations.AnimatorStateTransition pSource)
            {
                if (pSource == null)
                {
                    return;
                }

                if (pSource.destinationState != null)
                {
                    destinationType = DestinationType.state;
                    destinationName = pSource.destinationState.name;
                }
                else if (pSource.destinationStateMachine != null)
                {
                    destinationType = DestinationType.stateMachine;
                    destinationName = pSource.destinationStateMachine.name;
                }

                duration = pSource.duration;
                exitTime = pSource.exitTime;

                var tcondions = pSource.conditions;

                conditions = new AssetCondition.Condition[tcondions.Length];
                for (int i = 0; i < conditions.Length; i++)
                {
                    AssetCondition.Condition item = new AssetCondition.Condition();
                    item.CopyData(ref tcondions[i]);
                    conditions[i] = item;
                }
            }
예제 #2
0
            public void ReadFromFile(System.IO.BinaryReader pReader)
            {
                ownerMachineIndex = pReader.ReadInt32();
                destinationType   = (DestinationType)pReader.ReadInt32();
                destinationName   = pReader.ReadString();
                duration          = pReader.ReadSingle();
                exitTime          = pReader.ReadSingle();

                int tlen = pReader.ReadInt32();

                conditions = new AssetCondition.Condition[tlen];
                for (int i = 0; i < tlen; i++)
                {
                    conditions[i] = new AssetCondition.Condition();
                    conditions[i].ReadFromFile(pReader);
                }
            }
예제 #3
0
            public void WriteToFile(System.IO.BinaryWriter pWriter)
            {
                pWriter.Write(ownerMachineIndex);
                pWriter.Write((int)destinationType);
                pWriter.Write(destinationName);
                pWriter.Write(duration);
                pWriter.Write(exitTime);

                int tlen = conditions == null ? 0 : conditions.Length;

                pWriter.Write(tlen);
                if (conditions != null)
                {
                    for (int i = 0; i < conditions.Length; i++)
                    {
                        AssetCondition.Condition item = conditions[i];
                        item.WriteToFile(pWriter);
                    }
                }
            }