2023-03-10 16:26:52 +08:00
|
|
|
|
using SHADE;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class PlayerAnimations : Script
|
|
|
|
|
{
|
|
|
|
|
#region Raccoon
|
|
|
|
|
[SerializeField]
|
2023-03-14 17:18:52 +08:00
|
|
|
|
public AnimationClipAsset playerIdleClip;
|
2023-03-10 16:26:52 +08:00
|
|
|
|
[SerializeField]
|
2023-03-14 17:18:52 +08:00
|
|
|
|
public AnimationClipAsset playerWalkClip;
|
2023-03-10 16:26:52 +08:00
|
|
|
|
[SerializeField]
|
2023-03-14 17:18:52 +08:00
|
|
|
|
public AnimationClipAsset playerRunClip;
|
2023-03-10 16:26:52 +08:00
|
|
|
|
[SerializeField]
|
|
|
|
|
public AnimationClipAsset playerPickUpClip;
|
|
|
|
|
[SerializeField]
|
2023-03-14 17:18:52 +08:00
|
|
|
|
public AnimationClipAsset playerCarryIdleClip;
|
2023-03-10 16:26:52 +08:00
|
|
|
|
[SerializeField]
|
2023-03-14 17:18:52 +08:00
|
|
|
|
public AnimationClipAsset playerCarryWalkClip;
|
2023-03-10 16:26:52 +08:00
|
|
|
|
[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!");
|
|
|
|
|
|
2023-03-10 19:40:48 +08:00
|
|
|
|
if(silhouettePlayer)
|
2023-03-10 17:25:41 +08:00
|
|
|
|
silhoPlayerAnimator = silhouettePlayer.GetComponent<Animator>();
|
|
|
|
|
else
|
|
|
|
|
Debug.LogError("Silho Player is MISSING!");
|
2023-03-10 19:40:48 +08:00
|
|
|
|
|
2023-03-10 16:26:52 +08:00
|
|
|
|
if (!silhoPlayerAnimator)
|
|
|
|
|
Debug.LogError("Silho Player Animator is MISSING!");
|
|
|
|
|
|
2023-03-10 19:40:48 +08:00
|
|
|
|
if(silhouetteBag)
|
2023-03-10 17:25:41 +08:00
|
|
|
|
silhoBagAnimator = silhouetteBag.GetComponent<Animator>();
|
|
|
|
|
else
|
|
|
|
|
Debug.LogError("Silho bag is MISSING!");
|
2023-03-10 19:40:48 +08:00
|
|
|
|
|
2023-03-10 16:26:52 +08:00
|
|
|
|
if (!silhoBagAnimator)
|
|
|
|
|
Debug.LogError("Silho Player Animator is MISSING!");
|
2023-03-14 17:18:52 +08:00
|
|
|
|
|
|
|
|
|
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!");
|
|
|
|
|
|
2023-03-10 16:26:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void onDestroy()
|
|
|
|
|
{
|
|
|
|
|
if (Instance == this)
|
|
|
|
|
Instance = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|