Skip to content

Instantly share code, notes, and snippets.

@apras
Created October 18, 2016 00:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apras/2f8062e9239241f8f141f27b0f9934d3 to your computer and use it in GitHub Desktop.
Save apras/2f8062e9239241f8f141f27b0f9934d3 to your computer and use it in GitHub Desktop.
FinalIKに追加されたVRIKにて、とりあえず地面設置を行うスクリプト
public class GrounderVRIK : MonoBehaviour
{
private BipedIK m_bipedIK;
private GrounderBipedIK m_grounderBipedIK;
void Awake()
{
this.m_bipedIK = this.GetComponent<BipedIK>();
this.m_grounderBipedIK = this.GetComponent<GrounderBipedIK>();
if(this.m_bipedIK != null)
{
this.m_bipedIK.enabled = false;
}
if(this.m_grounderBipedIK != null)
{
this.m_grounderBipedIK.enabled = true;
}
}
void LateUpdate()
{
if(this.m_bipedIK != null && this.m_grounderBipedIK != null)
{
this.m_bipedIK.UpdateBipedIK();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment