void Handle_FishAniStop(tk2dSpriteAnimator sprAni, tk2dSpriteAnimationClip aniClip)
 {
     if (mFish != null && mFish.Attackable)
     {
         mFish.AniSprite.PlayFrom(mOriginClip,0F);
     }
 }
 public void ClipDeleted(tk2dSpriteAnimationClip clip, int param)
 {
     clip.Clear();
     selectedClip = null;
     FilterClips();
     Repaint();
 }
 public tk2dSpriteAnimationClip(tk2dSpriteAnimationClip source)
 {
     this.name = "Default";
     this.frames = new tk2dSpriteAnimationFrame[0];
     this.fps = 30f;
     this.CopyFrom(source);
 }
 public void CopyFrom(tk2dSpriteAnimationClip source)
 {
     this.name = source.name;
     if (source.frames == null)
     {
         this.frames = null;
     }
     else
     {
         this.frames = new tk2dSpriteAnimationFrame[source.frames.Length];
         for (int i = 0; i < this.frames.Length; i++)
         {
             if (source.frames[i] == null)
             {
                 this.frames[i] = null;
             }
             else
             {
                 this.frames[i] = new tk2dSpriteAnimationFrame();
                 this.frames[i].CopyFrom(source.frames[i]);
             }
         }
     }
     this.fps = source.fps;
     this.loopStart = source.loopStart;
     this.wrapMode = source.wrapMode;
     if ((this.wrapMode == WrapMode.Single) && (this.frames.Length > 1))
     {
         this.frames = new tk2dSpriteAnimationFrame[] { this.frames[0] };
         Debug.LogError(string.Format("Clip: '{0}' Fixed up frames for WrapMode.Single", this.name));
     }
 }
 // done breathing fire, just walk again
 void FireCompleteDelegate(tk2dSpriteAnimator sprite, tk2dSpriteAnimationClip clip)
 {
     if(clip.name.Equals("Fire"))
     {
         anim.Play("Walk");
     }
 }
 void AnimationEventDelegate(tk2dAnimatedSprite sprite, tk2dSpriteAnimationClip clip, tk2dSpriteAnimationFrame frame, int frameNum)
 {
     Fsm.EventData.IntData = frame.eventInt;
     Fsm.EventData.StringData = frame.eventInfo;
     Fsm.EventData.FloatData = frame.eventFloat;
     Fsm.Event(animationTriggerEvent);
 }
    void FlameOnDelegate(tk2dSpriteAnimator animator, tk2dSpriteAnimationClip clip, int frameNumber)
    {
        if(clip.GetFrame(frameNumber).eventInfo.Equals("FlameOn"))
        {
            string fireTag = fireHitObject.tag;

            if (fireTag.Equals("Throwable"))
            {
                Vector3 position = fireHitObject.transform.position;
                position.z = charcoalParticleEffect.transform.position.z;

                // KILL THE PEASANTS
                Destroy(fireHitObject);

                // BURNINATE THE PEASANTS (particle effects)
                ParticleSystem localCharcoal = GameObject.Instantiate(charcoalParticleEffect, position, charcoalParticleEffect.transform.rotation) as ParticleSystem;
                localCharcoal.Play();
            }
            else if (fireTag.Equals("Player"))
            {
                // TODO: tell player to get bumped
            }
        }

        if(clip.GetFrame(frameNumber).eventInfo.Equals("DragonFootStep"))
        {
            AudioSource.PlayClipAtPoint(footSteps[Random.Range( 0, footSteps.Count )], transform.position);
        }
    }
    public void Play(int id)
    {
        clipId = id;
        if (id >= 0 && anim && id < anim.clips.Length)
        {
            currentClip = anim.clips[id];

            // Simply swap, no animation is played
            if (currentClip.wrapMode == tk2dSpriteAnimationClip.WrapMode.Single || currentClip.frames == null)
            {
                SwitchCollectionAndSprite(currentClip.frames[0].spriteCollection, currentClip.frames[0].spriteId);

                if (currentClip.frames[0].triggerEvent)
                {
                    if (animationEventDelegate != null)
                        animationEventDelegate( this, currentClip, currentClip.frames[0], 0 );
                }
                currentClip = null;
            }
            else
            {
                clipTime = 0.0f;
                previousFrame = -1;
            }
        }
        else
        {
            OnCompleteAnimation();
            currentClip = null;
        }
    }
        // Check the AnimOperator class for the different supported operator types.
        // This sample simply deletes the frames after the currently selected clip.
        public override bool OnFrameGroupInspectorGUI(tk2dSpriteAnimationClip selectedClip, 
					List<ClipEditor.FrameGroup> frameGroups, 
					TimelineEditor.State state )
        {
            // WrapMode.Single is a special case - you are only allowed to have one frame in a "Single" clip.
            // If you don't handle this, tk2d will truncate the list when it is Committed.
            if (selectedClip.wrapMode == tk2dSpriteAnimationClip.WrapMode.Single)
                return false;

            // Keep track of changes.
            // In a lot of cases, a simple bool will suffice. This is used later to
            // tell the system that something has changed.
            bool changed = false;
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Ins <-", EditorStyles.miniButton))
            {
                frameGroups.Insert(state.selectedFrame,
                    AnimOperatorUtil.NewFrameGroup(frameGroups, state.selectedFrame));
                // Make sure state is valid after performing your operation.
                // For instance, if the selected frame is deleted, ensure it isn't selected any more.
                state.selectedFrame++;
                changed = true;
            }
            if (GUILayout.Button("Ins ->", EditorStyles.miniButton))
            {
                frameGroups.Insert(state.selectedFrame + 1,
                    AnimOperatorUtil.NewFrameGroup(frameGroups, state.selectedFrame));
                changed = true;
            }
            GUILayout.EndHorizontal();

            // Tell the caller what has changed
            operations = changed ? AnimEditOperations.ClipContentChanged : AnimEditOperations.None;
            return changed;
        }
 void Handle_YunMuAnimating(tk2dSpriteAnimator sprite, tk2dSpriteAnimationClip clip, int frameNum)
 {
     tk2dSprite mspr  = sprite.GetComponent<tk2dSprite>( );
     Color c = mspr.color;
     c.a = mYunMuCurrentAlpha;
     mspr.color = c;
 }
