Esempio n. 1
0
    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();
    }
Esempio n. 2
0
    /***************/

    #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);
        }
    }
Esempio n. 3
0
 /// <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);
                     }
                 }
             }
         }
     }
 }
Esempio n. 4
0
 public void TriggerDetectedInChild(TriggerCollider triggerCollider)
 {
     //Debug.Log("trigger in child detected");
     trig = true;
 }