Exemplo n.º 1
0
 public void ExitStairwell(Stairwell stairwell)
 {
     if (stairwell == this.stairwell)
     {
         this.stairwell = null;
     }
 }
Exemplo n.º 2
0
    void OnTriggerExit2D(Collider2D other)
    {
        Stairwell stairwell = other.GetComponent <Stairwell>();

        if (stairwell)
        {
            move.ExitStairwell(stairwell);
        }
    }
Exemplo n.º 3
0
    private void findLowerStairWell()
    {
        if (pType == PieceType.LOBBY || pType == PieceType.WALL)
        {
            return;
        }

        Transform  sprite        = this.gameObject.transform.Find("Sprite");
        GameObject thisStairWell = sprite.Find("Stairwell").gameObject;
        Stairwell  sourceSW      = thisStairWell.GetComponent <Stairwell>();

        RaycastHit2D hit = Physics2D.Raycast(thisStairWell.transform.position - new Vector3(0, 2.5f, 0), Vector2.down, 500f, layerMask);

        Debug.DrawRay(thisStairWell.transform.position - new Vector3(0, 2.5f, 0), Vector2.down, Color.magenta, 10f);

        if (hit.collider != null)
        {
            GameObject target   = hit.collider.gameObject;
            Stairwell  targetSW = target.GetComponent <Stairwell>();

            targetSW.stairwellAbove = sourceSW.transform;
            sourceSW.stairwellBelow = targetSW.transform;
        }
    }
Exemplo n.º 4
0
 // Stairwell stuff.
 public void SetStairwell(Stairwell stairwell)
 {
     this.stairwell = stairwell;
 }