Exemple #1
0
        private void CurrentSelectedBuildingChangeHandle(GridObjectSO obj)
        {
            if (ghostTransform != null)
            {
                Destroy(ghostTransform.gameObject);
            }

            var newGhostBuilding = Instantiate(obj.Prefab, transform);

            // Necessário criar um Renderer para alterar as propriedades de visualização
            TransformUtils.ChangeLayer(
                newGhostBuilding.transform, LayerMask.NameToLayer("Ghost")
                );

            ghostTransform = newGhostBuilding.transform;
        }