Exemple #11
0
    protected override void OnAnimationClipEnd(tk2dSpriteAnimator aAnim, tk2dSpriteAnimationClip aClip) {
        if(anim == aAnim && aClip == mClips[(int)AnimState.attack]) {
            mActActive = false;
            mFireActive = false;
        }

        base.OnAnimationClipEnd(aAnim, aClip);
    }
 // This is called once the hit animation has compelted playing
 // It returns to playing whatever animation was active before hit
 // was playing.
 void HitCompleteDelegate(tk2dSpriteAnimator sprite, tk2dSpriteAnimationClip clip)
 {
     if (walking) {
         anim.Play("walk");
     }
     else {
         anim.Play("idle");
     }
 }
    protected override void Awake() {
        base.Awake();

        mIdleClip = anim.GetClipByName(idleClip);
        mAttackPrepClip = anim.GetClipByName(attackPrepClip);
        mAttackClip = anim.GetClipByName(attackClip);

        anim.AnimationCompleted += OnAnimationEnd;
    }
    void FrameDeploymentTrigger(tk2dAnimatedSprite sprite, 
		tk2dSpriteAnimationClip clip, 
		tk2dSpriteAnimationFrame frame, 
		int frameNum)
    {
        //Debug.Log("MinigunBoxController:FrameDeploymentTrigger()");

        DeployGun();
    }
Exemple #15
0
 void HandleAnimationEvent(tk2dAnimatedSprite sprite, tk2dSpriteAnimationClip clip, tk2dSpriteAnimationFrame frame, int frameNum)
 {
     // Call FrameActionHandlers
     frame.eventInfo.Split(new []{","},System.StringSplitOptions.RemoveEmptyEntries).ToList()
         .ForEach(
             (x) => {
                 frameActions[x](x,frame.eventFloat,frame.eventInt);
             }
         );
 }
    void Awake()
    {
        FishEx_FishEatter fe = GetComponent<FishEx_FishEatter>();
        mFish = fe._Fish;
        mFish.AniSprite.AnimationCompleted += Handle_FishAniStop;
        if (fe != null)
            fe.EvtBeforeEatFish += Handle_BeforeEatFish;

        mOriginClip = mFish.AniSprite.DefaultClip;
    }
 void Awake()
 {
     mAnispr = GetComponent<tk2dSpriteAnimator>();
     if (mAnispr == null)
         return;
     mOriClip = mAnispr.DefaultClip;
     //mOriClipidx = mAnispr.DefaultClipId;
     tk2dSpriteAnimationClip aniClip = mAnispr.Library.clips[mAnispr.Library.GetClipIdByName(AniName)];
     mSpecAniLength = aniClip.frames.Length / aniClip.fps;
 }
        public void Draw(int windowWidth, tk2dSpriteAnimationClip clip, List<ClipEditor.FrameGroup> frameGroups, float clipTimeMarker)
        {
            int space = clipLeftHeaderSpace;

            int requiredWidth = space + (clip.frames.Length + 1) * frameWidth;
            int clipHeightTotal = (requiredWidth > windowWidth) ? clipHeightScrollBar : clipHeight;

            clipScrollbar = GUILayout.BeginScrollView(clipScrollbar, GUILayout.Height(clipHeightTotal), GUILayout.ExpandWidth(true));
            GUILayout.BeginVertical();

            // Draw timeline axis
            GUILayout.Box("", EditorStyles.toolbar, GUILayout.ExpandWidth(true));
            Rect timelineRect = GUILayoutUtility.GetLastRect();
            DrawAxis(clip, new Rect(timelineRect.x + space, timelineRect.y, timelineRect.width - space, timelineRect.height), frameWidth);

            // Draw background and derive trigger rect
            GUILayout.Box("", tk2dEditorSkin.Anim_BG, GUILayout.ExpandWidth(true), GUILayout.Height(16));
            Rect triggerRect = GUILayoutUtility.GetLastRect();

            // Trigger helpbox
            Rect triggerHelpBox = new Rect(triggerRect.x, triggerRect.y, triggerRect.height, triggerRect.height);
            if (GUIUtility.hotControl == 0 && triggerHelpBox.Contains(Event.current.mousePosition))
                GUI.Label(new Rect(triggerHelpBox.x, triggerHelpBox.y, 150, triggerHelpBox.height), "Double click to add triggers", EditorStyles.whiteMiniLabel);
            else
                GUI.Label(triggerHelpBox, "?", EditorStyles.whiteMiniLabel);

            // Control IDs
            int triggerControlId = "tk2d.DrawClip.Triggers".GetHashCode();
            int frameGroupControlId = "tk2d.DrawClip.FrameGroups".GetHashCode();

            // Draw triggers
            DrawTriggers(triggerControlId, triggerRect, clip);

            // Draw frames
            GUILayout.BeginHorizontal();

            int framesWidth = clipLeftHeaderSpace + (clip.frames.Length + 1) * frameWidth;
            Rect frameGroupRect = GUILayoutUtility.GetRect(framesWidth, 1, GUILayout.ExpandHeight(true));
            DrawFrameGroups(frameGroupControlId, frameGroupRect, clip, frameGroups, clipTimeMarker);

            GUILayout.EndHorizontal();
            GUILayout.EndVertical();

            if (Event.current.type == EventType.ScrollWheel && (Event.current.alt || Event.current.control))
            {
                frameWidth =  Mathf.Clamp((int)(Event.current.delta.y + frameWidth), minFrameWidth, maxFrameWidth);
                Repaint();
            }

            GUILayout.EndScrollView();

            Rect scrollRect = GUILayoutUtility.GetLastRect();
            DrawFrameGroupsOverlay(frameGroupControlId, new Rect(scrollRect.x + frameGroupRect.x, scrollRect.y + frameGroupRect.y, frameGroupRect.width, frameGroupRect.height), clip, frameGroups, clipTimeMarker);
        }
 public int GetClipIdByName(tk2dSpriteAnimationClip clip)
 {
     for (int i = 0; i < this.clips.Length; i++)
     {
         if (this.clips[i] == clip)
         {
             return i;
         }
     }
     return -1;
 }
