• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# PlayerData类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中PlayerData的典型用法代码示例。如果您正苦于以下问题:C# PlayerData类的具体用法?C# PlayerData怎么用?C# PlayerData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PlayerData类属于命名空间,在下文中一共展示了PlayerData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: LoadPlayerData

 void LoadPlayerData( )
 {
     _Rester.GetJSON( ServerURL + "/players/" + _PlayerId, ( err, result ) =>
     {
         _PlayerData = new PlayerData( result );
     } );
 }
开发者ID:NSECharles,项目名称:SimpleBackend,代码行数:7,代码来源:Example.cs


示例2: load

    public void load()
    {
        //Create the GameControl and a Player.
        //Checks that loads are correctly done.
        GameControl subGameControl = new GameControl();
        PlayerData subPlayerData = new PlayerData();
        subGameControl.playerData = subPlayerData;

        subPlayerData.playerStr = 8;
        subPlayerData.playerAgl = 7;
        subPlayerData.playerDex = 6;
        subPlayerData.playerInt = 5;
        subPlayerData.playerVit = 4;
        subPlayerData.currentGameLevel = 3;
        subPlayerData.abilityPoints = 2;

        subGameControl.Load();

        Assert.That(subGameControl.playerStr == 8);
        Assert.That(subGameControl.playerAgl == 7);
        Assert.That(subGameControl.playerDex == 6);
        Assert.That(subGameControl.playerInt == 5);
        Assert.That(subGameControl.playerVit == 4);
        Assert.That(subGameControl.currentGameLevel == 3);
        Assert.That(subGameControl.abilityPoints == 2);
    }
开发者ID:unit02,项目名称:SoftEng-306-Project-2,代码行数:26,代码来源:UnitTests.cs


示例3: Save

    public void Save(int score, int cubesDestroyed, int purpleCubes, int blueCubes, int redCubes, int yellowCubes, int greenCubes)
    {
        BinaryFormatter bf = new BinaryFormatter();
        FileStream file = File.Create(Application.persistentDataPath + "/playerInfo.dat");
        PlayerData data = new PlayerData();

        if (score > data.highestScore)
        {
            data.highestScore = score;
            data.isHighScore = true;
        }
        else
            data.isHighScore = false;

        data.totalScore += score;
        data.cubesDestroyed += cubesDestroyed;
        data.lastScore = score;
        data.purpleCubes = purpleCubes;
        data.blueCubes = blueCubes;
        data.redCubes = redCubes;
        data.yellowCubes = yellowCubes;
        data.greenCubes = greenCubes;


        bf.Serialize(file, data);
        file.Close();
    }
开发者ID:nickmorell,项目名称:Cube,代码行数:27,代码来源:ApplicationManager.cs


示例4: AddPlayer

 public UiPlayerListItem AddPlayer(PlayerData player)
 {
     var instance = UiUtility.AddChild(List, Prototype, true);
     instance.Tick.SetActive(false);
     instance.Name.text = player.Name;
     return instance;
 }
开发者ID:Trainfire,项目名称:Drawesome,代码行数:7,代码来源:UiPlayerList.cs


示例5: Awake

	// Use this for initialization
	void Awake () {

		pd = PlayerData.Instance;

		//sm = SoundManagerScript.Instance;
		efm = EffectSoundManagerScript.Instance;

		scrollBar = GameObject.Find ("ScrollBar");
		//loadNorm_N_Score ();
//		sm = SoundManagerScript.Instance;
//		sm.playSnd ();

		go_HotMenuBase = GameObject.Find ("HotMenuBase");
		go_HotMenu = GameObject.Find ("HotMenu");

		go_FillRect_HotMenu = GameObject.Find ("FillRect_HotMenu");
		go_FillRect_HotMenu.SetActive (false);

		select_planet = 0;

		go_Planet = new GameObject[PLANET_SIZE];

		createPlanet ();

		setScrollBarValue ();
	}
开发者ID:eldon-dometita,项目名称:RAY,代码行数:27,代码来源:MapScript.cs


