Exemple #1
0
    public BaseObject ProduceBuilding(Player player, BaseBuilding type, Vector3 position)
    {
        PlayerDataEnvironment.PlayerEnvironment pEnv = PlayerDataEnvironment.GetPlayerEnvironment(player);
        if (pEnv.GetGoldResource().GetAvailableResources() >= type.productionCost)
        {
            pEnv.GetGoldResource().RemoveResource(type.productionCost);
            return(CreateUnit(player, type, position));
        }


        return(null);
    }
    void Start()
    {
        Player humanPlayer = PlayerManager.humanPlayer;

        PlayerDataEnvironment.PlayerEnvironment pEnv = PlayerDataEnvironment.GetPlayerEnvironment(humanPlayer);
        goldResource = pEnv.GetGoldResource();
        oilResource  = pEnv.GetOilResource();
    }