コード例 #1
0
 void CheckColliders()
 {
     if (collidedList.Count > 0 && collidedList[0] != null)
     {
         foreach (Collider2D col in collidedList)
         {
             if (!collidersDamaged.Contains(col))
             {
                 collidersDamaged.Add(col);
                 if (col.CompareTag("Player"))   // Change for variable reference to Tag to allow being used by player???
                 {
                     Character_Health charHealth = col.GetComponent <Character_Health>();
                     // Hit impact FX. Apply the correct rotation, position, sprites and layerMask to an impactFX.
                     //HitImpact.PlayImpactFX(myCol.transform.position, col.transform.position, projSO.sO_ImpactFX, projSO.contactFilter.layerMask, col);
                     // Apply damage to the player.
                     col.GetComponent <Character_Health>().TakeDamage(projSO.Damage, ((Vector2)charHealth.transform.position - (Vector2)this.transform.position).normalized);
                     //print("Projectile hit the Player");
                 }
                 else if (col.CompareTag("Destructible"))
                 {
                     // Get destructible script and apply damage to the object.
                     col.GetComponent <Clutter_Health>().ReceiveDamage(projSO.Damage, myCol.transform.position, col.bounds.center);
                     //print("ARO HIT DA BOXES YA.");
                 }
                 else
                 {
                     // This should be the obstacles that just destroy the projectile nothing else.
                     //print("Projectile hit the a Wall most likely.");
                 }
                 // Turn off the projectile with collision.
                 if (projSO.destroyOnContact)
                 {
                     HitImpact.PlayImpactFX(myCol, col.transform.position, projSO.sO_ImpactFX, projSO.contactFilter.layerMask, col, true);
                     DeactivateProjectile();
                 }
             }
         }
     }
 }
コード例 #2
0
ファイル: VikingProcessor.cs プロジェクト: shaneasd/ConEdit
 public IEnumerable <NextNodeOption> ProcessNode(Character_Health node)
 {
     throw new NotImplementedException();
 }