示例6: Start

	void Start()
	{
		player = GameObject.Find(_DATA).GetComponent<PlayerData>();
		game 	 = GameObject.Find(GAME_MANAGER).GetComponent<GameManager>();

		Init();
	}
开发者ID:BrodyMedia,项目名称:Unity2D-Components,代码行数:7,代码来源:PlayerManager.cs


示例7: GeneratePlayerData

 PlayerData GeneratePlayerData(NetworkPlayer player)
 {
     PlayerData newPlayer = new PlayerData();
     newPlayer.player = player;
     newPlayer.team = -1;
     return newPlayer;
 }
开发者ID:shawnmiller,项目名称:Capstone,代码行数:7,代码来源:PlayerManager.cs


示例8: Setup

    public void Setup()
    {
        SETUP = MainTitleUI.getSetup();
        PLAYERDATA = GameObject.FindGameObjectWithTag("PlayerData").GetComponent<PlayerData>();
        PLAYERDATA.Launch();
        ThumbGO = new GameObject("Thumbnails");
        ThumbGO.transform.parent = gameObject.transform;
        ThumbGO.transform.localPosition = new Vector3(0f,0f,0f);
        levelName = FETool.findWithinChildren(gameObject, "LevelTitle/LEVEL_NAME").GetComponent<TextUI>();
        _btnLeft = FETool.findWithinChildren(gameObject, "SelectLeft").GetComponent<LevelChooserButton>();
        _btnRight = FETool.findWithinChildren(gameObject, "SelectRight").GetComponent<LevelChooserButton>();

        Thumbs.Clear();
        foreach (LevelInfo _lvl in PLAYERDATA.PROFILE.ActivatedLevels)
        {
            LevelThumbnail _th = CreateThumbnail(_lvl);
            Thumbs.Add(_th);
        }
        for (int j = 0; j < Thumbs.Count ; j++)
        {
        //			Thumbs[j].gameObject.transform.localPosition = new Vector3(0f,0f,0f);
            Thumbs[j].gameObject.transform.localPosition = new Vector3(j * gapThumbs.x, 0f, gapThumbs.z);
        }

        Thumbs[0].isStartSlot = true;
        Thumbs[Thumbs.Count-1].isEndSlot = true;

        _btnLeft.Setup(this, LevelChooserButton.DirectionList.Left);
        _btnRight.Setup(this, LevelChooserButton.DirectionList.Right);
        currThumb = Thumbs[0];
        levelName.text = currThumb.nameLv.ToString();
        checkCurrThumb();
    }
开发者ID:Tavrox,项目名称:Lavapools,代码行数:33,代码来源:LevelChooser.cs


示例9: Start

 void Start()
 {
     playerData = GameObject.FindGameObjectWithTag("PlayerData").GetComponent<PlayerData>();
     UpdateDamage();
     // Start Destroy timer
     Destroy(gameObject, destroyTime);
 }
开发者ID:221boy221,项目名称:Endless_Runner,代码行数:7,代码来源:BulletsScript.cs


示例10: setSprites

    public void setSprites(PlayerData.Country myCountry)
    {
        int index = 0;

        switch (myCountry) {

        case PlayerData.Country.China:
            index = 0;
            break;
        case PlayerData.Country.Japan:
            index = 1;
            break;
        case PlayerData.Country.Russia:
            index = 2;
            break;
        case PlayerData.Country.USA:
            index = 3;
            break;
        }

        myTorso.sprite = torso[index];
        myFrontArm.sprite = frontArm[index];
        myBackArm.sprite = backArm[index];
        myFrontLeg.sprite = frontLeg[index];
        myBackLeg.sprite = backLeg[index];
    }
开发者ID:302studios,项目名称:ZeroG,代码行数:26,代码来源:CharacterSwap.cs


