예제 #1
0
    public override void ViewRender()
    {
        base.ViewRender();

        ProductUpgradeLinks productUpgradeLinks = GetComponent <ProductUpgradeLinks>();

        var shareholder = Companies.GetInvestorById(Q, ShareholderId);

        var portionSize = Companies.GetPortionSize(Q, MyCompany, shareholder, 1);
        var portionCost = Companies.GetSharesCost(Q, MyCompany, shareholder, portionSize);

        productUpgradeLinks.Title.text = "<b>Buy back 1%</b>\nfor " + Format.Money(portionCost);
    }
예제 #2
0
    public void SetEntity(int shareholderId, GameEntity company)
    {
        ProductUpgradeLinks productUpgradeLinks = GetComponent <ProductUpgradeLinks>();

        if (productUpgradeLinks == null)
        {
            return;
        }


        ShareholderId = shareholderId;

        var investor = Investor;

        var isPlayer = investor.isPlayer;


        var shares = Companies.GetShareSize(Q, company, investor);
        var goal   = "Get most users";

        string name = isPlayer ? "YOU" : investor.shareholder.Name;


        productUpgradeLinks.Title.text = $"<b>{name}</b>\n{shares}% shares\n{goal}";


        if (isPlayer)
        {
            productUpgradeLinks.Background.color = Visuals.GetColorFromString(Colors.COLOR_GOLD);
        }
        else
        {
            bool isLoyal = true; // Random.Range(-15, 15) > 0;
            productUpgradeLinks.Background.color = Visuals.GetColorPositiveOrNegative(isLoyal);
        }
    }