public GameObject commandBaseObject;

    private GameObject commadBasesActive = null;

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

 

    public override System.Action GetClickAction () {

        return delegate() {

            var player = GetComponentPlayer ().Info;

            if (player.Credits < Cost){                 Debug.Log("Not enough, this costs " + Cost);                 return;}             var go = GameObject.Instantiate(GhostBuildingPrefab);               var finder = go.AddComponent ();

 

            finder.Info = player;

            finder.Source =
transform;

            finder.Cost = Cost;

            commadBasesActive = go;

        };

    }

void Update() {

        if (active == null){

            return;}

        if (Input.GetKeyDown (KeyCode.Escape))

            GameObject.Destroy (active);

    }

    void OnDestroy() {

        if (active == null)

            return;

        Destroy (active);

    }}