Exemplo n.º 1
0
 void OnTriggerExit2D(Collider2D collision)
 {
     if (collision.tag == "Platform" && platformObject.gameObject == collision.gameObject)
     {
         platformObject = null;
     }
 }
Exemplo n.º 2
0
 void OnTriggerStay2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "Platform")
     {
         platformObject = collision.GetComponent <TravellingObject>();
     }
 }
Exemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     travelDistance = LevelData.LevelInstance.GetComponent <Grid>().cellSize.x *
                      LevelData.LevelInstance.transform.localScale.x;
     platformObject   = null;
     currentLane      = null;
     parentController = PlayerController.playerInstance.GetComponent <PlayerController>();
     maxHeight        = transform.position.y;
 }
Exemplo n.º 4
0
    void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag == "Enemy")
        {
            Die();
        }

        if (collision.gameObject.tag == "Platform")
        {
            platformObject = collision.GetComponent <TravellingObject>();
        }

        if (collision.gameObject.tag == "Lane")
        {
            currentLane = collision.GetComponent <LaneData>();
        }

        if (collision.gameObject.tag == "Objective")
        {
            ObjectiveCompleted();
        }
    }