示例#1
0
    void Start()
    {
        Debug.Log("***CM*** Start!");
        _canvas = GameObject.Find("Canvas");
        //UserPlayer
        UserPlayer = _userDatabase.GetUserPlayer();
        if (UserPlayer != null)
        {
            Debug.Log("CM-UserPlayer = " + UserPlayer.MyInfo());
        }
        AllUserPlayer = _userDatabase.GetAllUserPlayers();
        Debug.Log("CM-AllUserPlayer.Count = " + AllUserPlayer.Count);
        //CharacterSetting
        CharacterSetting = _userDatabase.GetCharacterSetting();
        if (CharacterSetting != null)
        {
            Debug.Log("CM-CharacterSetting = " + CharacterSetting.MyInfo());
            SetMyCharacter(CharacterSetting.CharacterId);
        }
        //Character
        MyCharacters     = _userDatabase.GetMyCharacters();
        MyUserCharacters = _userDatabase.GetMyUserCharacters();
        Debug.Log("CM-UserCharacters.Count = " + MyCharacters.Count);
        Debug.Log("CM-MyUserCharacters.Count = " + MyUserCharacters.Count);
        //Research
        Researches           = _characterDatabase.GetResearches();
        CharacterResearches  = _userDatabase.GetCharacterResearches();
        CharacterResearching = _userDatabase.GetCharacterResearching();
        //Recipes
        UserRecipes   = _userDatabase.GetMyRecipes();
        MyUserRecipes = _userDatabase.GetMyUserRecipes();
        Debug.Log("CM-UserRecipes.Count = " + UserRecipes.Count);
        Debug.Log("CM-MyUserRecipes.Count = " + MyUserRecipes.Count);
        //Inventory
        InitUserInventory();
        Debug.Log("CM-CharacterInventory.Count = " + CharacterInventory.Count);
        CharacterMixture = _userDatabase.GetCharacterMixture();
        //MailMessages
        MailMessages = _userDatabase.GetMailMessages();
        Debug.Log("CM-MailMessages.Count = " + MailMessages.Count);

        if (CharacterSetting != null)
        {
            LoginCalculations();
        }
    }