示例11: OnTriggerEnter

    protected void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Player" && other.name == "Player")
        {
            Player player = other.gameObject.GetComponent<Player>();
            PlayerData data = new PlayerData();

            if (changeScene)
            {
                // if checkpoint changes scene, save values for the new scene
                data.playerPosition = DataManager.Vector3ToString(new Vector3(0, 0, 0));
                // data.levelID = player.CurrentLevel + 1;
            }
            else
            {
                data.playerPosition = DataManager.Vector3ToString(other.gameObject.transform.position);
                // data.levelID = player.CurrentLevel;
            }

            data.playerRotation = DataManager.Vector3ToString(other.gameObject.transform.localEulerAngles);
            data.playerScale = DataManager.Vector3ToString(other.gameObject.transform.localScale);
            data.playerEnergy = other.gameObject.GetComponent<Player>().LightEnergy.CurrentEnergy;
            DataManager.SaveFile(data);

            if (changeScene)
            {
                StartCoroutine(ChangeLevel());
            }
        }
    }
开发者ID:FeedJonathanFoundation,项目名称:ubisoft-game-lab,代码行数:30,代码来源:Checkpoint.cs


示例12: ReadDBFile

 void ReadDBFile(string file)
 {
     try
     {
         using(StreamReader sr = new StreamReader(Application.persistentDataPath + "/" + file))
         {
             //Leo linea a linea el contenido del archivo
             string line;
             //Mientras la linea tenga informacion, parceo su contenido
             while((line = sr.ReadLine()) != null)
             {
                 tmpData = line.Split('|');
                 playerData = new PlayerData(int.Parse(tmpData[0]), tmpData[1], DateTime.Parse(tmpData[2]));
             }
         }
     }
     catch(Exception e)
     {
         Debug.LogWarning("El archivo " + file + " no puede ser leido : " + e.Message);
         playerData = new PlayerData();
         playerData.items = 0;
         playerData.name = "";
         playerData.ultimaPartida = DateTime.Now;
         SavePlayerData();
     }
 }
开发者ID:salvadorlemus,项目名称:GoogleAnalytics,代码行数:26,代码来源:DataManager.cs


示例13: Save

	public static void Save(PlayerData data) {
		Stream stream = File.Open (currentFilePath, FileMode.Create);
		BinaryFormatter formatter = new BinaryFormatter ();
		formatter.Binder = new VersionDeserializationBinder ();
		formatter.Serialize (stream, data);
		stream.Close ();
	}
开发者ID:DreamSea,项目名称:GuiShips,代码行数:7,代码来源:PlayerData.cs


示例14: Awake

 void Awake()
 {
     playerData = GameObject.FindGameObjectWithTag("PlayerData").GetComponent<PlayerData>();
     ApplyUpgrades();
     ammo = _maxAmmo;
     UpdateUI();
 }
开发者ID:221boy221,项目名称:Endless_Runner,代码行数:7,代码来源:WeaponShoot.cs


示例15: Clone

 /// <summary>
 /// 自分と同じ内容のオブジェクトを作成し、返却する関数
 /// </summary>
 /// <param name="obj"></param>
 public PlayerData Clone()
 {
     PlayerData obj = new PlayerData();
     obj.attack = this.attack;
     obj.characterNumber = this.characterNumber;
     obj.defense = this.defense;
     obj.HP = this.HP;
     obj.intelligence = this.intelligence;
     obj.job = this.job;
     obj.logoutScene = logoutScene;
     obj.Lv = this.Lv;
     obj.nowExp = this.nowExp;
     obj.magicAttack = this.magicAttack;
     obj.magicDefence = this.magicDefence;
     obj.MaxHP = this.MaxHP;
     obj.MaxSP = this.MaxSP;
     obj.mnd = this.mnd;
     obj.name = (string)this.name.Clone();
     obj.skillLevel = new int[20];
     for (int i = 0; i < 20; i++)
     {
         obj.skillLevel[i] = this.skillLevel[i];
     }
     obj.skillPoint = this.skillPoint;
     obj.SP = this.SP;
     obj.statusPoint = this.statusPoint;
     obj.str = this.str;
     obj.vit = this.vit;
     obj.x = this.x;
     obj.y = this.y;
     obj.z = this.z;
     return obj;
 }
