コード例 #1
0
    public override void ViewRender()
    {
        base.ViewRender();

        var product = SelectedCompany;

        var income = Economy.GetUnitIncome(Q, product, 0);

        var ads = Markets.GetClientAcquisitionCost(product.product.Niche, Q);

        var payback  = ads / income;
        var lifetime = Marketing.GetLifeTime(Q, product.company.Id);

        var paybackDescription = "=\nMarketing cost: " + ads.ToString("0.00");

        paybackDescription += "\n/\nMonthly income per user: "******"0.00");

        Payback.text = payback.ToString("0.00") + " months";
        Payback.GetComponent <Hint>().SetHint(paybackDescription);

        var ROI = (int)(lifetime * 100 / payback);

        if (ROI > 100)
        {
            EconomyDescription.text = "ROI: " + ROI + "%";
            UnitEconomy.text        = "Unit economy is " + Visuals.Positive("GOOD");
        }
        else
        {
            EconomyDescription.text = "lifetime < payback \nImprove your product!";
            UnitEconomy.text        = "Unit economy is " + Visuals.Negative("BAD");
        }


        Lifetime.text = lifetime.ToString("0.00") + " months";

        var niche = Markets.GetNiche(Q, product);

        MonetisationType.text = Enums.GetFormattedMonetisationType(niche);
    }
コード例 #2
0
    public override string RenderValue()
    {
        var lifetime = Marketing.GetLifeTime(Q, SelectedCompany.company.Id);

        return(lifetime.ToString("0.00") + " months");
    }