Exemplo n.º 1
0
        // 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;
        }
Exemplo n.º 2
0
        // Remove the delegates
        public void OnDestroy()
        {
            if (fullBody == null)
            {
                return;
            }
            fullBody.solver.OnPreUpdate  -= OnPreFBBIK;
            fullBody.solver.OnPostUpdate -= OnPostFBBIK;

            OnInteractionStart -= LookAtInteraction;
        }
Exemplo n.º 3
0
        // 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;
        }
Exemplo n.º 4
0
		// Remove the delegates
		void OnDestroy() {
			if (fullBody == null) return;
			fullBody.solver.OnPreUpdate -= OnPreFBBIK;
			fullBody.solver.OnPostUpdate -= OnPostFBBIK;

			OnInteractionStart -= LookAtInteraction;
		}
Exemplo n.º 5
0
		// 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;
		}
Exemplo n.º 6
0
 public void SetInteraction(InteractionDelegate interraction, ValidateInteractionDelegate validate = null)
 {
     onInteract          = interraction;
     validateInteraction = validate;
 }