コード例 #1
0
ファイル: InteractionSystem.cs プロジェクト: zrrz/RPGXD
        // 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;
        }
コード例 #2
0
        // Remove the delegates
        public void OnDestroy()
        {
            if (fullBody == null)
            {
                return;
            }
            fullBody.solver.OnPreUpdate  -= OnPreFBBIK;
            fullBody.solver.OnPostUpdate -= OnPostFBBIK;

            OnInteractionStart -= LookAtInteraction;
        }
コード例 #3
0
ファイル: InteractionSystem.cs プロジェクト: zrrz/RPGXD
        // 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;
        }
コード例 #4
0
		// Remove the delegates
		void OnDestroy() {
			if (fullBody == null) return;
			fullBody.solver.OnPreUpdate -= OnPreFBBIK;
			fullBody.solver.OnPostUpdate -= OnPostFBBIK;

			OnInteractionStart -= LookAtInteraction;
		}
コード例 #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;
		}
コード例 #6
0
ファイル: Interactive.cs プロジェクト: averron82/LudumDare40
 public void SetInteraction(InteractionDelegate interraction, ValidateInteractionDelegate validate = null)
 {
     onInteract          = interraction;
     validateInteraction = validate;
 }