Пример #1
0
        // Token: 0x0600015B RID: 347 RVA: 0x0000D254 File Offset: 0x0000B454
        private static AIAnimator CreateNewAIAnimator(GameObject obj)
        {
            AIAnimator aianimator = obj.AddComponent <AIAnimator>();

            aianimator.FlightAnimation      = NPCBuilder.CreateNewDirectionalAnimation();
            aianimator.HitAnimation         = NPCBuilder.CreateNewDirectionalAnimation();
            aianimator.IdleAnimation        = NPCBuilder.CreateNewDirectionalAnimation();
            aianimator.TalkAnimation        = NPCBuilder.CreateNewDirectionalAnimation();
            aianimator.MoveAnimation        = NPCBuilder.CreateNewDirectionalAnimation();
            aianimator.OtherAnimations      = new List <AIAnimator.NamedDirectionalAnimation>();
            aianimator.IdleFidgetAnimations = new List <DirectionalAnimation>();
            aianimator.OtherVFX             = new List <AIAnimator.NamedVFXPool>();
            return(aianimator);
        }
Пример #2
0
        // Token: 0x0600015A RID: 346 RVA: 0x0000D168 File Offset: 0x0000B368
        public static tk2dSpriteAnimationClip AddAnimation(this GameObject obj, string name, string spriteDirectory, int fps, NPCBuilder.AnimationType type, DirectionalAnimation.DirectionType directionType = DirectionalAnimation.DirectionType.None, DirectionalAnimation.FlipType flipType = DirectionalAnimation.FlipType.None, tk2dSpriteAnimationClip.WrapMode warpmode = tk2dSpriteAnimationClip.WrapMode.Loop)
        {
            obj.AddComponent <tk2dSpriteAnimator>();
            AIAnimator aianimator = obj.GetComponent <AIAnimator>();
            bool       flag       = !aianimator;
            bool       flag2      = flag;
            bool       flag3      = flag2;

            if (flag3)
            {
                aianimator = NPCBuilder.CreateNewAIAnimator(obj);
            }
            DirectionalAnimation directionalAnimation = aianimator.GetDirectionalAnimation(name, directionType, type);
            bool flag4 = directionalAnimation == null;
            bool flag5 = flag4;
            bool flag6 = flag5;

            if (flag6)
            {
                directionalAnimation = new DirectionalAnimation
                {
                    AnimNames = new string[0],
                    Flipped   = new DirectionalAnimation.FlipType[0],
                    Type      = directionType,
                    Prefix    = string.Empty
                };
            }
            directionalAnimation.AnimNames = directionalAnimation.AnimNames.Concat(new string[]
            {
                name
            }).ToArray <string>();
            directionalAnimation.Flipped = directionalAnimation.Flipped.Concat(new DirectionalAnimation.FlipType[]
            {
                flipType
            }).ToArray <DirectionalAnimation.FlipType>();
            aianimator.AssignDirectionalAnimation(name, directionalAnimation, type);
            return(NPCBuilder.BuildAnimation(aianimator, name, spriteDirectory, fps, warpmode));
        }