You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
526 B
C#
20 lines
526 B
C#
using System.Collections;
|
|
using UnityEngine;
|
|
using MalbersAnimations.Scriptables;
|
|
|
|
namespace MalbersAnimations
|
|
{
|
|
/// <summary>
|
|
/// Stores the Value of a Gameobjcet down direction to a Scriptable Vector3 variable
|
|
/// </summary>
|
|
[AddComponentMenu("Malbers/Utilities/Tools/Global Gravity")]
|
|
public class GlobalGravity : MonoBehaviour
|
|
{
|
|
[RequiredField] public Vector3Var Gravity;
|
|
void Update()
|
|
{
|
|
if (Gravity != null) Gravity.Value = -transform.up;
|
|
}
|
|
}
|
|
}
|