Ejemplo n.º 1
0
        public void CmdBuildNode(NetworkIdentity networkIdentity, int componentId)
        {
            NodeController nodeController = networkIdentity.GetComponent <NodeController>();

            if (nodeController.GetNode().GetController().GetComponentId() != 0 || nodeController.GetNode().GetNodeType() != Components.ComponentData[componentId].FoundationRequirement)
            {
                return;
            }

            if (nodeController.GetEnergy() > Components.ComponentData[componentId].BuildCost)
            {
                int newEnergyLevel = nodeController.GetEnergy() - Components.ComponentData[componentId].BuildCost;
                ((BaseNode)nodeController.GetNode()).SetComponentData(componentId);
                nodeController.SetEnergy(newEnergyLevel);
                // nodeController.EnableHChevrons();
                // nodeController.EnableVChevrons();
            }
        }