BITFALL/Assets/Plugins/Character Controller Pro/Demo/Scripts/Platforms/Platform.cs

35 lines
848 B
C#
Raw Normal View History

2023-10-04 16:50:27 +08:00
using UnityEngine;
using Lightbug.Utilities;
namespace Lightbug.CharacterControllerPro.Demo
{
/// <summary>
/// This abstract class represents a basic platform.
/// </summary>
public abstract class Platform : MonoBehaviour
{
/// <summary>
/// Gets the RigidbodyComponent component associated to the character.
/// </summary>
public RigidbodyComponent RigidbodyComponent { get; protected set; }
protected virtual void Awake()
{
RigidbodyComponent = RigidbodyComponent.CreateInstance(gameObject);
if (RigidbodyComponent == null)
{
Debug.Log("(2D/3D)Rigidbody component not found! \nDynamic platforms must have a Rigidbody component associated.");
this.enabled = false;
}
}
}
}