Esempio n. 1
0
    public bool destroyMe(bool addUndo)
    {
        if (locked)
        {
            return(false);
        }

        if (homeObj != null)
        {
            homeObj.GetComponent <FloorTileController>().busy = false;
            GC.tiles[spotIndex] = null;
        }

        if (addUndo)
        {
            int    setting  = 0;
            string signText = "";
            if (this.GetComponent <DelayerController>() != null)
            {
                setting = this.GetComponent <DelayerController>().setting;
            }
            else if (this.GetComponent <SignController>() != null)
            {
                signText = this.GetComponent <SignController>().text;
            }
            GC.UC.addUndo(new SingleTileUndo(this.ID, this.dir, this.spotIndex, setting, signText));
        }

        Destroy(this.gameObject);
        ui.closeSign();
        StartCoroutine(waitClose());
        return(true);
    }