Example #1
0
 public PlayerAvatarAction(PlayerIDFlag playerID, AvatarActionType type, AvatarAction action, GameObject target)
 {
     PlayerID   = playerID;
     ActionType = type;
     Action     = action;
     Target     = target;
 }
Example #2
0
 public PlayerAvatarAction(PlayerIDFlag playerID, AvatarActionType type, AvatarAction action)
 {
     PlayerID   = playerID;
     ActionType = type;
     Action     = action;
     Target     = null;
 }
Example #3
0
        public void CreateLocalPlayer()
        {
            PlayerIDFlag ID = PlayerIDFlag.Player01;                                    //get remote ID
            GameObject   localPlayerBaseObject = GameObject.Instantiate(LocalPlayerBasePrefab) as GameObject;

            localPlayerBaseObject.transform.parent = transform;
            localPlayerBaseObject.name             = "LocalPlayer";
            LocalPlayer localPlayer = localPlayerBaseObject.AddComponent <LocalPlayer>();

            mPlayers.Add(ID, localPlayer);
            localPlayer.ID    = ID;
            localPlayer.Group = WIGroups.GetOrAdd(ID.ToString(), WIGroups.Get.Player, localPlayer);
            localPlayer.Body  = Characters.Get.PlayerBody(localPlayer);

            Local = localPlayer;
            //local player will initialize itself after finding/creating all its parts
        }
Example #4
0
        public PlayerBase CreateRemotePlayer(string remoteCharacterData)
        {
            //creates a remote player object
            //adds it to the lookup
            //creates its body
            //creates its group
            PlayerIDFlag ID           = PlayerIDFlag.Player01;                          //get remote ID
            RemotePlayer remotePlayer = gameObject.CreateChild(ID.ToString()).gameObject.AddComponent <RemotePlayer>();

            mPlayers.Add(ID, remotePlayer);
            remotePlayer.ID    = ID;
            remotePlayer.Group = WIGroups.GetOrAdd(ID.ToString(), WIGroups.Get.Player, remotePlayer);
            remotePlayer.Body  = Characters.Get.PlayerBody(remotePlayer);

            return(remotePlayer);
            //remote player will initialize itself after finding/creating all its parts
        }
Example #5
0
 public static bool ByID(PlayerIDFlag ID, out PlayerBase player)
 {
     return(Get.mPlayers.TryGetValue(ID, out player));
 }