Example #1
0
        void UseStructVersusClass()
        {
            PlayerDataStruct playerStruct = new PlayerDataStruct();
            PlayerDataClass  playerClass  = new PlayerDataClass();

            playerStruct.HitPoints = 1;
            playerClass.HitPoints  = 1;

            PlayerDataStruct otherPlayerStruct = playerStruct;

            otherPlayerStruct.HitPoints = 3; // change the copied data
            Debug.Log(playerStruct.HitPoints + " and " + otherPlayerStruct.HitPoints);
            // 1 and 3
            PlayerDataClass otherPlayerClass = playerClass;

            otherPlayerClass.HitPoints = 3; // change the copied data, or did we?
            Debug.Log(playerClass.HitPoints + " and " + otherPlayerClass.HitPoints);
            // 3 and 3

            PlayerDataClass anotherPlayerClass = new PlayerDataClass();

            anotherPlayerClass.HitPoints = playerClass.HitPoints;
            anotherPlayerClass.HitPoints = 7;
            Debug.Log(playerClass.HitPoints + ":" +
                      otherPlayerClass.HitPoints + ":" +
                      anotherPlayerClass.HitPoints);
            // 3:3:7
        }
Example #2
0
    public PlayerDataClass Constructor()
    {
        PlayerDataClass capture = new PlayerDataClass();

        capture.networkPlayer = networkPlayer;
        capture.playerName    = playerName;
        capture.playerObj     = playerObj;
        capture.playerScore   = playerScore;
        capture.playerTeam    = playerTeam;
        capture.playerLvl     = playerLvl;
        capture.playerExp     = playerExp;
        capture.kills         = kills;
        capture.deaths        = deaths;
        capture.assist        = assist;
        capture.gold          = gold;

        capture.ad    = ad;
        capture.ap    = ap;
        capture.armor = armor;
        capture.mr    = mr;
        capture.speed = speed;


        return(capture);
    }
Example #3
0
    void AddPlayerToList(NetworkPlayer nPlayer)
    {
        PlayerDataClass capture = new PlayerDataClass();

        capture.networkPlayer = int.Parse(nPlayer.ToString());
        PlayerList.Add(capture);
    }
Example #4
0
    private void GetDefaultData()
    {
        PlayerData = game_controller.instance.SlotSettings.PlayerDefault;
        string json = JsonUtility.ToJson(PlayerData);

        PlayerPrefs.SetString("PlayerData", crypt.data.Encrypt(json));
    }
Example #5
0
 public PlayerDataClass Constructor()
 {
     PlayerDataClass capture = new PlayerDataClass();
     capture.networkPlayer = networkPlayer;
     capture.playerName = playerName;
     capture.playerScore = playerScore;
     capture.playerTeam = playerTeam;
     return capture;
 }
    public PlayerDataClass Constructor()
    {
        PlayerDataClass capture = new PlayerDataClass();

        capture.networkPlayer = networkPlayer;
        capture.playerName    = playerName;

        return(capture);
    }
Example #7
0
    void AddPlayerToList(NetworkPlayer nPlayer)
    {
        //Create a new entry in the PlayerList and supply the players Network ID as the first entry
        PlayerDataClass capture = new PlayerDataClass();

        capture.networkPlayer = int.Parse(nPlayer.ToString());

        PlayerList.Add (capture);
    }
    void AddPlayerToTheList(NetworkPlayer nPlayer, string pName)
    {
        PlayerDataClass player = new PlayerDataClass();

        player.networkPlayer = nPlayer;

        player.playerName = pName;

        playerList.Add(player);
    }
 public void Save()
 {
     Debug.Log ("Saved Game");
     BinaryFormatter bf = new BinaryFormatter ();
     FileStream file = File.Create (Application.persistentDataPath + "/playerInfo.dat");
     PlayerDataClass data = new PlayerDataClass();
     data.levelReached = levelReached;
     bf.Serialize (file, data);
     file.Close ();
 }
    void AddPlayerToList(NetworkPlayer nPlayer)
    {
        // Create a new entry in the PlayerList and supply the player's network ID
        // as the first entry

        PlayerDataClass capture = new PlayerDataClass();

        capture.networkPlayer = int.Parse(nPlayer.ToString());
        PlayerList.Add(capture);
    }
    //Varibles End -----------------------------------------------------
    public PlayerDataClass Constructor()
    {
        PlayerDataClass player = new PlayerDataClass();

        player.networkPlayer = networkPlayer;

        player.playerName = playerName;

        player.team = team;

        return player;
    }
Example #12
0
 void AddPlayerOnClients(uLink.NetworkPlayer nPlayer, string pName)
 {
     if (PlayerList.Exists(x => x.networkPlayer == nPlayer))
     {
     }
     else
     {
         PlayerDataClass capture = new PlayerDataClass();
         capture.networkPlayer = nPlayer;
         capture.playerName    = pName;
         PlayerList.Add(capture);
     }
 }
