예제 #1
0
    public void Work_10(ref School school, ref Travel travel, ref Bottle_Price bp)
    {
        int blackmoney = Work_04(ref school, ref travel);

        float moneyFinal = (float)blackmoney - JANToRMB((float)bp.generation_Price[bp.generation_Price.Length - 1] * 0.8f);

        Debug.Log("园长最终盈亏:" + moneyFinal);
    }
예제 #2
0
    public void Work_09(ref Bottle_Price bp)
    {
        for (int i = 4; i < bp.generation_Price.Length; i++)
        {
            bp.generation_Price[i] = bp.generation_Price[i - 1] * 2;
        }

        for (int i = 0; i < bp.generation_Price.Length; i++)
        {
            Debug.Log("第" + (i + 1) + "代价格:" + bp.generation_Price[i]);
        }
    }
예제 #3
0
    // Start is called before the first frame update
    void Start()
    {
        //01
        School school = new School();

        school.num_students = 108;
        school.num_boys     = 60;
        school.num_girls    = 48;

        school.num_Junior      = 42;
        school.num_Middle      = 36;
        school.num_Senior      = 30;
        school.boysMuch_Middle = 4;
        school.boysMuch_Senior = 0;

        //02
        Work_02(ref school);


        //03
        Book black = new Book();

        black.cost_Junior = 1900;
        black.cost_Middle = 1900;
        black.cost_Senior = 1900;

        Book white = new Book();

        white.cost_Junior = 2500;
        white.cost_Middle = 2200;
        white.cost_Senior = 2000;

        //04
        Travel travel = new Travel();

        travel.black = black;
        travel.white = white;

        Work_04(ref school, ref travel);

        //05
        Weapon redSword = new Weapon()
        {
            color = "red", name = "RedSward", length = 20, width = 4, attack = 80, defend = 20
        };

        Weapon blueShield = new Weapon()
        {
            color = "blue", name = "BlueShield", length = 15, width = 15, attack = 30, defend = 90
        };

        //06

        int a = AreaWeapon(ref redSword) + AreaWeapon(ref blueShield);

        Debug.Log("面积之和:" + a + "平方寸");

        //07
        RedLightAttack(1000, ref redSword, ref blueShield);

        //08
        Bottle_Price bp = new Bottle_Price();

        bp.generation_Price    = new int[14];
        bp.generation_Price[0] = 4000;
        bp.generation_Price[1] = 4000 / 2;
        bp.generation_Price[2] = 4000 / 2 * 10;
        bp.generation_Price[3] = 4000 / 2 * 10;

        //09
        Work_09(ref bp);

        //10
        Work_10(ref school, ref travel, ref bp);
    }