コード例 #1
0
ファイル: UIMachinePartsParams.cs プロジェクト: 2ty/race3d
    public void ChangeDisp(MachinePartsBase part)
    {
        _hitPoint.SetActive (part is Frame);
        _stability.SetActive (part is Frame);
        _cornering.SetActive (part is Frame);
        _chargeSpeed.SetActive (part is Generator);
        _chargeCapacity.SetActive (part is Generator);
        _power.SetActive (part is Booster);
        _maxPower.SetActive (part is Booster);
        _weight.SetActive (true);

        if (part is Frame) {
            _hitPoint.SetParamValue (((Frame)part).hitPoint);
            _stability.SetParamValue (((Frame)part).stability);
            _cornering.SetParamValue (((Frame)part).cornering);
            _weight.SetParamValue (((Frame)part).weight);
        } else if (part is Booster) {
            _power.SetParamValue (((Booster)part).power);
            _maxPower.SetParamValue (((Booster)part).maxPower);
            _weight.SetParamValue (((Booster)part).weight);
        } else if (part is Generator) {
            _chargeSpeed.SetParamValue (((Generator)part).chageSpeed);
            _chargeCapacity.SetParamValue (((Generator)part).maxChargeCapacity);
            _weight.SetParamValue (((Generator)part).weight);
        }
    }
コード例 #2
0
    public void SetMachinePart(MachinePartsBase machinePart, AppProduct appProduct)
    {
        part = machinePart;
        product = appProduct;

        _partName.text = part.objName;
        _partPrice.text = product.priceApp.ToString ();
    }