// Initiate protected virtual void Start() { if (fullBody == null) { fullBody = GetComponent <FullBodyBipedIK>(); } if (fullBody == null) { Warning.Log("InteractionSystem can not find a FullBodyBipedIK component", transform); return; } // Add to the FBBIK OnPostUpdate delegate to get a call when it has finished updating fullBody.solver.OnPreUpdate += OnPreFBBIK; fullBody.solver.OnPostUpdate += OnPostFBBIK; OnInteractionStart += LookAtInteraction; OnInteractionPause += InteractionPause; OnInteractionResume += InteractionResume; OnInteractionStop += InteractionStop; foreach (InteractionEffector e in interactionEffectors) { e.Initiate(this); } triggersInRange = new List <InteractionTrigger>(); c = GetComponent <Collider>(); UpdateTriggerEventBroadcasting(); initiated = true; }
// Remove the delegates public void OnDestroy() { if (fullBody == null) { return; } fullBody.solver.OnPreUpdate -= OnPreFBBIK; fullBody.solver.OnPostUpdate -= OnPostFBBIK; OnInteractionStart -= LookAtInteraction; }
// Remove the delegates void OnDestroy() { if (fullBody == null) { return; } fullBody.solver.OnPreUpdate -= OnPreFBBIK; fullBody.solver.OnPostUpdate -= OnPostFBBIK; OnInteractionStart -= LookAtInteraction; OnInteractionPause -= InteractionPause; OnInteractionResume -= InteractionResume; OnInteractionStop -= InteractionStop; }
// Remove the delegates void OnDestroy() { if (fullBody == null) return; fullBody.solver.OnPreUpdate -= OnPreFBBIK; fullBody.solver.OnPostUpdate -= OnPostFBBIK; OnInteractionStart -= LookAtInteraction; }
// Initiate protected virtual void Start() { if (fullBody == null) fullBody = GetComponent<FullBodyBipedIK>(); if (fullBody == null) { Warning.Log("InteractionSystem can not find a FullBodyBipedIK component", transform); return; } // Add to the FBBIK OnPostUpdate delegate to get a call when it has finished updating fullBody.solver.OnPreUpdate += OnPreFBBIK; fullBody.solver.OnPostUpdate += OnPostFBBIK; OnInteractionStart += LookAtInteraction; foreach (InteractionEffector e in interactionEffectors) e.Initiate(this, fullBody.solver); triggersInRange = new List<InteractionTrigger>(); c = GetComponent<Collider>(); UpdateTriggerEventBroadcasting(); initiated = true; }
public void SetInteraction(InteractionDelegate interraction, ValidateInteractionDelegate validate = null) { onInteract = interraction; validateInteraction = validate; }