Exemple #20
0
    void ThrowCompleteDelegate(tk2dSpriteAnimator sprite, tk2dSpriteAnimationClip clip)
	{
        _state = EnemyStateEnum.Walking;
		if (_state == EnemyStateEnum.Walking)
		{
			anim.Play("EnemyWalk");
		}
		else if(_state == EnemyStateEnum.Hited)
		{
			anim.Play("EnemyHited");
		}
	}
Exemple #21
0
 float CalculateClipMoveSpeed(tk2dSpriteAnimationClip clip)
 {
     int moveSum = 0;
     int numFrames = 0;
     foreach(var frame in clip.frames){
         numFrames++;
         if(frame.eventInfo.Contains("move")){
             moveSum += frame.eventInt;
         }
     }
     return moveSum/numFrames * clip.fps;
 }
Exemple #22
0
 void HitCompleteDelegate(tk2dSpriteAnimator sprite, tk2dSpriteAnimationClip clip)
 {
     _state = EnemyStateEnum.Walking;
     if (_state == EnemyStateEnum.Walking)
     {
         anim.Play("EnemyWalk");
     }
     else if (_state == EnemyStateEnum.ThrowWeapon)
     {
         anim.Play("ThrowWeapon");
     }
 }
		void AnimationCompleteDelegate (tk2dSpriteAnimator sprite, tk2dSpriteAnimationClip clip)
		{ 
			int clipId = -1;
			tk2dSpriteAnimationClip[] clips = (sprite.Library != null) ? sprite.Library.clips : null;
			if (clips != null) {
				for (int i = 0; i < clips.Length; ++i) {
					if (clips[i] == clip) {
						clipId = i;
						break;
					}
				}
			}

			Fsm.EventData.IntData = clipId;
			Fsm.Event (animationCompleteEvent);      
		}
Exemple #24
0
    protected override void Awake() {
        base.Awake();

        foreach(BarrelDat barrel in barrels)
            barrel.Init(turretAnim);

        turretAnim.AnimationCompleted = OnTurretAnimEnd;

        mIdleClip = baseAnim.GetClipByName(idle);
        mFireClip = baseAnim.GetClipByName(fire);
        mFiringClip = baseAnim.GetClipByName(firing);

        baseAnim.AnimationCompleted = OnBaseAnimEnd;

        mCurTurret = startTurret;
    }
