Adventure …

Editing

Unity Third Person Controller integration

1
  • The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit. If you are undoing an edit that is …
Latest revision Your text
Line 15: Line 15:
 
using UnityStandardAssets.Characters.ThirdPerson;<br>
 
using UnityStandardAssets.Characters.ThirdPerson;<br>
 
using AC;<br>
 
using AC;<br>
<br>
 
 
<br>
 
<br>
 
public class UnityThirdPersonIntegration : MonoBehaviour<br>
 
public class UnityThirdPersonIntegration : MonoBehaviour<br>
 
{<br>
 
{<br>
<br>
 
 
<br>
 
<br>
 
private NavMeshAgent navMeshAgent;<br>
 
private NavMeshAgent navMeshAgent;<br>
Line 46: Line 44:
 
characterAC = GetComponent <Char>();<br>
 
characterAC = GetComponent <Char>();<br>
 
characterAC.motionControl = MotionControl.JustTurning;<br>
 
characterAC.motionControl = MotionControl.JustTurning;<br>
  +
<br>
 
characterTP = GetComponent<ThirdPersonCharacter>();<br>
 
characterTP = GetComponent<ThirdPersonCharacter>();<br>
 
}<br>
 
}<br>
Line 97: Line 96:
 
{<br>
 
{<br>
 
case ControlState.UnderDirectControl:<br>
 
case ControlState.UnderDirectControl:<br>
if (navMeshAgent != null)<br>
+
navMeshAgent.enabled = false;<br>
{<br>
 
navMeshAgent.enabled = false;<br>
 
}<br>
 
else<br>
 
{<br>
 
ACDebug.LogWarning ("A NavMeshAgent component is required on " + gameObject.name, this);<br>
 
}<br>
 
 
if (!m_Jump)<br>
 
if (!m_Jump)<br>
 
{<br>
 
{<br>
Line 174: Line 173:
 
<br>
 
<br>
 
}
 
}
 
 
 
[[Category:Integrations]]
 
[[Category:Integrations]]
  Loading editor
Below are some commonly used wiki markup codes. Simply click on what you want to use and it will appear in the edit box above.

View this template