Пример #1
0
    public override Part clone()
    {
        SteelCore ret = new SteelCore();

        Part.copy(this, ret);
        return(ret);
    }
Пример #2
0
    public void startUp()
    {
        //set clock
        simTime = 0.0f;

        //ability dictionary
        shoot newShoot = new shoot();

        newShoot.Initialize();
        newShoot.iconSprite = Resources.Load <Sprite>("BoostAttackIcon") as Sprite;
        UniTable.abilityDictionary.Add(UniTable.classGuid[typeof(shoot)], newShoot);

        switchWeapon newSwitchWeapon = new switchWeapon();

        newSwitchWeapon.Initialize();
        newSwitchWeapon.iconSprite = Resources.Load <Sprite>("BoostAttackIcon") as Sprite;
        UniTable.abilityDictionary.Add(UniTable.classGuid[typeof(switchWeapon)], newSwitchWeapon);

        //parts dictionary
        Part mp = new Part();

        UniTable.partDictionary.Add(UniTable.classGuid[typeof(Part)], mp);

        SteelCore sc = new SteelCore();

        sc.slots.Add(Part.slot.core);
        UniTable.partDictionary.Add(UniTable.classGuid[typeof(SteelCore)], sc);

        //weapon dictionary
        FlakGunWeapon newFlakGun = new FlakGunWeapon();

        newFlakGun.displayName = "Flak Gun";
        newFlakGun.range       = 5;
        newFlakGun.damage      = 35;
        newFlakGun.maxAmmo     = 8;
        newFlakGun.iconSprite  = Resources.Load <Sprite>("BoostAttackIcon") as Sprite;
        newFlakGun.slots.Add(Part.slot.weapon1);
        newFlakGun.slots.Add(Part.slot.weapon2);
        UniTable.partDictionary.Add(UniTable.classGuid[typeof(FlakGunWeapon)], newFlakGun);


        LasGunWeapon newLasGun = new LasGunWeapon();

        newLasGun.displayName = "LasGun";
        newLasGun.range       = 2;
        newLasGun.damage      = 45;
        newLasGun.iconSprite  = Resources.Load <Sprite>("BoostAttackIcon") as Sprite;
        newLasGun.slots.Add(Part.slot.weapon1);
        newLasGun.slots.Add(Part.slot.weapon2);
        UniTable.partDictionary.Add(UniTable.classGuid[typeof(LasGunWeapon)], newLasGun);

        //units dictionary
        //these rely on the above
        Mech m = this.transform.gameObject.AddComponent <Mech>();

        m.Initialize();
        UniTable.unitDictionary.Add(UniTable.classGuid[typeof(Mech)], m);

        //define template rules regarding parts ownership and templated parts
        Mech inter = this.makeIntercessorTemplate();

        UniTable.unitDictionary.Add(new Guid("a36f8211-608f-4afc-be6f-27f5b6143019"), inter);

        //prefabs Table
        UniTable.prefabTable.Add(typeof(Mech), Resources.Load <Transform>("Mech") as Transform);

        initCrafting();
    }