Exemple #25
0
 private void AnimationCompleted(tk2dSpriteAnimator anim, tk2dSpriteAnimationClip clip)
 {
     if (stackMoves.Count == 0)
     {
         if (clip.name != "ShamanStay")
         {
             _isPlaying = false;
             Anim.Play("ShamanStay");
         }
     }
     else
     {
         _isPlaying = true;
         Anim.Play(stackMoves[0]);
         stackMoves.RemoveAt(0);
     }
 }
        public ClipData(PlatformerSpriteController ctrl, tk2dSpriteAnimation lib) {
            idle = lib.GetClipByName(ctrl.idleClip);

            move = lib.GetClipByName(ctrl.moveClip);

            ups = new tk2dSpriteAnimationClip[ctrl.upClips.Length];
            for(int i = 0, len = ctrl.upClips.Length; i < len; i++)
                ups[i] = lib.GetClipByName(ctrl.upClips[i]);

            downs = new tk2dSpriteAnimationClip[ctrl.downClips.Length];
            for(int i = 0, len = ctrl.downClips.Length; i < len; i++)
                downs[i] = lib.GetClipByName(ctrl.downClips[i]);

            wallStick = lib.GetClipByName(ctrl.wallStickClip);
            wallJump = lib.GetClipByName(ctrl.wallJumpClip);

            slide = lib.GetClipByName(ctrl.slideClip);
            //climb = lib.GetClipByName(ctrl.climbClip);
        }
 public void ClipSelectionChanged(tk2dSpriteAnimationClip clip, int direction)
 {
     int selectedId = -1;
     for (int i = 0; i < filteredClips.Count; ++i)
     {
         if (filteredClips[i] == clip)
         {
             selectedId = i;
             break;
         }
     }
     if (selectedId != -1)
     {
         int newSelectedId = selectedId + direction;
         if (newSelectedId >= 0 && newSelectedId < filteredClips.Count)
         {
             selectedClip = filteredClips[newSelectedId];
         }
     }
     Repaint();
 }
 /// <summary>
 /// Play the clip specified by identifier.
 /// Will restart the clip at clipStartTime if called while the clip is playing.
 /// </summary>
 /// <param name='clip'>The clip to play. </param>
 /// <param name='clipStartTime'> Clip start time in seconds. A value of DefaultFps will start the clip from the beginning </param>
 public void Play(tk2dSpriteAnimationClip clip, float clipStartTime)
 {
     Play(clip, clipStartTime, DefaultFps);
 }
        // Token: 0x06000192 RID: 402 RVA: 0x0000CD0C File Offset: 0x0000AF0C
        public static void Add()
        {
            Gun gun = ETGMod.Databases.Items.NewGun("Bubbler", "bubbler");

            Game.Items.Rename("outdated_gun_mods:bubbler", "bb:bubbler");
            gun.gameObject.AddComponent <Bubbler>();
            GunExt.SetShortDescription(gun, "A Bleaker Blaster");
            GunExt.SetLongDescription(gun, "A strange gun that seems to pulse at a steady rate. As you hold the gun, the pulse finds its way into your every move...\n\nLet's dance.");
            GunExt.SetupSprite(gun, null, "bubbler_idle_001", 10);
            tk2dSpriteAnimationClip fireClip = gun.sprite.spriteAnimator.GetClipByName("bubbler_fire");

            fireClip.wrapMode  = tk2dSpriteAnimationClip.WrapMode.LoopSection;
            fireClip.loopStart = 1;
            GunExt.SetAnimationFPS(gun, gun.reloadAnimation, 10);
            GunExt.SetAnimationFPS(gun, gun.shootAnimation, 10);
            GunExt.SetAnimationFPS(gun, gun.idleAnimation, 10);
            GunExt.AddProjectileModuleFrom(gun, PickupObjectDatabase.GetById(36) as Gun, true, false);
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Automatic;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 2f;
            gun.DefaultModule.cooldownTime        = 0.125f;
            gun.DefaultModule.numberOfShotsInClip = 16;
            gun.barrelOffset.position            += new Vector3(0.8f, 0f, 0f);
            gun.SetBaseMaxAmmo(500);
            gun.InfiniteAmmo = true;
            gun.quality      = PickupObject.ItemQuality.SPECIAL;
            gun.encounterTrackable.EncounterGuid = "627562626c65";
            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage       = 4f;
            projectile.transform.parent      = gun.barrelOffset;
            Projectile bubbleProjectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.projectiles[0]);

            bubbleProjectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(bubbleProjectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(bubbleProjectile);
            bubbleProjectile.transform.parent = gun.barrelOffset;
            bubbleProjectile.SetProjectileSpriteRight("bubbler_projectile", 16, 16);
            bubbleProjectile.baseData.speed  *= 0.5f;
            bubbleProjectile.baseData.damage *= 3f;
            gun.DefaultModule.usesOptionalFinalProjectile = true;
            gun.DefaultModule.numberOfFinalProjectiles    = 1;
            gun.DefaultModule.finalProjectile             = bubbleProjectile;
            gun.DefaultModule.finalAmmoType       = ((Gun)ETGMod.Databases.Items[599]).DefaultModule.ammoType;
            gun.DefaultModule.finalCustomAmmoType = ((Gun)ETGMod.Databases.Items[599]).DefaultModule.customAmmoType;
            ETGMod.Databases.Items.Add(gun, null, "ANY");
            Bubbler.goopDefs = new List <GoopDefinition>();
            AssetBundle assetBundle = ResourceManager.LoadAssetBundle("shared_auto_001");

            foreach (string text in Bubbler.goops)
            {
                GoopDefinition goopDefinition;
                try
                {
                    GameObject gameObject2 = assetBundle.LoadAsset(text) as GameObject;
                    goopDefinition = gameObject2.GetComponent <GoopDefinition>();
                }
                catch
                {
                    goopDefinition = (assetBundle.LoadAsset(text) as GoopDefinition);
                }
                goopDefinition.name = text.Replace("assets/data/goops/", "").Replace(".asset", "");
                Bubbler.goopDefs.Add(goopDefinition);
            }
        }
 private void TransitionToDoorClose(tk2dSpriteAnimator animator, tk2dSpriteAnimationClip clip)
 {
     GameManager.Instance.MainCameraController.DoScreenShake(doorCloseShake, null, false);
     animator.Play(elevatorCloseAnimName);
     animator.AnimationCompleted = (Action <tk2dSpriteAnimator, tk2dSpriteAnimationClip>)Delegate.Combine(animator.AnimationCompleted, new Action <tk2dSpriteAnimator, tk2dSpriteAnimationClip>(TransitionToDepart));
 }
Exemple #31
0
 public void Stop()
 {
     currentClip = null;
 }
    void AnimationEventHandler(tk2dSpriteAnimator animator, tk2dSpriteAnimationClip clip, int frameNum)
    {
        string str = animator.name + "\n" + clip.name + "\n" + "INFO: " + clip.GetFrame(frameNum).eventInfo;

        StartCoroutine(PopupText(str));
    }
