public void HideBuildOverlay(Builder builder)
    {
        BuildModeOverlay overlay = overlays.FirstOrDefault(o => o.Builder == builder);

        if (overlay != null)
        {
            overlay.Hide();
        }
    }
Esempio n. 2
0
    private void BuildStructure()
    {
        BaseStructure structure = Instantiate <BaseStructure> (StructurePrefab);

        structure.transform.position = transform.position;
        Destroy(tempPrefab.gameObject);
        tempPrefab = null;

        BuildModeOverlay overlay = FindObjectsOfType <BuildModeOverlay>().FirstOrDefault(b => b.Builder == this);

        if (overlay != null)
        {
            overlay.Hide();
        }
        else
        {
            Debug.Log("Cannot find overlay for the builder!", this);
        }
    }