Esempio n. 1
0
        protected virtual bool HandleObstruction(GameObject other)
        {
            Obstruction obstruction = other.GetComponent <Obstruction>();

            if (obstruction != null)
            {
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
        //when colliding with wall or door
        protected override bool HandleObstruction(GameObject other)
        {
            Obstruction obstruction = other.GetComponent <Obstruction>();

            if (obstruction != null)
            {
                if (obstruction.canBeOpened)
                {
                    if (keys > 0)
                    {
                        keys--;
                        Destroy(other);
                        return(true);
                    }
                }
                return(false);
            }
            return(true);
        }