Example #13
0
 void AddPlayerNameToListPhoton(string pName, PhotonMessageInfo info)
 {
     if (PlayerList.Exists(x => x.playerName == pName))
     {
         Debug.Log("CANT ADD PLAYER NAME TO LIST. PLAYER EXISTS ON THE DATA!!");
     }
     else
     {
         PlayerDataClass capture = new PlayerDataClass();
         capture.networkPlayer = info.sender;
         capture.playerName    = pName;
         PlayerList.Add(capture);
     }
 }
Example #14
0
    void Start()
    {
        {
            /*
             * Section 6.8.2 Structs versus Classes
             */
            PlayerDataStruct playerStruct = new PlayerDataStruct();
            PlayerDataClass  playerClass  = new PlayerDataClass();
            playerStruct.HitPoints = 1;
            playerClass.HitPoints  = 1;

            PlayerDataStruct otherPlayerStruct = playerStruct;
            otherPlayerStruct.HitPoints = 3; // change the copied data
            Debug.Log(playerStruct.HitPoints + " and " + otherPlayerStruct.HitPoints);
            // 1 and 3
            PlayerDataClass otherPlayerClass = playerClass;
            otherPlayerClass.HitPoints = 3; // change the copied data, or did we?
            Debug.Log(playerClass.HitPoints + " and " + otherPlayerClass.HitPoints);
            // 3 and 3

            PlayerDataClass anotherPlayerClass = new PlayerDataClass();
            anotherPlayerClass.HitPoints = playerClass.HitPoints;
            anotherPlayerClass.HitPoints = 7;
            Debug.Log(playerClass.HitPoints + ":" +
                      otherPlayerClass.HitPoints + ":" +
                      anotherPlayerClass.HitPoints);
            // 3:3:7
        }
        {
            /*
             * Section 6.8.3 Without Structs?
             */
            object[] playerDataArray = new object[5]
            {
                new Vector3(),  // Position
                10,             // HitPoints
                13,             // Ammunition
                6.5f,           // Run Speed
                1.2f            // Walk Speed
            };
            object[] copyOfPlayerDataArray = playerDataArray;
            Debug.Log(playerDataArray[1]);
            // 10
            copyOfPlayerDataArray[1] = 1;
            Debug.Log(playerDataArray[1] + ":" + copyOfPlayerDataArray[1]);
            // 1:1
        }
        StartCube();
    }
Example #15
0
    //Accesed by PickSelection script to add the current joined player to the list playerlist
    public void AddPlayerNameToList(string pName, uLink.NetworkPlayer nPlayer)
    {
        if (PlayerList.Exists(x => x.networkPlayer == nPlayer))
        {
        }
        else
        {
            networkView.RPC("AddPlayerOnClients", uLink.RPCMode.OthersBuffered, nPlayer, pName);
            PlayerDataClass capture = new PlayerDataClass();
            capture.networkPlayer = nPlayer;
            capture.playerName    = pName;

            PlayerList.Add(capture);
        }
    }
Example #16
0
    private void LoadData()
    {
        string protect = PlayerPrefs.GetString("PlayerData", "");

        if (protect == "" || protect == null)
        {
            Debug.Log("get def");
            GetDefaultData();
        }
        else
        {
            string json = crypt.data.Decrypt(protect);
            if (json != null)
            {
                PlayerData = JsonUtility.FromJson <PlayerDataClass>(json);
            }
            else
            {
                GetDefaultData();
            }
        }
    }
Example #17
0
    private void Start()
    {
        player_number = LobbyPlayerlist.Instance.current_player_number;
        player_name   = PhotonNetwork.player.NickName;
        gamesystem    = GameSystem.Instance;
        agent         = GetComponent <NavMeshAgent>();
        cardSystem    = UI_CardSystem.Instance;
        agent.enabled = false;
        child         = GetComponentInChildren <Chracter>().gameObject;

        player_chracter = child.GetComponent <Chracter>();
        playerdata      = player_chracter.data;

        currentLocation    = player_chracter.Find_start_location();
        transform.position = currentLocation.transform.position;
        agent.enabled      = true;
        //이름과 번호 동기화
        if (photonView.isMine)
        {
            photonView.RPC("SyncPlayerNameNumber", PhotonTargets.All, player_number, player_name);
        }
    }
Example #18
0
 void AddPlayerToList(NetworkPlayer nPlayer)
 {
     PlayerDataClass capture = new PlayerDataClass();
     capture.networkPlayer = int.Parse (nPlayer.ToString());
     PlayerList.Add (capture);
 }
Example #19
0
	public void ChangeAnimationByActionCmd(PlayerDataClass.PlayerActionCommand cmd, bool immedilate)
=======
Example #20
0
 void ChangeAnimationByActionCmd(PlayerDataClass.PlayerActionCommand cmd, bool immedilate)
 {
     //		Debug.Log("ChangeAnimationByActionCmd =====  "+cmd);
     PlayerDataClass.PlayerNextActionSet(cmd);
     aniControlScript.UpdateCmdFromControl(immedilate);
 }
Example #21
0
	void ChangeAnimationByActionCmd(PlayerDataClass.PlayerActionCommand cmd, bool immedilate)
>>>>>>> parent of 5e133d7... 击退