示例#1
0
    public override bool Build(Node node)
    {
        if (!CanBuild(node, true))
        {
            return(false);
        }

        GameManager.instance.gold -= cost;

        Construction c = node.transform.GetComponentInChildren <Construction>();

        if (c)
        {
            c.Demolish();
        }
        else
        {
            Destroy(node.transform.Find("Content").gameObject);
            node.content = NODE_CONTENT.EMPTY;
        }

        Destroy(gameObject);

        SoundManager.PlaySound("build");
        GameManager.instance.ScreenShake(.1f, .1f, 50);

        return(true);
    }