当前位置: 首页>>代码示例>>C#>>正文


C# UserData.AddGold方法代码示例

本文整理汇总了C#中UserData.AddGold方法的典型用法代码示例。如果您正苦于以下问题:C# UserData.AddGold方法的具体用法?C# UserData.AddGold怎么用?C# UserData.AddGold使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserData的用法示例。


在下文中一共展示了UserData.AddGold方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Awake

    // Use this for initialization
    void Awake()
    {
        string data = PlayerPrefs.GetString("Vote");

        if (string.IsNullOrEmpty(data) == false)
        {
            var b = new BinaryFormatter();
            var m = new MemoryStream(Convert.FromBase64String(data));
            savedAccountData = (ClientSaveData)b.Deserialize(m);
        }

        if (savedAccountData == null)
        {
            savedAccountData = new ClientSaveData();
            savedAccountData.Save();
        }
        if (savedAccountData.Version < 1001)
        {
            savedAccountData.Vibe = 1;
            savedAccountData.Sound = 1;
            savedAccountData.Version = 1001;
        }
        //IntraTraceModule.Instance.AddTraceLine("LOAD");
        savedAccountData.Print();

        BGCollider = GameObject.Instantiate(Resources.Load("Prefabs/UI/Component/BGCollider")) as GameObject;
        BGCollider.transform.parent = GameObject.Find("UI Root").transform;
        BGCollider.transform.localScale = Vector3.one;
        BGCollider.SetActive(false);

        muhanscore = 0;

        DontDestroyOnLoad(this.gameObject);
        DataManager.Get();

        state = GameState.TITLE;
        main_state = UIManager.ID.LOBBY;

        ModifySetting();

        Application.targetFrameRate = 60;

        //UserData Initialize
        User = new UserData();
        User.Name = "임시";
        User.Level = 1;
        User.AddGold(0);
        User.Need_Exp = (User.Level + 2) * 720;
        User.Exp = 380;
        User.Ruby = 100;
        User.party.member = new CharacterStatus[3];

        //temp chardata
        CharacterData chardata;
        BulletData bulletdata;

        char_count = DataManager.Get().CharDatas.Count;
        quest_count = DataManager.Get().QuestDatas.Count - 1;
        CharacterInfo = new CharacterStatus[char_count];
        QuestInfo = new QuestData[quest_count];
        charnum = new int[char_count];
        queststate = new int[quest_count];
        questscore = new int[quest_count];

        for (int i = 0; i < quest_count; i++)
            queststate[i] = 0;

        for (int i = 0; i < char_count; i++)
        {
            charnum[i] = (i + 1) * 10000 + 101;
            DataManager.Get().CharDatas.TryGetValue(i + 1, out chardata);
            DataManager.Get().LevelDatas.TryGetValue(charnum[i], out leveldata);
            if (chardata == null)
            {
                ////Debug.log("character data missing");
            }
            CharacterInfo[i] = new CharacterStatus();
            CharacterInfo[i].num = i;
            CharacterInfo[i].charon = false;
            CharacterInfo[i].index = chardata.Index;
            CharacterInfo[i].My_Level = charnum[i] % 100;
            CharacterInfo[i].char_name = chardata.ResourceName + ((charnum[i] / 100) % 100).ToString();
            CharacterInfo[i].char_hanname = chardata.Name;
            CharacterInfo[i].attribute = (Attribute)chardata.Attribute;
            CharacterInfo[i].char_MP = chardata.ManaPoint;
            CharacterInfo[i].char_HP = leveldata.HealthPoint + ((leveldata.HealthPoint*0.01f) * User.Level * 0.6f);
            CharacterInfo[i].char_ATK = leveldata.AttackPoint + ((leveldata.AttackPoint*0.01f) * User.Level * 0.3f);
            CharacterInfo[i].char_SPD = chardata.Speed;
            CharacterInfo[i].Askill_num = chardata.SkillIndex;
            CharacterInfo[i].Askill_name = chardata.SkillName;
            CharacterInfo[i].Askill_info = chardata.SkillDesc;
            CharacterInfo[i].Askill_MP = chardata.SkillManaCost;
            CharacterInfo[i].bullet_num = chardata.BulletIndex;

            DataManager.Get().BulletDatas.TryGetValue(CharacterInfo[i].bullet_num, out bulletdata);
            if (bulletdata == null)
            {
                Debug.Log("bullet data missing");
                GameObject.Find("GameManager").SendMessage("GotoMain");
//.........这里部分代码省略.........
开发者ID:firerings,项目名称:ski-proto-01,代码行数:101,代码来源:GameManager.cs


注:本文中的UserData.AddGold方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。