public void Tick(float DeltaTime) { foreach (EHPhysics2D PhysicsComponent in PhysicsComponentSet) { if (PhysicsComponent.gameObject.activeInHierarchy && PhysicsComponent.enabled) { PhysicsComponent.Tick(DeltaTime); } } foreach (EHBaseCollider2D MoveableCollider in ColliderComponentDictionary[EHBaseCollider2D.EColliderType.MOVEABLE]) { if (MoveableCollider.gameObject.activeInHierarchy) { MoveableCollider.UpdateColliderBounds(true); MoveableCollider.DragIntersectingColliders(); } } foreach (EHBaseCollider2D PhysicsCollider in ColliderComponentDictionary[EHBaseCollider2D.EColliderType.PHYSICS]) { if (PhysicsCollider.gameObject.activeInHierarchy) { PhysicsCollider.UpdateColliderBounds(true); } } foreach (EHBaseCollider2D TriggerCollider in TriggerColliderSet) { TriggerCollider.UpdateColliderBounds(false); } CheckPhysicsCollidersAgainstCategory(); CheckTriggerIntersections(); }
/***************/ #region skill state #endregion #region setup and unequip public override void Initialise(Animation target, Transform character, CharacterActionManager actionManager, Collider masterCollider) { base.Initialise(target, character, actionManager, masterCollider); TransferAnimations(); if (weaponCollider != null) { TriggerCollider tc = weaponCollider.GetComponent <TriggerCollider>(); if (tc != null) { tc.ownerCollider = characterCollider; tc.IgnoreCollision(); } weaponCollider.SetActive(false); } }
/// <summary> /// /// </summary> private void CheckTriggerIntersections() { foreach (EHBaseCollider2D TriggerCollider in TriggerColliderSet) { if (TriggerCollider.gameObject.activeInHierarchy) { foreach (EHBaseCollider2D PhysicsCollider in ColliderComponentDictionary[EHBaseCollider2D.EColliderType.PHYSICS]) { if (PhysicsCollider.gameObject.activeInHierarchy) { if (!Physics2D.GetIgnoreLayerCollision(PhysicsCollider.gameObject.layer, TriggerCollider.gameObject.layer)) { TriggerCollider.IsTriggerOverlappingCollider(PhysicsCollider); } } } } } }
public void TriggerDetectedInChild(TriggerCollider triggerCollider) { //Debug.Log("trigger in child detected"); trig = true; }