Exemple #1
0
    void OnTriggerExit2D(Collider2D col)
    {
        int objLayer = col.gameObject.layer;

        if (objLayer == playerLayer || objLayer == boxLayer)
        {
            CentralGravity cg = col.GetComponent <CentralGravity>();
            //print(col.gameObject.name);
            cg.RightsideUp();
        }
    }
Exemple #2
0
    void OnTriggerExit2D(Collider2D col)
    {
        if (col.gameObject.tag != "Player")
        {
            return;
        }

        /*
         * int objLayer = col.gameObject.layer;
         *
         * if (objLayer == playerLayer || objLayer == boxLayer || objLayer == ignoreLayer){
         *      CentralGravity cg = col.GetComponent<CentralGravity>();
         *      //print(col.gameObject.name);
         *      cg.RightsideUp();
         * }
         */

        CentralGravity cg = col.GetComponent <CentralGravity>();

        //print(col.gameObject.name);
        cg.RightsideUp();
    }