holopy3/Assets/Plugins/RootMotion/FinalIK/_DEMOS/FBBIK/Scripts/RecoilTest.cs

31 lines
579 B
C#
Raw Normal View History

2020-12-10 14:25:12 +00:00
using UnityEngine;
using System.Collections;
using RootMotion.FinalIK;
namespace RootMotion.Demos {
/// <summary>
/// Just for testing out the Recoil script.
/// </summary>
[RequireComponent(typeof(Recoil))]
public class RecoilTest : MonoBehaviour {
public float magnitude = 1f;
private Recoil recoil;
void Start() {
recoil = GetComponent<Recoil>();
}
void Update() {
if (Input.GetKeyDown(KeyCode.R) || Input.GetMouseButtonDown(0)) recoil.Fire(magnitude);
}
void OnGUI() {
GUILayout.Label("Press R or LMB for procedural recoil.");
}
}
}