Exemple #1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        GravityObject go = collision.gameObject.GetComponent <GravityObject>();

        if (go != null)
        {
            //if (!collision.gameObject.GetComponent<CharactorController>().IsLanded)
            go.UseGravity(this);
        }
    }
Exemple #2
0
    private void OnTriggerStay2D(Collider2D collision)
    {
        //if (collision.tag.Equals("Player")) {
        //GravityObject go = collision.gameObject.GetComponent<GravityObject>();
        GravityObject go = collision.gameObject.GetComponent <GravityObject>();

        if (go != null)
        {
            if (go.GetGravitySource() == null)
            {
                go.UseGravity(this);
            }
        }
    }