Exemple #33
0
 /// <summary>
 /// Copy constructor
 /// </summary>
 public tk2dSpriteAnimationClip(tk2dSpriteAnimationClip source)
 {
     CopyFrom(source);
 }
 public void CopyFrom(tk2dSpriteAnimationClip source)
 {
     name = source.name;
     if (source.frames == null)
     {
         frames = null;
     }
     else
     {
         frames = new tk2dSpriteAnimationFrame[source.frames.Length];
         for (int i = 0; i < frames.Length; ++i)
         {
             if (source.frames[i] == null)
             {
                 frames[i] = null;
             }
             else
             {
                 frames[i] = new tk2dSpriteAnimationFrame();
                 frames[i].CopyFrom(source.frames[i]);
             }
         }
     }
     fps = source.fps;
     loopStart = source.loopStart;
     wrapMode = source.wrapMode;
     if (wrapMode == tk2dSpriteAnimationClip.WrapMode.Single && frames.Length > 1)
     {
         frames = new tk2dSpriteAnimationFrame[] { frames[0] };
         Debug.LogError(string.Format("Clip: '{0}' Fixed up frames for WrapMode.Single", name));
     }
 }
 /// <summary>
 /// Is this clip currently active & playing?
 /// </summary>
 public bool IsPlaying(tk2dSpriteAnimationClip clip)
 {
     return(CurrentClip != null && CurrentClip == clip && Playing);
 }
        private void TransitionToDepart(tk2dSpriteAnimator animator, tk2dSpriteAnimationClip clip)
        {
            if (!m_depatureIsPlayerless)
            {
                if (OverrideTargetFloor == GlobalDungeonData.ValidTilesets.PHOBOSGEON)
                {
                    Pixelator.Instance.RegisterAdditionalRenderPass(ChaosShaders.GlitchScreenShader);
                }
            }

            GameManager.Instance.MainCameraController.DoDelayedScreenShake(departureShake, 0.25f, null);
            if (!m_depatureIsPlayerless)
            {
                for (int i = 0; i < GameManager.Instance.AllPlayers.Length; i++)
                {
                    GameManager.Instance.AllPlayers[i].PrepareForSceneTransition();
                }
                // float delay = 0.5f;
                float delay = 0.7f;
                Pixelator.Instance.FadeToBlack(delay, false, 0f);
                GameUIRoot.Instance.HideCoreUI(string.Empty);
                GameUIRoot.Instance.ToggleLowerPanels(false, false, string.Empty);
                if (GameManager.Instance.CurrentGameMode == GameManager.GameMode.SUPERBOSSRUSH)
                {
                    GameManager.Instance.DelayedLoadBossrushFloor(delay);
                }
                else if (GameManager.Instance.CurrentGameMode == GameManager.GameMode.BOSSRUSH)
                {
                    GameManager.Instance.DelayedLoadBossrushFloor(delay);
                }
                else
                {
                    if (!GameManager.Instance.IsFoyer && GameManager.Instance.CurrentLevelOverrideState == GameManager.LevelOverrideState.NONE)
                    {
                        GlobalDungeonData.ValidTilesets nextTileset = GameManager.Instance.GetNextTileset(GameManager.Instance.Dungeon.tileIndices.tilesetId);
                        GameManager.DoMidgameSave(nextTileset);
                    }
                    if (UsesOverrideTargetFloor)
                    {
                        GlobalDungeonData.ValidTilesets overrideTargetFloor = OverrideTargetFloor;
                        if (overrideTargetFloor == GlobalDungeonData.ValidTilesets.CATACOMBGEON)
                        {
                            GameManager.Instance.DelayedLoadCustomLevel(delay, "tt_catacombs");
                        }
                        else if (overrideTargetFloor == GlobalDungeonData.ValidTilesets.FORGEGEON)
                        {
                            GameManager.Instance.DelayedLoadCustomLevel(delay, "tt_forge");
                        }
                        else if (overrideTargetFloor == GlobalDungeonData.ValidTilesets.OFFICEGEON)
                        {
                            ChaosConsole.elevatorHasBeenUsed = true;
                            if (BraveUtility.RandomBool())
                            {
                                string[] flowPath = new string[] { "custom_glitchchest_flow", "custom_glitchchestalt_flow", "custom_glitch_flow" };
                                ChaosUtility.PrepareGlitchFlow(BraveUtility.RandomElement(flowPath));
                                GameManager.Instance.DelayedLoadNextLevel(delay);
                            }
                            else
                            {
                                string[] flows = new string[] { "custom_glitchchest_flow", "custom_glitchchestalt_flow" };
                                GameManager.Instance.StartCoroutine(ChaosUtility.DelayedGlitchLevelLoad(delay, BraveUtility.RandomElement(flows), useNakatomiTileset: BraveUtility.RandomBool()));
                            }
                        }
                        else if (overrideTargetFloor == GlobalDungeonData.ValidTilesets.PHOBOSGEON)
                        {
                            ChaosUtility.RatDungeon = DungeonDatabase.GetOrLoadByName("Base_ResourcefulRat");
                            ChaosUtility.RatDungeon.LevelOverrideType = GameManager.LevelOverrideState.NONE;
                            // ChaosUtility.RatDungeon.tileIndices.tilesetId = GlobalDungeonData.ValidTilesets.PHOBOSGEON;
                            // ChaosUtility.RatDungeon.tileIndices.tilesetId = GlobalDungeonData.ValidTilesets.JUNGLEGEON;
                            ChaosPrefabs.InitCanyonTileSet(ChaosUtility.RatDungeon, GlobalDungeonData.ValidTilesets.PHOBOSGEON);
                            GameManager.Instance.StartCoroutine(ChaosUtility.DelayedGlitchLevelLoad(delay, "SecretGlitchFloor_Flow", true));
                        }
                        else
                        {
                            GameManager.Instance.DelayedLoadNextLevel(delay);
                        }
                    }
                    else
                    {
                        GameManager.Instance.DelayedLoadNextLevel(delay);
                    }
                    AkSoundEngine.PostEvent("Stop_MUS_All", gameObject);
                }
            }
            elevatorFloor.SetActive(false);
            animator.AnimationCompleted = (Action <tk2dSpriteAnimator, tk2dSpriteAnimationClip>)Delegate.Remove(animator.AnimationCompleted, new Action <tk2dSpriteAnimator, tk2dSpriteAnimationClip>(TransitionToDepart));
            animator.PlayAndDisableObject(elevatorDepartAnimName, null);
        }
 /// <summary>
 /// Copy constructor
 /// </summary>
 public tk2dSpriteAnimationClip(tk2dSpriteAnimationClip source)
 {
     CopyFrom( source );
 }
