コード例 #1
0
 public void LoadData(ISaveService sc)
 {
     isAlive = sc.LoadInt(this.gameObject, "stats.isAlive") == 1? true : false;
     health = sc.LoadInt(this.gameObject, "stats.health");
     if (isAlive == false){
         //deactivate dead character to prevent death animation from replaying on load
         this.gameObject.SetActive(false);
         anim.SetBool(HashIDs.isAliveBool, false);
     }
 }
コード例 #2
0
ファイル: Inventory.cs プロジェクト: Torppo/IntramuralRPG
    public void LoadData(ISaveService sc)
    {
        items = new List<InventoryItem>();
        int count = sc.LoadInt(this.gameObject, "inventory.count");
        for (int i = 0; i< count; i++){
            string name = sc.LoadString(this.gameObject, "inventory.items."+ i +".name");
            int amount = sc.LoadInt(this.gameObject, "inventory.items."+ i +".amount");

            InventoryItem it = InventoryItem.FromString(name);
            it.amount = amount;
            items.Add(it);
        }
    }
コード例 #3
0
ファイル: WeaponSwitch.cs プロジェクト: Torppo/IntramuralRPG
    private int activeWeapon = 0; //Index of the currently equipped weapon

    #endregion Fields

    #region Methods

    public void LoadData(ISaveService sc)
    {
        SelectWeapon(sc.LoadInt(this.gameObject, "equipped_weapon"));
        //Last minute hotfix
        if (activeWeapon == elementStaff) InventoryItem.FromString(InventoryItem.staff).Use();
    }
コード例 #4
0
ファイル: PickUp.cs プロジェクト: Torppo/IntramuralRPG
    public int quantity = 0; //the amount of items that the player receives

    #endregion Fields

    #region Methods

    public void LoadData(ISaveService sc)
    {
        item = sc.LoadString(owner, "pickup.item");
        quantity = sc.LoadInt(owner, "pickup.quantity");
    }