开发者ID:GochiMMO,项目名称:MMO,代码行数:37,代码来源:PlayerData.cs


示例16: Save

	public void Save(PlayerData data){
		BinaryFormatter bf = new BinaryFormatter ();
		FileStream file = File.Create (Application.persistentDataPath + "/Save.sav");

		bf.Serialize (file, data);
		file.Close ();
	}
开发者ID:imann24,项目名称:cs327-bestmobilegameever,代码行数:7,代码来源:SaveLoad.cs


示例17: Awake

 /*
 public Text textFR;
 public Text textDmg;
 public Text textAmmo;
 */
 void Awake()
 {
     if (Time.timeScale == 0) {
         Time.timeScale = 1;
     }
     playerData = GameObject.FindGameObjectWithTag("PlayerData").GetComponent<PlayerData>();
 }
开发者ID:221boy221,项目名称:Endless_Runner,代码行数:12,代码来源:GamePause.cs


示例18: Start

	// Use this for initialization
	void Start () 
	{
		GameObject tempObj = GameObject.Find("PlayerData");
		if (tempObj == null)
		{
			petIndex = 2;
		}
		else
		{
			playerData = tempObj.GetComponent<PlayerData>();
			print("Selected character: " + playerData.selectedPet);
			petIndex = playerData.selectedPet;
		}
		for (int i = 0; i < pets.Length; i++)
		{
			pets[i].SetActive(false);
			if (i == petIndex)
			{
				pets[i].SetActive(true);
				currentPet = pets[i];
			}
		}
		if (camera != null) 
		{
			camera.GetComponent<CameraController>().target = currentPet.transform;
		}
	}
开发者ID:rtorgy,项目名称:FlexPets,代码行数:28,代码来源:LoadPlayerData.cs


示例19: SendName

 public void SendName(string name, NetworkMessageInfo info)
 {
     PlayerData player = new PlayerData();
     player.name = name;
     player.player = info.sender;
     int playerIndex = -1;
     for (int i = 0; i < MAX_PLAYERS; i++)
     {
         if (players[i] == null)
         {
             playerIndex = i;
             break;
         }
     }
     if (playerIndex >= 0)
     {
         players[playerIndex] = player;
         GameObject chatObject = GameObject.FindGameObjectWithTag("Chat");
         if (chatObject != null)
         {
             Chat2 chat = chatObject.GetComponent<Chat2>();
             if (chat != null)
             {
                 chat.SendMessage("Joined: " + player.name);
             }
         }
         Debug.Log("PLAYER LOGGED IN AS " + player.name);
     }
     else
     {
         Debug.Log("CANNOT LOG IN PLAYER -- ALL SLOTS TAKEN");
     }
 }
开发者ID:hellwilliam,项目名称:DonkeyKongRemake,代码行数:33,代码来源:Connect.cs


示例20: PlayerSelector

    PlayerSelector ps; //An instance of the script PlayerSelector (handles how the panels behave)

    #endregion Fields

    #region Methods

    //Function to load the main game scene
    public void LoadLevel(string name)
    {
        PlayerData[] _PlayerData = new PlayerData[num_players]; //Change The player1move to an array
        for(int i = 0; i < num_players; i++)
        {
            switch (i)
            {
                case 0:
                    player1move.CreatePlayerData();
                    _PlayerData[i] = player1move.ThisPlayerData;
                    break;
                case 1:
                    player2move.CreatePlayerData();
                    _PlayerData[i] = player2move.ThisPlayerData;
                    break;
                case 2:
                    player3move.CreatePlayerData();
                    _PlayerData[i] = player3move.ThisPlayerData;
                    break;
                case 3:
                    player4move.CreatePlayerData();
                    _PlayerData[i] = player4move.ThisPlayerData;
                    break;
            }
        }

        Data.selectCars(_PlayerData);
        Invoke("StartGame", 1);
    }
开发者ID:JeanPascalEvette,项目名称:DodgeThisRacing,代码行数:36,代码来源:LevelManager.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PlayerFlag类代码示例发布时间:2022-05-24
下一篇:
C# PlayerController类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap