コード例 #1
0
ファイル: LoadCharacter.cs プロジェクト: McPalm/FEPonies
    // Use this for initialization
    void Awake()
    {
        Character loadedCharacter;

        if (dbCharacter != "")
        {
            CharacterDB cdb = Resources.Load <CharacterDB>("CharacterDB");
            loadedCharacter = cdb.GetCharacter(dbCharacter);
        }
        else if (rosterCharacter != "")
        {
            // get a character from the roster
            loadedCharacter = UnitRoster.Instance.GetCharacter(rosterCharacter);
        }
        else
        {
            // use preset character
            Debug.LogWarning("Prefferably load from roster or database instead of hardcoding a character here. ");
            loadedCharacter           = presetCharacter;
            presetCharacter.Skilltree = SkillTreeDB.GetSkillTreeClone("Empty");
            presetCharacter.Sprite    = GetComponent <SpriteRenderer>().sprite;
        }

        if (setLevel > 0)
        {
            loadedCharacter.Level = setLevel;
        }
        GetComponent <Unit>().Character = loadedCharacter;
    }
コード例 #2
0
ファイル: Main.cs プロジェクト: jackabean123/GTA-Kingpin
 private void UpdateUIScript()
 {
     if (DatabaseHandler.requestCharacter)
     {
         DatabaseHandler.character        = CharacterDB.GetCharacter();
         DatabaseHandler.requestCharacter = false;
     }
     if (DatabaseHandler.requestCharacterInventory)
     {
         DatabaseHandler.characterInventory        = InventoryDB.GetCharacterInventory();
         DatabaseHandler.requestCharacterInventory = false;
     }
 }
コード例 #3
0
ファイル: UnitRoster.cs プロジェクト: McPalm/FEPonies
 public Character getBaseCharacter(string name)
 {
     return(StarterDatabase.GetCharacter(name));
 }