コード例 #1
0
ファイル: BaseStage.cs プロジェクト: sorude26/Custom
 public void BuildUnit(int headID, int bodyID, int lArmID, int weaponLID, int rArmID, int weaponRID, int legID)
 {
     if (!silhouetteOn)
     {
         transform.rotation = Quaternion.Euler(0, 0, 0);//パーツ生成時に向きを合わせる
         GameObject leg = Instantiate(partsList.GetLegObject(legID));
         leg.transform.position = transform.position;
         leg.transform.parent   = transform;
         Leg = leg.GetComponent <PartsLeg>();
         GameObject body = Instantiate(partsList.GetBodyObject(bodyID));
         body.transform.parent = Leg.transform;
         Body = body.GetComponent <PartsBody>();
         Body.TransFormParts(Leg.GetPartsHigh().position);
         GameObject head = Instantiate(partsList.GetHeadObject(headID));
         head.transform.parent = Body.transform;
         Head = head.GetComponent <PartsHead>();
         Head.TransFormParts(Body.GetHeadPos().position);
         GameObject lArm = Instantiate(partsList.GetLArmObject(lArmID));
         lArm.transform.parent = Body.transform;
         LArm = lArm.GetComponent <PartsLArm>();
         LArm.TransFormParts(Body.GetLArmPos().position);
         GameObject weaponL = Instantiate(partsList.GetWeaponObject(weaponLID));
         weaponL.transform.parent = LArm.ArmParts().transform;
         LArmWeapon = weaponL.GetComponent <Weapon>();
         LArmWeapon.TransFormParts(LArm.GetGrip().position);
         GameObject rArm = Instantiate(partsList.GetRArmObject(rArmID));
         rArm.transform.parent = Body.transform;
         RArm = rArm.GetComponent <PartsRArm>();
         RArm.TransFormParts(Body.GetRArmPos().position);
         GameObject weaponR = Instantiate(partsList.GetWeaponObject(weaponRID));
         weaponR.transform.parent = RArm.ArmParts().transform;
         RArmWeapon = weaponR.GetComponent <Weapon>();
         RArmWeapon.TransFormParts(RArm.GetGrip().position);
         silhouetteOn    = true;
         partsTotalPlice = Body.GetPrice() + Head.GetPrice() + LArm.GetPrice() + RArm.GetPrice() + Leg.GetPrice() + LArmWeapon.GetPrice() + RArmWeapon.GetPrice();
         unitNumber.text = "機体番号:" + j + "\n価格" + partsTotalPlice;
     }
 }
コード例 #2
0
    public int GetPraice(int unitNumber)
    {
        int price = 0;

        GameManager.PlayerUnitData unitData = GameManager.UnitDatas[unitNumber];
        price += unitPartsList.GetHeadObject(unitData.HeadID).GetComponent <PartsHead>().GetPrice();
        price += unitPartsList.GetBodyObject(unitData.BodyID).GetComponent <PartsBody>().GetPrice();
        price += unitPartsList.GetLArmObject(unitData.LArmID).GetComponent <PartsLArm>().GetPrice();
        price += unitPartsList.GetRArmObject(unitData.RArmID).GetComponent <PartsRArm>().GetPrice();
        price += unitPartsList.GetLegObject(unitData.LegID).GetComponent <PartsLeg>().GetPrice();
        price += unitPartsList.GetWeaponObject(unitData.WeaponLID).GetComponent <Weapon>().GetPrice();
        price += unitPartsList.GetWeaponObject(unitData.WeaponRID).GetComponent <Weapon>().GetPrice();
        return(price);
    }
コード例 #3
0
ファイル: UnitShowBase.cs プロジェクト: sorude26/Custom
    public void BuildUnit(int headID, int bodyID, int lArmID, int weaponLID, int rArmID, int weaponRID, int legID, Transform pos)
    {
        //pos.rotation = Quaternion.Euler(0, 0, 0);//パーツ生成時に向きを合わせる
        GameObject leg = Instantiate(partsList.GetLegObject(legID));

        leg.transform.position = pos.position;
        leg.transform.parent   = pos;
        Leg = leg.GetComponent <PartsLeg>();
        GameObject body = Instantiate(partsList.GetBodyObject(bodyID));

        body.transform.parent = Leg.transform;
        Body = body.GetComponent <PartsBody>();
        Body.TransFormParts(Leg.GetPartsHigh().position);
        GameObject head = Instantiate(partsList.GetHeadObject(headID));

        head.transform.parent = Body.transform;
        Head = head.GetComponent <PartsHead>();
        Head.TransFormParts(Body.GetHeadPos().position);
        GameObject lArm = Instantiate(partsList.GetLArmObject(lArmID));

        lArm.transform.parent = Body.transform;
        LArm = lArm.GetComponent <PartsLArm>();
        LArm.TransFormParts(Body.GetLArmPos().position);
        GameObject weaponL = Instantiate(partsList.GetWeaponObject(weaponLID));

        weaponL.transform.parent = LArm.ArmParts().transform;
        LArmWeapon = weaponL.GetComponent <Weapon>();
        LArmWeapon.TransFormParts(LArm.GetGrip().position);
        GameObject rArm = Instantiate(partsList.GetRArmObject(rArmID));

        rArm.transform.parent = Body.transform;
        RArm = rArm.GetComponent <PartsRArm>();
        RArm.TransFormParts(Body.GetRArmPos().position);
        GameObject weaponR = Instantiate(partsList.GetWeaponObject(weaponRID));

        weaponR.transform.parent = RArm.ArmParts().transform;
        RArmWeapon = weaponR.GetComponent <Weapon>();
        RArmWeapon.TransFormParts(RArm.GetGrip().position);
    }
コード例 #4
0
    private void Start()
    {
        baseStage = BaseStage.Instance;
        partsList = UnitPartsList.Instance;
        switch (commandType)
        {
        case CommandType.ChoicePartsHead:
            partsName.text = partsList.GetHeadObject(commandNumber).GetComponent <PartsHead>().GetName();
            break;

        case CommandType.ChoicePartsBody:
            partsName.text = partsList.GetBodyObject(commandNumber).GetComponent <PartsBody>().GetName();
            break;

        case CommandType.ChoicePartsLArm:
            partsName.text = partsList.GetLArmObject(commandNumber).GetComponent <PartsLArm>().GetName();
            break;

        case CommandType.ChoicePartsRArm:
            partsName.text = partsList.GetRArmObject(commandNumber).GetComponent <PartsRArm>().GetName();
            break;

        case CommandType.ChoicePartsLeg:
            partsName.text = partsList.GetLegObject(commandNumber).GetComponent <PartsLeg>().GetName();
            break;

        case CommandType.ChoiceWeaponL:
            partsName.text = partsList.GetWeaponObject(commandNumber).GetComponent <Weapon>().GetName();
            break;

        case CommandType.ChoiceWeaponR:
            partsName.text = partsList.GetWeaponObject(commandNumber).GetComponent <Weapon>().GetName();
            break;

        default:
            break;
        }
    }