Beispiel #1
0
    private void Awake()
    {
        m_trajectoryGenerator = GetComponentInChildren <MyTrajectoryGenerator>();
        m_animDecoupler       = GetComponent <MxMAnimationDecoupler>();
        m_charController      = GetComponent <GenericControllerWrapper>();
        _wrapper = GetComponent <KinematicControllerWrapper>();

        if (m_trajectoryGenerator == null)
        {
            Debug.LogError("ExampleDecoupleMovementControl cannot find a trajectory generator component. Disabling component");
            enabled = false;
            return;
        }

        if (m_animDecoupler == null)
        {
            Debug.LogError("ExampleDecoupleMovementControl cannot find a MxMAnimationDecoupler component. Disabling component");
            enabled = false;
            return;
        }

        if (m_charController == null)
        {
            Debug.LogError("ExampleDecoupleMovementControl canno find a GenericControllerWrapper component. Disabling component");
            enabled = false;
            return;
        }
    }
 public override void Declare(Char _character)
 {
     base.Declare(_character);
     wrapper = character.gameObject.GetComponent <KinematicControllerWrapper>();
 }