Exemplo n.º 1
0
    public void useEnviroment()
    {
        RaycastHit2D raycastHit2D = Physics2D.BoxCast(bodyStraitCollider.bounds.center, bodyStraitCollider.bounds.size, 0f, Vector2.zero, 1, GlobalProperties.gp.usableLayerMask);

        if (raycastHit2D.collider != null)
        {
            Debug.Log("COLLIDED");
            IEnviromentUsable usable = (raycastHit2D.collider.gameObject.GetComponent <IEnviromentUsable>());

            if (usable != null)
            {
                Debug.Log("Trying to use");
                useEnviroment(usable);
            }
        }
        Debug.Log("NONE");
    }
Exemplo n.º 2
0
 public void useEnviroment(IEnviromentUsable usable)
 {
     usable.beUsed(this);
 }