// Token: 0x06001A9B RID: 6811 RVA: 0x0008B208 File Offset: 0x00089408 private void ConfigureAvatar(GameActorInfo info, CharacterConfig character, bool isLocal) { if (character != null && info != null) { if (isLocal) { this.Player.SetCurrentCharacterConfig(character); this.Player.MoveController.IsLowGravity = GameFlags.IsFlagSet(GameFlags.GAME_FLAGS.LowGravity, this.RoomData.GameFlags); character.Initialize(this.PlayerData, this.Avatar); } else { global::Avatar avatar = new global::Avatar(new Loadout(info.Gear, info.Weapons), false); avatar.SetDecorator(global::AvatarBuilder.CreateRemoteAvatar(avatar.Loadout.GetAvatarGear(), info.SkinColor)); character.Initialize(this.RemotePlayerStates.GetState(info.PlayerId), avatar); GameData.Instance.OnHUDStreamMessage.Fire(info, LocalizedStrings.JoinedTheGame, null); } if (!info.IsAlive) { character.SetDead(Vector3.zero, BodyPart.Body, 0, UberstrikeItemClass.WeaponMachinegun); } } else { Debug.LogError(string.Format("OnAvatarLoaded failed because loaded Avatar is {0} and Info is {1}", character != null, info != null)); } }
// Token: 0x06001865 RID: 6245 RVA: 0x00082D50 File Offset: 0x00080F50 private void SetAvatar(global::Avatar avatar) { if (this.Avatar != null) { this.Avatar.OnDecoratorChanged -= this.OnDecoratorUpdated; } this.Avatar = avatar; this.Avatar.OnDecoratorChanged += this.OnDecoratorUpdated; this.OnDecoratorUpdated(); }
// Token: 0x0600185D RID: 6237 RVA: 0x000828E4 File Offset: 0x00080AE4 public void Initialize(ICharacterState state, global::Avatar avatar) { this.State = state; this.State.OnDeltaUpdate += this.OnDeltaUpdate; this._transform.position = this.State.Position; if (!this.State.Player.IsAlive) { Debug.Log("Initialize as dead player at " + this.State.Position); } base.gameObject.name = string.Format("Player{0}_{1}", this.State.Player.Cmid, this.State.Player.PlayerName); this.SetAvatar(avatar); this.WeaponSimulator.UpdateWeapons((int)this.State.Player.CurrentWeaponSlot, this.State.Player.Weapons); }