Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

43 lines
996 B

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
using Oculus.Avatar;
public class OvrAvatarBody : OvrAvatarComponent
{
public ovrAvatarBodyComponent component = new ovrAvatarBodyComponent();
public ovrAvatarComponent? GetNativeAvatarComponent()
{
if (owner == null)
{
return null;
}
if (CAPI.ovrAvatarPose_GetBodyComponent(owner.sdkAvatar, ref component))
{
CAPI.ovrAvatarComponent_Get(component.renderComponent, true, ref nativeAvatarComponent);
return nativeAvatarComponent;
}
return null;
}
void Update()
{
if (owner == null)
{
return;
}
if (CAPI.ovrAvatarPose_GetBodyComponent(owner.sdkAvatar, ref component))
{
UpdateAvatar(component.renderComponent);
}
else
{
owner.Body = null;
Destroy(this);
}
}
}