mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-20 15:41:01 +00:00
angler transform sync
This commit is contained in:
parent
03314fd4ad
commit
c0e8bd95e4
Binary file not shown.
@ -1,22 +1,16 @@
|
||||
ManifestFileVersion: 0
|
||||
CRC: 3328595786
|
||||
CRC: 3924928763
|
||||
Hashes:
|
||||
AssetFileHash:
|
||||
serializedVersion: 2
|
||||
Hash: b1b55f9f86f72ed72608b36f0729af6d
|
||||
Hash: c99cab0df10436d2efe7dd1be82d453f
|
||||
TypeTreeHash:
|
||||
serializedVersion: 2
|
||||
Hash: 50a27bfc3e679077929938a6fa57f4db
|
||||
Hash: 02c9e7490734663480929abffb75366d
|
||||
HashAppended: 0
|
||||
ClassTypes:
|
||||
- Class: 1
|
||||
Script: {instanceID: 0}
|
||||
- Class: 21
|
||||
Script: {instanceID: 0}
|
||||
- Class: 28
|
||||
Script: {instanceID: 0}
|
||||
- Class: 48
|
||||
Script: {instanceID: 0}
|
||||
- Class: 114
|
||||
Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||
- Class: 114
|
||||
@ -27,10 +21,6 @@ ClassTypes:
|
||||
Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
|
||||
- Class: 115
|
||||
Script: {instanceID: 0}
|
||||
- Class: 128
|
||||
Script: {instanceID: 0}
|
||||
- Class: 213
|
||||
Script: {instanceID: 0}
|
||||
- Class: 222
|
||||
Script: {instanceID: 0}
|
||||
- Class: 223
|
||||
@ -40,5 +30,4 @@ ClassTypes:
|
||||
SerializeReferenceClassIdentifiers: []
|
||||
Assets:
|
||||
- Assets/DialogueBubble.prefab
|
||||
- Assets/GameAssets/Texture2D/UI_DialogueBox_d.png
|
||||
Dependencies: []
|
||||
|
Binary file not shown.
@ -1,9 +1,9 @@
|
||||
ManifestFileVersion: 0
|
||||
CRC: 3095198160
|
||||
CRC: 1546595007
|
||||
Hashes:
|
||||
AssetFileHash:
|
||||
serializedVersion: 2
|
||||
Hash: 44badca86c2222e5cc39a8497439be0c
|
||||
Hash: ed5b355baab9b7042bfd721023c5f671
|
||||
TypeTreeHash:
|
||||
serializedVersion: 2
|
||||
Hash: b2ece8ae09df261ff59d764d08696641
|
||||
|
Binary file not shown.
@ -1,9 +1,9 @@
|
||||
ManifestFileVersion: 0
|
||||
CRC: 1991351671
|
||||
CRC: 460430998
|
||||
Hashes:
|
||||
AssetFileHash:
|
||||
serializedVersion: 2
|
||||
Hash: e0f93ad04981fd266a4300b0be721792
|
||||
Hash: 1b708df8b57f5442fbea4c45a9f17743
|
||||
TypeTreeHash:
|
||||
serializedVersion: 2
|
||||
Hash: 6968c5d2bbef57a79632abd61ea01bb3
|
||||
@ -26,5 +26,6 @@ Assets:
|
||||
- Assets/NetworkProbe.prefab
|
||||
- Assets/NETWORK_Player_Body.prefab
|
||||
- Assets/NetworkOrb.prefab
|
||||
- Assets/NetworkAngler.prefab
|
||||
- Assets/NetworkShip.prefab
|
||||
Dependencies: []
|
||||
|
10
QSB/Anglerfish/AnglerManager.cs
Normal file
10
QSB/Anglerfish/AnglerManager.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using QSB.Anglerfish.WorldObjects;
|
||||
using QSB.WorldSync;
|
||||
|
||||
namespace QSB.Anglerfish
|
||||
{
|
||||
public class AnglerManager : WorldObjectManager
|
||||
{
|
||||
protected override void RebuildWorldObjects(OWScene scene) => QSBWorldSync.Init<QSBAngler, AnglerfishController>();
|
||||
}
|
||||
}
|
11
QSB/Anglerfish/Patches/AnglerPatches.cs
Normal file
11
QSB/Anglerfish/Patches/AnglerPatches.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using QSB.Patches;
|
||||
|
||||
namespace QSB.Anglerfish.Patches
|
||||
{
|
||||
public class AnglerPatches : QSBPatch
|
||||
{
|
||||
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;
|
||||
|
||||
// todo
|
||||
}
|
||||
}
|
38
QSB/Anglerfish/TransformSync/AnglerTransformSync.cs
Normal file
38
QSB/Anglerfish/TransformSync/AnglerTransformSync.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using System.Collections.Generic;
|
||||
using QSB.Anglerfish.WorldObjects;
|
||||
using QSB.Syncs.Unsectored.Rigidbodies;
|
||||
using QSB.WorldSync;
|
||||
|
||||
namespace QSB.Anglerfish.TransformSync
|
||||
{
|
||||
public class AnglerTransformSync : UnsectoredRigidbodySync
|
||||
{
|
||||
public override bool IsReady => QSBCore.WorldObjectsReady;
|
||||
public override bool UseInterpolation => true;
|
||||
protected override OWRigidbody GetRigidbody() => qsbAngler.AttachedObject._anglerBody;
|
||||
|
||||
public QSBAngler qsbAngler;
|
||||
private static readonly List<AnglerTransformSync> _instances = new List<AnglerTransformSync>();
|
||||
public override void Start()
|
||||
{
|
||||
_instances.Add(this);
|
||||
base.Start();
|
||||
}
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
_instances.Remove(this);
|
||||
base.OnDestroy();
|
||||
}
|
||||
|
||||
public override float GetNetworkSendInterval() => 1;
|
||||
|
||||
protected override void Init()
|
||||
{
|
||||
qsbAngler = QSBWorldSync.GetWorldFromId<QSBAngler>(_instances.IndexOf(this));
|
||||
qsbAngler.transformSync = this;
|
||||
|
||||
base.Init();
|
||||
SetReferenceTransform(qsbAngler.AttachedObject._brambleBody._transform);
|
||||
}
|
||||
}
|
||||
}
|
32
QSB/Anglerfish/WorldObjects/QSBAngler.cs
Normal file
32
QSB/Anglerfish/WorldObjects/QSBAngler.cs
Normal file
@ -0,0 +1,32 @@
|
||||
using QSB.Anglerfish.TransformSync;
|
||||
using QSB.Utility;
|
||||
using QSB.WorldSync;
|
||||
using QuantumUNET;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB.Anglerfish.WorldObjects
|
||||
{
|
||||
public class QSBAngler : WorldObject<AnglerfishController>
|
||||
{
|
||||
public AnglerTransformSync transformSync;
|
||||
|
||||
public override void Init(AnglerfishController attachedObject, int id)
|
||||
{
|
||||
ObjectId = id;
|
||||
AttachedObject = attachedObject;
|
||||
|
||||
if (QSBCore.IsHost)
|
||||
{
|
||||
Object.Instantiate(QSBNetworkManager.Instance.AnglerPrefab).SpawnWithServerAuthority();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnRemoval()
|
||||
{
|
||||
if (QSBCore.IsHost)
|
||||
{
|
||||
QNetworkServer.Destroy(transformSync.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -27,6 +27,7 @@ using QSB.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using QSB.Anglerfish.Patches;
|
||||
|
||||
namespace QSB.Patches
|
||||
{
|
||||
@ -71,7 +72,8 @@ namespace QSB.Patches
|
||||
new LauncherPatches(),
|
||||
new SolanumPatches(),
|
||||
new SatelliteProjectorPatches(),
|
||||
new LightSensorPatches()
|
||||
new LightSensorPatches(),
|
||||
new AnglerPatches()
|
||||
};
|
||||
|
||||
TypeToInstance = new Dictionary<QSBPatchTypes, Harmony>
|
||||
@ -110,4 +112,4 @@ namespace QSB.Patches
|
||||
TypeToInstance[type].UnpatchSelf();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,6 +36,10 @@
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Anglerfish\AnglerManager.cs" />
|
||||
<Compile Include="Anglerfish\Patches\AnglerPatches.cs" />
|
||||
<Compile Include="Anglerfish\TransformSync\AnglerTransformSync.cs" />
|
||||
<Compile Include="Anglerfish\WorldObjects\QSBAngler.cs" />
|
||||
<Compile Include="Animation\NPC\AnimationEvent.cs" />
|
||||
<Compile Include="Animation\NPC\CharacterAnimManager.cs" />
|
||||
<Compile Include="Animation\NPC\Events\NpcAnimationEvent.cs" />
|
||||
@ -440,6 +444,9 @@
|
||||
<Version>2.0.0</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Anglerfish\Events" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>md "$(OwmlDir)\Mods\$(ProjectName)"
|
||||
|
@ -27,6 +27,7 @@ using QSB.Tools.ProbeLauncherTool;
|
||||
using QSB.TranslationSync;
|
||||
using QSB.Utility;
|
||||
using QSB.WorldSync;
|
||||
using QSB.Anglerfish;
|
||||
using QuantumUNET;
|
||||
using QuantumUNET.Components;
|
||||
using System.Linq;
|
||||
@ -34,10 +35,10 @@ using UnityEngine;
|
||||
|
||||
/*
|
||||
Copyright (C) 2020 - 2021
|
||||
Henry Pointer (_nebula / misternebula),
|
||||
Aleksander Waage (AmazingAlek),
|
||||
Henry Pointer (_nebula / misternebula),
|
||||
Aleksander Waage (AmazingAlek),
|
||||
Ricardo Lopes (Raicuparta)
|
||||
|
||||
|
||||
This program is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU Affero General Public License
|
||||
as published by the Free Software Foundation, either version 3 of
|
||||
@ -123,6 +124,7 @@ namespace QSB
|
||||
gameObject.AddComponent<ProbeLauncherManager>();
|
||||
gameObject.AddComponent<LightSensorManager>();
|
||||
gameObject.AddComponent<AirlockManager>();
|
||||
gameObject.AddComponent<AnglerManager>();
|
||||
|
||||
DebugBoxManager.Init();
|
||||
|
||||
@ -173,7 +175,7 @@ namespace QSB
|
||||
/*
|
||||
* _nebula's music thanks
|
||||
* I listen to music constantly while programming/working - here's my thanks to them for keeping me entertained :P
|
||||
*
|
||||
*
|
||||
* Wintergatan
|
||||
* HOME
|
||||
* C418
|
||||
@ -195,4 +197,4 @@ namespace QSB
|
||||
* Daft Punk
|
||||
* Natalie Holt
|
||||
* WMD
|
||||
*/
|
||||
*/
|
||||
|
@ -13,6 +13,7 @@ using QSB.Player.TransformSync;
|
||||
using QSB.PoolSync;
|
||||
using QSB.ProbeSync.TransformSync;
|
||||
using QSB.ShipSync.TransformSync;
|
||||
using QSB.Anglerfish.TransformSync;
|
||||
using QSB.TimeSync;
|
||||
using QSB.Utility;
|
||||
using QSB.WorldSync;
|
||||
@ -37,6 +38,7 @@ namespace QSB
|
||||
public bool IsReady { get; private set; }
|
||||
public GameObject OrbPrefab { get; private set; }
|
||||
public GameObject ShipPrefab { get; private set; }
|
||||
public GameObject AnglerPrefab { get; private set; }
|
||||
public string PlayerName { get; private set; }
|
||||
|
||||
private const int MaxConnections = 128;
|
||||
@ -82,6 +84,12 @@ namespace QSB
|
||||
OrbPrefab.AddComponent<NomaiOrbTransformSync>();
|
||||
spawnPrefabs.Add(OrbPrefab);
|
||||
|
||||
AnglerPrefab = _assetBundle.LoadAsset<GameObject>("assets/networkangler.prefab");
|
||||
SetupNetworkId(AnglerPrefab, 5);
|
||||
SetupNetworkTransform(AnglerPrefab);
|
||||
AnglerPrefab.AddComponent<AnglerTransformSync>();
|
||||
spawnPrefabs.Add(AnglerPrefab);
|
||||
|
||||
ConfigureNetworkManager();
|
||||
}
|
||||
|
||||
@ -288,4 +296,4 @@ namespace QSB
|
||||
WorldObjectManager.SetNotReady();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e2241e4bc9f9e994c9d743879f2f5fb2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
89
UnityProject/Assets/NetworkAngler.prefab
Normal file
89
UnityProject/Assets/NetworkAngler.prefab
Normal file
@ -0,0 +1,89 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &4235888882139944903
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2283569403569444943}
|
||||
- component: {fileID: 3221094810666780705}
|
||||
- component: {fileID: 6460324066427500463}
|
||||
m_Layer: 0
|
||||
m_Name: NetworkAngler
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2283569403569444943
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4235888882139944903}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &3221094810666780705
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4235888882139944903}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 372142912, guid: 93b08009869340045a8e7321508b6355, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_SceneId:
|
||||
m_Value: 0
|
||||
m_AssetId:
|
||||
i0: 0
|
||||
i1: 0
|
||||
i2: 0
|
||||
i3: 0
|
||||
i4: 0
|
||||
i5: 0
|
||||
i6: 0
|
||||
i7: 0
|
||||
i8: 0
|
||||
i9: 0
|
||||
i10: 0
|
||||
i11: 0
|
||||
i12: 0
|
||||
i13: 0
|
||||
i14: 0
|
||||
i15: 0
|
||||
m_ServerOnly: 0
|
||||
m_LocalPlayerAuthority: 0
|
||||
--- !u!114 &6460324066427500463
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4235888882139944903}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -1768714887, guid: 93b08009869340045a8e7321508b6355, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_TransformSyncMode: 0
|
||||
m_SendInterval: 0.1
|
||||
m_SyncRotationAxis: 7
|
||||
m_RotationSyncCompression: 0
|
||||
m_SyncSpin: 0
|
||||
m_MovementTheshold: 0.001
|
||||
m_VelocityThreshold: 0.0001
|
||||
m_SnapThreshold: 5
|
||||
m_InterpolateRotation: 1
|
||||
m_InterpolateMovement: 1
|
7
UnityProject/Assets/NetworkAngler.prefab.meta
Normal file
7
UnityProject/Assets/NetworkAngler.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 840ab14be584dfc4584379a776e10ed8
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName: network
|
||||
assetBundleVariant:
|
@ -3,19 +3,33 @@
|
||||
--- !u!159 &1
|
||||
EditorSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 7
|
||||
serializedVersion: 9
|
||||
m_ExternalVersionControlSupport: Hidden Meta Files
|
||||
m_SerializationMode: 2
|
||||
m_LineEndingsForNewScripts: 2
|
||||
m_DefaultBehaviorMode: 0
|
||||
m_PrefabRegularEnvironment: {fileID: 0}
|
||||
m_PrefabUIEnvironment: {fileID: 0}
|
||||
m_SpritePackerMode: 0
|
||||
m_SpritePackerPaddingPower: 1
|
||||
m_EtcTextureCompressorBehavior: 1
|
||||
m_EtcTextureFastCompressor: 1
|
||||
m_EtcTextureNormalCompressor: 2
|
||||
m_EtcTextureBestCompressor: 4
|
||||
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp
|
||||
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref
|
||||
m_ProjectGenerationRootNamespace:
|
||||
m_UserGeneratedProjectSuffix:
|
||||
m_CollabEditorSettings:
|
||||
inProgressEnabled: 1
|
||||
m_EnableTextureStreamingInEditMode: 1
|
||||
m_EnableTextureStreamingInPlayMode: 1
|
||||
m_AsyncShaderCompilation: 1
|
||||
m_EnterPlayModeOptionsEnabled: 0
|
||||
m_EnterPlayModeOptions: 3
|
||||
m_ShowLightmapResolutionOverlay: 1
|
||||
m_UseLegacyProbeSampleCount: 1
|
||||
m_AssetPipelineMode: 0
|
||||
m_CacheServerMode: 0
|
||||
m_CacheServerEndpoint:
|
||||
m_CacheServerNamespacePrefix: default
|
||||
m_CacheServerEnableDownload: 1
|
||||
m_CacheServerEnableUpload: 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user