Exemple #38
0
        public static void Add()
        {
            // Get yourself a new gun "base" first.
            // Let's just call it "Basic Gun", and use "jpxfrd" for all sprites and as "codename" All sprites must begin with the same word as the codename. For example, your firing sprite would be named "jpxfrd_fire_001".
            Gun gun = ETGMod.Databases.Items.NewGun("TaurenTails", "tt");

            // "kp:basic_gun determines how you spawn in your gun through the console. You can change this command to whatever you want, as long as it follows the "name:itemname" template.
            Game.Items.Rename("outdated_gun_mods:taurentails", "ski:taurentails");
            gun.gameObject.AddComponent <TaurenTails>();
            //These two lines determines the description of your gun, ".SetShortDescription" being the description that appears when you pick up the gun and ".SetLongDescription" being the description in the Ammonomicon entry.
            gun.SetShortDescription("Full Charge");
            gun.SetLongDescription("A strange variation of the timeless sling. This varient was forged from the tail of a taurous and has three slots for ammo and can fire up to two at a time. \n" +
                                   "\n- Knife_to_a_Gunfight");
            gun.SetupSprite(null, "tt_idle_001", 4);
            gun.SetAnimationFPS(gun.shootAnimation, 8);
            gun.SetAnimationFPS(gun.reloadAnimation, 24);
            gun.SetAnimationFPS(gun.chargeAnimation, 12);

            gun.AddProjectileModuleFrom((PickupObjectDatabase.GetByEncounterName("Sling") as Gun), true, true);
            Gun gun2 = (PickupObjectDatabase.GetByEncounterName("Sling") as Gun);

            gun.muzzleFlashEffects          = gun2.muzzleFlashEffects;
            gun.DefaultModule.ammoCost      = 1;
            gun.DefaultModule.angleVariance = 0;
            gun.gunClass      = GunClass.SILLY;
            gun.gunHandedness = GunHandedness.OneHanded;

            gun.DefaultModule.shootStyle    = ProjectileModule.ShootStyle.Charged;
            gun.DefaultModule.sequenceStyle = ProjectileModule.ProjectileSequenceStyle.Random;
            gun.reloadTime = 2f;

            gun.DefaultModule.cooldownTime        = 1f;
            gun.DefaultModule.numberOfShotsInClip = 3;
            gun.SetBaseMaxAmmo(900);

            gun.quality = PickupObject.ItemQuality.B;



            Projectile projectile = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.chargeProjectiles[0].Projectile);

            projectile.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile);
            gun.DefaultModule.projectiles[0] = projectile;
            projectile.baseData.damage       = 15f;
            projectile.baseData.speed       *= 1f;
            projectile.BossDamageMultiplier  = 1.2f;

            projectile.transform.parent = gun.barrelOffset;
            PierceProjModifier stab = projectile.gameObject.GetOrAddComponent <PierceProjModifier>();

            stab.penetration = 1;


            Projectile projectile2 = UnityEngine.Object.Instantiate <Projectile>(gun.DefaultModule.chargeProjectiles[0].Projectile);

            projectile2.gameObject.SetActive(false);
            FakePrefab.MarkAsFakePrefab(projectile2.gameObject);
            UnityEngine.Object.DontDestroyOnLoad(projectile2);
            gun.DefaultModule.projectiles[0] = projectile2;
            projectile2.baseData.damage      = 16f;
            projectile2.baseData.speed      *= 1f;
            projectile2.BossDamageMultiplier = 2.5f;


            projectile2.transform.parent = gun.barrelOffset;
            PierceProjModifier stab2 = projectile2.gameObject.GetOrAddComponent <PierceProjModifier>();

            stab2.penetration = 1;

            tk2dSpriteAnimationClip fireClip = gun.sprite.spriteAnimator.GetClipByName("tt_idle");

            float[] offsetsX = new float[] { -0f, -.05f, -.1f, -.05f, 0.0f, .05f, .1f, .05f };
            float[] offsetsY = new float[] { .1f, .1f, .1f, .1f, .1f, .1f, .1f, .1f };
            for (int i = 0; i < offsetsX.Length && i < offsetsY.Length && i < fireClip.frames.Length; i++)
            {
                int id = fireClip.frames[i].spriteId;
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position0.x += offsetsX[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position0.y += offsetsY[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position1.x += offsetsX[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position1.y += offsetsY[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position2.x += offsetsX[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position2.y += offsetsY[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position3.x += offsetsX[i];
                fireClip.frames[i].spriteCollection.spriteDefinitions[id].position3.y += offsetsY[i];
            }

            tk2dSpriteAnimationClip fireClip2 = gun.sprite.spriteAnimator.GetClipByName("tt_charge");

            float[] offsetsX2 = new float[] { -.2f, -.2f };
            float[] offsetsY2 = new float[] { .2f, .2f };
            for (int i = 0; i < offsetsX2.Length && i < offsetsY2.Length && i < fireClip2.frames.Length; i++)
            {
                int id = fireClip2.frames[i].spriteId;
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position0.x += offsetsX2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position0.y += offsetsY2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position1.x += offsetsX2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position1.y += offsetsY2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position2.x += offsetsX2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position2.y += offsetsY2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position3.x += offsetsX2[i];
                fireClip2.frames[i].spriteCollection.spriteDefinitions[id].position3.y += offsetsY2[i];
            }



            ProjectileModule.ChargeProjectile item = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile,
                ChargeTime = .75f
            };
            ProjectileModule.ChargeProjectile item2 = new ProjectileModule.ChargeProjectile
            {
                Projectile = projectile2,

                ChargeTime = 1.7f
            };

            gun.DefaultModule.chargeProjectiles = new List <ProjectileModule.ChargeProjectile>
            {
                item,
                item2,
            };
            gun.PreventNormalFireAudio = true;

            ETGMod.Databases.Items.Add(gun, null, "ANY");
        }
 /// <summary>
 /// Gets a clip id from a clip
 /// </summary>
 /// <returns> Unique clip id, -1 if not found in the animation collection </returns>
 public int GetClipIdByName(tk2dSpriteAnimationClip clip)
 {
     for (int i = 0; i < clips.Length; ++i)
         if (clips[i] == clip) return i;
     return -1;
 }
        public static void SetupHatSprites(List <string> spritePaths, GameObject hatObj, int fps, Vector2 hatSize)
        {
            Hat hatness = hatObj.GetComponent <Hat>();

            if (hatness)
            {
                string collectionName = hatness.hatName;
                collectionName = collectionName.Replace(" ", "_");
                tk2dSpriteCollectionData HatSpriteCollection = SpriteBuilder.ConstructCollection(hatObj, (collectionName + "_Collection"));

                int        spriteID      = SpriteBuilder.AddSpriteToCollection(spritePaths[0], HatSpriteCollection);
                tk2dSprite hatBaseSprite = hatObj.GetOrAddComponent <tk2dSprite>();
                hatBaseSprite.SetSprite(HatSpriteCollection, spriteID);
                tk2dSpriteDefinition def = hatBaseSprite.GetCurrentSpriteDef();
                def.colliderVertices = new Vector3[] {
                    new Vector3(0f, 0f, 0f),
                    new Vector3((hatSize.x / 16), (hatSize.y / 16), 0f)
                };
                hatBaseSprite.PlaceAtPositionByAnchor(hatObj.transform.position, tk2dBaseSprite.Anchor.LowerCenter);
                hatBaseSprite.depthUsesTrimmedBounds = true;
                hatBaseSprite.IsPerpendicular        = true;
                hatBaseSprite.UpdateZDepth();
                hatBaseSprite.HeightOffGround = 0.2f;

                List <string> SouthAnimation     = new List <string>();
                List <string> NorthAnimation     = new List <string>();
                List <string> EastAnimation      = new List <string>();
                List <string> WestAnimation      = new List <string>();
                List <string> NorthWestAnimation = new List <string>();
                List <string> NorthEastAnimation = new List <string>();
                List <string> SouthEastAnimation = new List <string>();
                List <string> SouthWestAnimation = new List <string>();

                switch (hatness.hatDirectionality)
                {
                case Hat.HatDirectionality.EIGHTWAY:
                    foreach (string path in spritePaths)
                    {
                        if (path.ToLower().Contains("_north_"))
                        {
                            NorthAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_south_"))
                        {
                            SouthAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_west_"))
                        {
                            WestAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_east_"))
                        {
                            EastAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_northwest_"))
                        {
                            NorthWestAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_northeast_"))
                        {
                            NorthEastAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_southwest_"))
                        {
                            SouthWestAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_southeast_"))
                        {
                            SouthEastAnimation.Add(path);
                        }
                    }
                    break;

                case Hat.HatDirectionality.SIXWAY:
                    foreach (string path in spritePaths)
                    {
                        if (path.ToLower().Contains("_north_"))
                        {
                            NorthAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_south_"))
                        {
                            SouthAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_west_"))
                        {
                            WestAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_east_"))
                        {
                            EastAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_northwest_"))
                        {
                            NorthWestAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_northeast_"))
                        {
                            NorthEastAnimation.Add(path);
                        }
                    }
                    break;

                case Hat.HatDirectionality.FOURWAY:
                    foreach (string path in spritePaths)
                    {
                        if (path.ToLower().Contains("_west_"))
                        {
                            WestAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_east_"))
                        {
                            EastAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_north_"))
                        {
                            NorthAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_south_"))
                        {
                            SouthAnimation.Add(path);
                        }
                    }
                    break;

                case Hat.HatDirectionality.TWOWAYHORIZONTAL:
                    foreach (string path in spritePaths)
                    {
                        if (path.ToLower().Contains("_west_"))
                        {
                            WestAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_east_"))
                        {
                            EastAnimation.Add(path);
                        }
                    }
                    break;

                case Hat.HatDirectionality.TWOWAYVERTICAL:
                    foreach (string path in spritePaths)
                    {
                        if (path.ToLower().Contains("_north_"))
                        {
                            NorthAnimation.Add(path);
                        }
                        if (path.ToLower().Contains("_south_"))
                        {
                            SouthAnimation.Add(path);
                        }
                    }
                    break;

                case Hat.HatDirectionality.NONE:
                    foreach (string path in spritePaths)
                    {
                        if (path.ToLower().Contains("_south_"))
                        {
                            SouthAnimation.Add(path);
                        }
                    }
                    break;
                }

                //SET UP THE ANIMATOR AND THE ANIMATION
                tk2dSpriteAnimator  animator  = hatObj.GetOrAddComponent <tk2dSpriteAnimator>();
                tk2dSpriteAnimation animation = hatObj.GetOrAddComponent <tk2dSpriteAnimation>();
                animation.clips  = new tk2dSpriteAnimationClip[0];
                animator.Library = animation;

                //SOUTH ANIMATION
                if (SouthAnimation != null)
                {
                    tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip()
                    {
                        name = "hat_south", frames = new tk2dSpriteAnimationFrame[0], fps = fps
                    };

                    List <tk2dSpriteAnimationFrame> frames = new List <tk2dSpriteAnimationFrame>();
                    foreach (string path in SouthAnimation)
                    {
                        tk2dSpriteCollectionData collection = HatSpriteCollection;
                        int frameSpriteId             = SpriteBuilder.AddSpriteToCollection(path, collection);
                        tk2dSpriteDefinition frameDef = collection.spriteDefinitions[frameSpriteId];
                        frameDef.colliderVertices = def.colliderVertices;
                        frameDef.ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter);
                        frames.Add(new tk2dSpriteAnimationFrame {
                            spriteId = frameSpriteId, spriteCollection = collection
                        });
                    }
                    clip.frames     = frames.ToArray();
                    animation.clips = animation.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
                }
                //NORTH ANIMATIONS
                if (NorthAnimation != null)
                {
                    tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip()
                    {
                        name = "hat_north", frames = new tk2dSpriteAnimationFrame[0], fps = fps
                    };

                    List <tk2dSpriteAnimationFrame> frames = new List <tk2dSpriteAnimationFrame>();
                    foreach (string path in NorthAnimation)
                    {
                        tk2dSpriteCollectionData collection = HatSpriteCollection;
                        int frameSpriteId             = SpriteBuilder.AddSpriteToCollection(path, collection);
                        tk2dSpriteDefinition frameDef = collection.spriteDefinitions[frameSpriteId];
                        frameDef.colliderVertices = def.colliderVertices;
                        frameDef.ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter);
                        frames.Add(new tk2dSpriteAnimationFrame {
                            spriteId = frameSpriteId, spriteCollection = collection
                        });
                    }
                    clip.frames     = frames.ToArray();
                    animation.clips = animation.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
                }
                //WEST ANIMATIONS
                if (WestAnimation != null)
                {
                    tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip()
                    {
                        name = "hat_west", frames = new tk2dSpriteAnimationFrame[0], fps = fps
                    };

                    List <tk2dSpriteAnimationFrame> frames = new List <tk2dSpriteAnimationFrame>();
                    foreach (string path in WestAnimation)
                    {
                        tk2dSpriteCollectionData collection = HatSpriteCollection;
                        int frameSpriteId             = SpriteBuilder.AddSpriteToCollection(path, collection);
                        tk2dSpriteDefinition frameDef = collection.spriteDefinitions[frameSpriteId];
                        frameDef.colliderVertices = def.colliderVertices;
                        frameDef.ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter);
                        frames.Add(new tk2dSpriteAnimationFrame {
                            spriteId = frameSpriteId, spriteCollection = collection
                        });
                    }
                    clip.frames     = frames.ToArray();
                    animation.clips = animation.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
                }
                //EAST ANIMATIONS
                if (EastAnimation != null)
                {
                    tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip()
                    {
                        name = "hat_east", frames = new tk2dSpriteAnimationFrame[0], fps = fps
                    };

                    List <tk2dSpriteAnimationFrame> frames = new List <tk2dSpriteAnimationFrame>();
                    foreach (string path in EastAnimation)
                    {
                        tk2dSpriteCollectionData collection = HatSpriteCollection;
                        int frameSpriteId             = SpriteBuilder.AddSpriteToCollection(path, collection);
                        tk2dSpriteDefinition frameDef = collection.spriteDefinitions[frameSpriteId];
                        frameDef.colliderVertices = def.colliderVertices;
                        frameDef.ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter);
                        frames.Add(new tk2dSpriteAnimationFrame {
                            spriteId = frameSpriteId, spriteCollection = collection
                        });
                    }
                    clip.frames     = frames.ToArray();
                    animation.clips = animation.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
                }
                //NORTHEAST
                if (NorthEastAnimation != null)
                {
                    tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip()
                    {
                        name = "hat_northeast", frames = new tk2dSpriteAnimationFrame[0], fps = fps
                    };

                    List <tk2dSpriteAnimationFrame> frames = new List <tk2dSpriteAnimationFrame>();
                    foreach (string path in NorthEastAnimation)
                    {
                        tk2dSpriteCollectionData collection = HatSpriteCollection;
                        int frameSpriteId             = SpriteBuilder.AddSpriteToCollection(path, collection);
                        tk2dSpriteDefinition frameDef = collection.spriteDefinitions[frameSpriteId];
                        frameDef.colliderVertices = def.colliderVertices;
                        frameDef.ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter);
                        frames.Add(new tk2dSpriteAnimationFrame {
                            spriteId = frameSpriteId, spriteCollection = collection
                        });
                    }
                    clip.frames     = frames.ToArray();
                    animation.clips = animation.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
                }
                //NORTHWEST ANIMATION
                if (NorthWestAnimation != null)
                {
                    tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip()
                    {
                        name = "hat_northwest", frames = new tk2dSpriteAnimationFrame[0], fps = fps
                    };

                    List <tk2dSpriteAnimationFrame> frames = new List <tk2dSpriteAnimationFrame>();
                    foreach (string path in NorthWestAnimation)
                    {
                        tk2dSpriteCollectionData collection = HatSpriteCollection;
                        int frameSpriteId             = SpriteBuilder.AddSpriteToCollection(path, collection);
                        tk2dSpriteDefinition frameDef = collection.spriteDefinitions[frameSpriteId];
                        frameDef.colliderVertices = def.colliderVertices;
                        frameDef.ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter);
                        frames.Add(new tk2dSpriteAnimationFrame {
                            spriteId = frameSpriteId, spriteCollection = collection
                        });
                    }
                    clip.frames     = frames.ToArray();
                    animation.clips = animation.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
                }
                //SOUTHWEST ANIMATION
                if (SouthWestAnimation != null)
                {
                    tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip()
                    {
                        name = "hat_southwest", frames = new tk2dSpriteAnimationFrame[0], fps = fps
                    };

                    List <tk2dSpriteAnimationFrame> frames = new List <tk2dSpriteAnimationFrame>();
                    foreach (string path in SouthWestAnimation)
                    {
                        tk2dSpriteCollectionData collection = HatSpriteCollection;
                        int frameSpriteId             = SpriteBuilder.AddSpriteToCollection(path, collection);
                        tk2dSpriteDefinition frameDef = collection.spriteDefinitions[frameSpriteId];
                        frameDef.colliderVertices = def.colliderVertices;
                        frameDef.ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter);
                        frames.Add(new tk2dSpriteAnimationFrame {
                            spriteId = frameSpriteId, spriteCollection = collection
                        });
                    }
                    clip.frames     = frames.ToArray();
                    animation.clips = animation.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
                }
                //SOUTHEAST ANIMATION
                if (SouthEastAnimation != null)
                {
                    tk2dSpriteAnimationClip clip = new tk2dSpriteAnimationClip()
                    {
                        name = "hat_southeast", frames = new tk2dSpriteAnimationFrame[0], fps = fps
                    };

                    List <tk2dSpriteAnimationFrame> frames = new List <tk2dSpriteAnimationFrame>();
                    foreach (string path in SouthEastAnimation)
                    {
                        tk2dSpriteCollectionData collection = HatSpriteCollection;
                        int frameSpriteId             = SpriteBuilder.AddSpriteToCollection(path, collection);
                        tk2dSpriteDefinition frameDef = collection.spriteDefinitions[frameSpriteId];
                        frameDef.colliderVertices = def.colliderVertices;
                        frameDef.ConstructOffsetsFromAnchor(tk2dBaseSprite.Anchor.LowerCenter);
                        frames.Add(new tk2dSpriteAnimationFrame {
                            spriteId = frameSpriteId, spriteCollection = collection
                        });
                    }
                    clip.frames     = frames.ToArray();
                    animation.clips = animation.clips.Concat(new tk2dSpriteAnimationClip[] { clip }).ToArray();
                }
            }
        }