コード例 #1
0
    //玩家获得宝藏(金币 宝石 等货币)
    public bool addTreasure(GameObject obj)
    {
        treasure_property objproperty = obj.GetComponent <treasure_property> ();
        int itemId = objproperty.ID;
        int amount = objproperty.Num;

        char_property pro = gameObject.GetComponent <char_property> ();

        switch (itemId)
        {
        default:
            break;

        case 200:
            //constant.getMapLogic ().bagAddGold (amount);
            pro.addGold(amount);
            break;

        case 201:
            //constant.getMapLogic().bagAddDiamond(amount);
            break;

        case 202:
            //constant.getMapLogic ().bagAddKey (amount);
            pro.addKey(amount);
            break;

        case 203:
            //constant.getMapLogic ().bagAddGoldenKey (amount);
            break;

            break;
        }
        return(true);
    }
コード例 #2
0
ファイル: maplogic.cs プロジェクト: uncleshawn/projectgg.game
    //背包增加普通钥匙
    public void bagAddKey(int amount, GameObject player)
    {
        char_property charProperty = player.GetComponent <char_property> ();

        charProperty.addKey(amount);
    }