本文整理汇总了C#中Sandbox.Game.Entities.Character.MyCharacter.GetPlayerIdentityId方法的典型用法代码示例。如果您正苦于以下问题:C# MyCharacter.GetPlayerIdentityId方法的具体用法?C# MyCharacter.GetPlayerIdentityId怎么用?C# MyCharacter.GetPlayerIdentityId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sandbox.Game.Entities.Character.MyCharacter
的用法示例。
在下文中一共展示了MyCharacter.GetPlayerIdentityId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DebugUnlockAllResearch
public void DebugUnlockAllResearch(MyCharacter character)
{
if (character == null)
return;
long identityId = character.GetPlayerIdentityId();
HashSet<MyDefinitionId> unlockedItems;
if (!m_unlockedResearch.TryGetValue(identityId, out unlockedItems))
unlockedItems = new HashSet<MyDefinitionId>();
foreach (var research in m_requiredResearch)
unlockedItems.Add(research);
m_unlockedResearch[identityId] = unlockedItems;
}
示例2: AttachPilot
public void AttachPilot(MyCharacter pilot, bool storeOriginalPilotWorld = true, bool calledFromInit = false, bool merged = false)
{
System.Diagnostics.Debug.Assert(pilot != null);
System.Diagnostics.Debug.Assert(m_pilot == null);
if (Sync.IsServer)
{
MyMultiplayer.ReplicateImmediatelly(MyExternalReplicable.FindByObject(pilot), MyExternalReplicable.FindByObject(this.CubeGrid));
}
MyAnalyticsHelper.ReportActivityStart(pilot, "cockpit", "cockpit", string.Empty, string.Empty);
m_pilot = pilot;
m_pilot.OnMarkForClose += m_pilotClosedHandler;
m_pilot.IsUsing = this;
if (storeOriginalPilotWorld)
{
m_pilotRelativeWorld.Value = (Matrix)MatrixD.Multiply(pilot.WorldMatrix, this.PositionComp.WorldMatrixNormalizedInv);
}
if (pilot.InScene)
MyEntities.Remove(pilot);
m_pilot.Physics.Enabled = false;
m_pilot.PositionComp.SetWorldMatrix(WorldMatrix, this);
m_pilot.Physics.Clear();
//m_pilot.SetPosition(GetPosition() - WorldMatrix.Forward * 0.5f);
if (!Hierarchy.Children.Any(x => x.Entity == m_pilot)) //may contain after load
Hierarchy.AddChild(m_pilot, true, true);
var gunEntity = m_pilot.CurrentWeapon as MyEntity;
if (gunEntity != null && !m_forgetTheseWeapons.Contains(m_pilot.CurrentWeapon.DefinitionId))
{
m_pilotGunDefinition = m_pilot.CurrentWeapon.DefinitionId;
}
else
m_pilotGunDefinition = null;
MyAnimationDefinition animationDefinition;
MyDefinitionId id = new MyDefinitionId(typeof(MyObjectBuilder_AnimationDefinition), BlockDefinition.CharacterAnimation);
if (!MyDefinitionManager.Static.TryGetDefinition(id, out animationDefinition) && !MyFileSystem.FileExists(BlockDefinition.CharacterAnimation))
{
BlockDefinition.CharacterAnimation = null;
}
m_pilotFirstPerson = pilot.IsInFirstPersonView;
PlacePilotInSeat(pilot);
m_pilot.SuitBattery.ResourceSink.TemporaryConnectedEntity = this;
m_rechargeSocket.PlugIn(m_pilot.SuitBattery.ResourceSink);
if (pilot.ControllerInfo.Controller != null)
{
Sync.Players.SetPlayerToCockpit(pilot.ControllerInfo.Controller.Player, this);
}
// Control should be handled elsewhere if we initialize the grid in the Init(...)
if (!calledFromInit)
{
GiveControlToPilot();
m_pilot.SwitchToWeapon(null);
}
if (Sync.IsServer)
{
m_attachedCharacterId.Value = m_pilot.EntityId;
m_storeOriginalPlayerWorldMatrix.Value = storeOriginalPilotWorld;
}
var jetpack = m_pilot.JetpackComp;
if (jetpack != null)
{
m_pilotJetpackEnabledBackup = jetpack.TurnedOn;
m_pilot.JetpackComp.TurnOnJetpack(false);
}
else
{
m_pilotJetpackEnabledBackup = null;
}
m_lastPilot = pilot;
if (GetInCockpitSound != MySoundPair.Empty && !calledFromInit && !merged)
PlayUseSound(true);
m_playIdleSound = true;
if(MyVisualScriptLogicProvider.PlayerEnteredCockpit != null)
MyVisualScriptLogicProvider.PlayerEnteredCockpit(Name, pilot.GetPlayerIdentityId(), CubeGrid.Name);
}
示例3: ResetResearch
public void ResetResearch(MyCharacter character)
{
if (character == null)
return;
ResetResearch(character.GetPlayerIdentityId());
}
示例4: IsResearchUnlocked
public bool IsResearchUnlocked(MyCharacter character, MyDefinitionId id)
{
if (character == null)
return true;
return IsResearchUnlocked(character.GetPlayerIdentityId(), id);
}
示例5: CanUse
public bool CanUse(MyCharacter character, MyDefinitionId id)
{
if (character == null)
return true;
return CanUse(character.GetPlayerIdentityId(), id);
}
示例6: UnlockResearch
public bool UnlockResearch(MyCharacter character, MyDefinitionId id)
{
Debug.Assert(Sync.IsServer);
if (character == null)
return false;
var definition = MyDefinitionManager.Static.GetDefinition(id);
SerializableDefinitionId serializableId = id;
if (CanUnlockResearch(character.GetPlayerIdentityId(), definition))
{
MyMultiplayer.RaiseStaticEvent(x => UnlockResearchSuccess, character.GetPlayerIdentityId(), serializableId);
return true;
}
else if (character.ControllerInfo.Controller != null)
{
var endpoint = new EndpointId(character.ControllerInfo.Controller.Player.Client.SteamUserId);
MyMultiplayer.RaiseStaticEvent(x => UnlockResearchFailed, serializableId, targetEndpoint: endpoint);
}
return false;
}
示例7: TryGetResearch
public bool TryGetResearch(MyCharacter character, out HashSet<MyDefinitionId> research)
{
if (character == null)
{
research = null;
return false;
}
return TryGetResearch(character.GetPlayerIdentityId(), out research);
}