SHADE_Y3/Assets/Scripts/Gameplay/Player/SC_PlayerAnimations.cs

115 lines
2.9 KiB
C#

using SHADE;
using System;
using System.Collections.Generic;
public class PlayerAnimations : Script
{
#region Raccoon
[SerializeField]
public AnimationClipAsset playerIdleClip;
[SerializeField]
public AnimationClipAsset playerWalkClip;
[SerializeField]
public AnimationClipAsset playerRunClip;
[SerializeField]
public AnimationClipAsset playerPickUpClip;
[SerializeField]
public AnimationClipAsset playerCarryIdleClip;
[SerializeField]
public AnimationClipAsset playerCarryWalkClip;
[SerializeField]
public AnimationClipAsset playerThrowClip;
[SerializeField]
public AnimationClipAsset playerJumpStartClip;
[SerializeField]
public AnimationClipAsset playerJumpLoopClip;
[SerializeField]
public AnimationClipAsset playerJumpEndClip;
#endregion
#region Animator
public Animator playerAnimator { get; private set; }
public Animator BagAnimator { get; private set; }
public Animator silhoPlayerAnimator { get; private set; }
public Animator silhoBagAnimator { get; private set; }
#endregion
#region silhouette
public GameObject silhouettePlayer;
public GameObject silhouetteBag;
#endregion
public static PlayerAnimations Instance { get; private set; }
protected override void awake()
{
if (Instance != null && Instance != this)
RemoveScript<PlayerAnimations>();
else
Instance = this;
playerAnimator = GetComponent<Animator>();
if (!playerAnimator)
Debug.LogError("Player Animator is MISSING!");
BagAnimator = GetComponentInChildren<Animator>();
if (!BagAnimator)
Debug.LogError("Bag Animator is MISSING!");
if(silhouettePlayer)
silhoPlayerAnimator = silhouettePlayer.GetComponent<Animator>();
else
Debug.LogError("Silho Player is MISSING!");
if (!silhoPlayerAnimator)
Debug.LogError("Silho Player Animator is MISSING!");
if(silhouetteBag)
silhoBagAnimator = silhouetteBag.GetComponent<Animator>();
else
Debug.LogError("Silho bag is MISSING!");
if (!silhoBagAnimator)
Debug.LogError("Silho Player Animator is MISSING!");
if(!playerIdleClip)
Debug.LogError("Idle clip is MISSING!");
if (!playerWalkClip)
Debug.LogError("run clip is MISSING!");
if (!playerPickUpClip)
Debug.LogError("Pickup clip is MISSING!");
if (!playerThrowClip)
Debug.LogError("Throw clip is MISSING!");
if (!playerJumpStartClip)
Debug.LogError("Jump start clip is MISSING!");
if (!playerJumpLoopClip)
Debug.LogError("Jump loop clip is MISSING!");
if (!playerJumpEndClip)
Debug.LogError("Jump end clip is MISSING!");
if (!playerCarryIdleClip)
Debug.LogError("Carry idle clip is MISSING!");
if (!playerCarryWalkClip)
Debug.LogError("Carry walk clip is MISSING!");
if (!playerRunClip)
Debug.LogError("Run clip is MISSING!");
}
protected override void onDestroy()
{
if (Instance == this)
Instance = null;
}
}