当前位置: 首页>>代码示例>>C#>>正文


C# MyCharacter.GetPlayerIdentityId方法代码示例

本文整理汇总了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;
        }
开发者ID:Chrus,项目名称:SpaceEngineers,代码行数:15,代码来源:MySessionComponentResearch.cs

示例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);

        }
开发者ID:Rynchodon,项目名称:SpaceEngineers,代码行数:89,代码来源:MyCockpit.cs

示例3: ResetResearch

        public void ResetResearch(MyCharacter character)
        {
            if (character == null)
                return;

            ResetResearch(character.GetPlayerIdentityId());
        }
开发者ID:Chrus,项目名称:SpaceEngineers,代码行数:7,代码来源:MySessionComponentResearch.cs

示例4: IsResearchUnlocked

        public bool IsResearchUnlocked(MyCharacter character, MyDefinitionId id)
        {
            if (character == null)
                return true;

            return IsResearchUnlocked(character.GetPlayerIdentityId(), id);
        }
开发者ID:Chrus,项目名称:SpaceEngineers,代码行数:7,代码来源:MySessionComponentResearch.cs

示例5: CanUse

        public bool CanUse(MyCharacter character, MyDefinitionId id)
        {
            if (character == null)
                return true;

            return CanUse(character.GetPlayerIdentityId(), id);
        }
开发者ID:Chrus,项目名称:SpaceEngineers,代码行数:7,代码来源:MySessionComponentResearch.cs

示例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;
        }
开发者ID:Chrus,项目名称:SpaceEngineers,代码行数:21,代码来源:MySessionComponentResearch.cs

示例7: TryGetResearch

        public bool TryGetResearch(MyCharacter character, out HashSet<MyDefinitionId> research)
        {
            if (character == null)
            {
                research = null;
                return false;
            }

            return TryGetResearch(character.GetPlayerIdentityId(), out research);
        }
开发者ID:Chrus,项目名称:SpaceEngineers,代码行数:10,代码来源:MySessionComponentResearch.cs


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