コード例 #1
0
ファイル: Item.cs プロジェクト: Shirkie01/Nitrox
        private void RemoveAnyRemoteControl(GameObject gameObject)
        {
            // Some items might be remotely simulated if they were dropped by other players.  We'll want to remove
            // any remote tracking when we actively handle the item.
            RemotelyControlled remotelyControlled = gameObject.GetComponent <RemotelyControlled>();

            Object.Destroy(remotelyControlled);
        }
コード例 #2
0
        private void RemoveRemoteController(NitroxId id)
        {
            Optional <GameObject> gameObject = NitroxEntity.GetObjectFrom(id);

            if (gameObject.HasValue)
            {
                RemotelyControlled remotelyControlled = gameObject.Value.GetComponent <RemotelyControlled>();
                Object.Destroy(remotelyControlled);
            }
        }
コード例 #3
0
        public override void Process(EntityTransformUpdates packet)
        {
            foreach (EntityTransformUpdate entity in packet.Updates)
            {
                Optional <GameObject> opGameObject = NitroxEntity.GetObjectFrom(entity.Id);

                if (!opGameObject.HasValue)
                {
                    continue;
                }

                RemotelyControlled remotelyControlled = opGameObject.Value.GetComponent <RemotelyControlled>();

                if (!remotelyControlled)
                {
                    remotelyControlled = opGameObject.Value.AddComponent <RemotelyControlled>();
                }

                remotelyControlled.UpdateOrientation(entity.Position.ToUnity(), entity.Rotation.ToUnity());
            }
        }