Ejemplo n.º 1
0
 /// <summary>
 /// Tell the LevelStateMangager to remove this bubble
 /// </summary>
 public void RemoveBubble()
 {
     if (!LevelStateManager.removeStasisBubble(this))
     {
         DestroyBubble();
     }
 }
Ejemplo n.º 2
0
    public void doNullify()
    {
        RaycastHit2D[] hits = Physics2D.CircleCastAll(transform.position, nullFieldRadius, Vector2.zero, 0f, nullLayers);
        for (int i = 0; i < hits.Length; i++)
        {
            RaycastHit2D losCheck;
            losCheck = Physics2D.Raycast(
                transform.position,
                hits[i].collider.transform.position - transform.position,
                Vector2.Distance(transform.position, hits[i].collider.transform.position),
                nullObstLayers.value);
            if (losCheck.collider != null)
            {
                continue;
            }

            Entity e = hits [i].collider.GetComponent <Entity> ();
            if (e != null && e.getFaction() == Entity.Faction.player)
            {
                e.addStatus(Status.get("Nullified", 0.1f));
            }

            StasisBubble sb = hits [i].collider.GetComponent <StasisBubble> ();
            if (sb != null)
            {
                LevelStateManager.removeStasisBubble(sb);
            }
        }
    }