Exemplo n.º 1
0
        private void CreateConstruct(ConstructStats constructStats)
        {
            Debug.Log("Created");
            Construct newConstruct = Instantiate(constructStats.prefab);

            newConstruct.Init(constructStats);
            newConstruct.FinishConstruction();
            ConstructionFinished(newConstruct);
        }
Exemplo n.º 2
0
        public void CreateBlueprint(ConstructType type)
        {
            ConstructStats constructStats = null;

            foreach (var construct in _objectsLibrary.ConstructStats)
            {
                if (construct.Type == type)
                {
                    constructStats = construct;
                }
            }

            if (constructStats == null)
            {
                Debug.Log($" construct of type {type} was not found in library");
                return;
            }

            _newConstruct = Instantiate(constructStats.prefab, this.transform.position, Quaternion.identity);
            _newConstruct.Init(constructStats);
            _newConstruct.OnConstructionFinished += ConstructionFinished;
        }