idk whar i did
This commit is contained in:
13
.idea/.idea.BoneSync/.idea/.gitignore
generated
vendored
Normal file
13
.idea/.idea.BoneSync/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Rider ignored files
|
||||||
|
/contentModel.xml
|
||||||
|
/.idea.BoneSync.iml
|
||||||
|
/projectSettingsUpdater.xml
|
||||||
|
/modules.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
4
.idea/.idea.BoneSync/.idea/encodings.xml
generated
Normal file
4
.idea/.idea.BoneSync/.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||||
|
</project>
|
||||||
8
.idea/.idea.BoneSync/.idea/indexLayout.xml
generated
Normal file
8
.idea/.idea.BoneSync/.idea/indexLayout.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="UserContentModel">
|
||||||
|
<attachedFolders />
|
||||||
|
<explicitIncludes />
|
||||||
|
<explicitExcludes />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/.idea.BoneSync/.idea/vcs.xml
generated
Normal file
6
.idea/.idea.BoneSync/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -209,14 +209,21 @@ namespace BoneSync.Data
|
|||||||
{
|
{
|
||||||
WriteVector3(value.position);
|
WriteVector3(value.position);
|
||||||
WriteQuaternion(value.rotation);
|
WriteQuaternion(value.rotation);
|
||||||
WriteVector3(value.scale);
|
WriteBool(value.scale.HasValue);
|
||||||
|
if (value.scale.HasValue)
|
||||||
|
WriteVector3(value.scale.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SimpleSyncTransform ReadSimpleTransform()
|
public SimpleSyncTransform ReadSimpleTransform()
|
||||||
{
|
{
|
||||||
Vector3 position = ReadVector3();
|
Vector3 position = ReadVector3();
|
||||||
Quaternion rotation = ReadQuaternion();
|
Quaternion rotation = ReadQuaternion();
|
||||||
Vector3 scale = ReadVector3();
|
bool hasScale = ReadBool();
|
||||||
|
Vector3? scale = null;
|
||||||
|
if (hasScale)
|
||||||
|
{
|
||||||
|
scale = ReadVector3();
|
||||||
|
}
|
||||||
return new SimpleSyncTransform()
|
return new SimpleSyncTransform()
|
||||||
{
|
{
|
||||||
position = position,
|
position = position,
|
||||||
|
|||||||
@@ -10,23 +10,23 @@ namespace BoneSync.Data
|
|||||||
|
|
||||||
public static class SimpleTransformExtensions
|
public static class SimpleTransformExtensions
|
||||||
{
|
{
|
||||||
public static void ApplySimpleTransform(this UnityEngine.Transform transform, SimpleSyncTransform simpleTransform)
|
public static void ApplySimpleTransform(this Transform transform, SimpleSyncTransform simpleTransform)
|
||||||
{
|
{
|
||||||
transform.position = simpleTransform.position;
|
transform.position = simpleTransform.position;
|
||||||
transform.rotation = simpleTransform.rotation;
|
transform.rotation = simpleTransform.rotation;
|
||||||
transform.localScale = simpleTransform.scale;
|
if (simpleTransform.scale.HasValue) transform.localScale = simpleTransform.scale.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public struct SimpleSyncTransform
|
public struct SimpleSyncTransform
|
||||||
{
|
{
|
||||||
public Vector3 position;
|
public Vector3 position;
|
||||||
public Quaternion rotation;
|
public Quaternion rotation;
|
||||||
public Vector3 scale;
|
public Vector3? scale;
|
||||||
public SimpleSyncTransform(UnityEngine.Transform transform)
|
public SimpleSyncTransform(Transform transform, bool withScale = true)
|
||||||
{
|
{
|
||||||
position = transform.position;
|
position = transform.position;
|
||||||
rotation = transform.rotation;
|
rotation = transform.rotation;
|
||||||
scale = transform.localScale;
|
scale = withScale ? transform.localScale : (Vector3?)null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,10 +70,16 @@ namespace BoneSync.Networking.LobbyManager
|
|||||||
get;
|
get;
|
||||||
private set;
|
private set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private SteamId[] _steamIds;
|
||||||
public SteamId[] steamIds
|
public SteamId[] steamIds
|
||||||
{
|
{
|
||||||
get;
|
get => _steamIds;
|
||||||
private set;
|
private set
|
||||||
|
{
|
||||||
|
_steamIds = value;
|
||||||
|
_peersCache = _steamIds.Select(x => x.Value).ToArray();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool IsConnected()
|
public override bool IsConnected()
|
||||||
@@ -81,7 +87,8 @@ namespace BoneSync.Networking.LobbyManager
|
|||||||
return _lobbyInstance.Id.IsValid;
|
return _lobbyInstance.Id.IsValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ulong[] GetPeers() => steamIds.Select(x => x.Value).ToArray();
|
private ulong[] _peersCache = new ulong[0];
|
||||||
|
public override ulong[] GetPeers() => _peersCache;
|
||||||
public override ulong GetLocalId() => SteamClient.SteamId.Value;
|
public override ulong GetLocalId() => SteamClient.SteamId.Value;
|
||||||
public override ulong GetHostId() => _lobbyInstance.Owner.Id.Value;
|
public override ulong GetHostId() => _lobbyInstance.Owner.Id.Value;
|
||||||
public override ulong GetLobbyId() => _lobbyInstance.Id.Value;
|
public override ulong GetLobbyId() => _lobbyInstance.Id.Value;
|
||||||
@@ -91,6 +98,8 @@ namespace BoneSync.Networking.LobbyManager
|
|||||||
LobbyMembers = _lobbyInstance.Members.ToArray();
|
LobbyMembers = _lobbyInstance.Members.ToArray();
|
||||||
steamIds = LobbyMembers.Select(x => x.Id).ToArray();
|
steamIds = LobbyMembers.Select(x => x.Id).ToArray();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (_lobbyInstance.Id.IsValid)
|
if (_lobbyInstance.Id.IsValid)
|
||||||
{
|
{
|
||||||
SteamFriends.SetRichPresence("steam_display", "BoneSync - " + SceneSync.CurrentSceneDisplayName);
|
SteamFriends.SetRichPresence("steam_display", "BoneSync - " + SceneSync.CurrentSceneDisplayName);
|
||||||
|
|||||||
@@ -46,10 +46,7 @@ namespace BoneSync.Networking
|
|||||||
|
|
||||||
public class AlwaysExecuteAttribute : Attribute
|
public class AlwaysExecuteAttribute : Attribute
|
||||||
{
|
{
|
||||||
public AlwaysExecuteAttribute()
|
public AlwaysExecuteAttribute() {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class NetworkMessage
|
public abstract class NetworkMessage
|
||||||
|
|||||||
@@ -157,9 +157,9 @@ namespace BoneSync.Player
|
|||||||
PlayerSyncInfo playerSyncInfo = new PlayerSyncInfo()
|
PlayerSyncInfo playerSyncInfo = new PlayerSyncInfo()
|
||||||
{
|
{
|
||||||
rootPos = localRigSkeletonRoot.position,
|
rootPos = localRigSkeletonRoot.position,
|
||||||
headPos = new SimpleSyncTransform(localRigHeadTransform),
|
headPos = new SimpleSyncTransform(localRigHeadTransform, false),
|
||||||
leftHandPos = new SimpleSyncTransform(localRigLeftHandTransform),
|
leftHandPos = new SimpleSyncTransform(localRigLeftHandTransform, false),
|
||||||
rightHandPos = new SimpleSyncTransform(localRigRightHandTransform),
|
rightHandPos = new SimpleSyncTransform(localRigRightHandTransform, false),
|
||||||
//leftHandFingerCurl = new SimpleFingerCurl(PlayerScripts.playerLeftHand.fingerCurl),
|
//leftHandFingerCurl = new SimpleFingerCurl(PlayerScripts.playerLeftHand.fingerCurl),
|
||||||
//rightHandFingerCurl = new SimpleFingerCurl(PlayerScripts.playerRightHand.fingerCurl)
|
//rightHandFingerCurl = new SimpleFingerCurl(PlayerScripts.playerRightHand.fingerCurl)
|
||||||
poseIndexLeft = SkeletonHandPatches.poseIndexLeft,
|
poseIndexLeft = SkeletonHandPatches.poseIndexLeft,
|
||||||
|
|||||||
@@ -289,6 +289,7 @@ namespace BoneSync.Sync.Components
|
|||||||
{
|
{
|
||||||
AlignPlug alignPlug = plugs[i];
|
AlignPlug alignPlug = plugs[i];
|
||||||
if (alignPlug.GetSocket()) return true;
|
if (alignPlug.GetSocket()) return true;
|
||||||
|
if (alignPlug._isExitTransition || alignPlug._isEnterTransition) return true; // if plug is in transition, consider it plugged
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,11 +157,15 @@ namespace BoneSync.Sync.Components
|
|||||||
Rigidbody rb = rigidbodies[i];
|
Rigidbody rb = rigidbodies[i];
|
||||||
rb.angularVelocity = objectSyncTransform.angularVelocity;
|
rb.angularVelocity = objectSyncTransform.angularVelocity;
|
||||||
rb.velocity = objectSyncTransform.velocity;
|
rb.velocity = objectSyncTransform.velocity;
|
||||||
|
|
||||||
//rb.MovePosition(objectSyncTransform.transform.position);
|
//rb.MovePosition(objectSyncTransform.transform.position);
|
||||||
//rb.MoveRotation(objectSyncTransform.transform.rotation);
|
//rb.MoveRotation(objectSyncTransform.transform.rotation);
|
||||||
rb.position = objectSyncTransform.transform.position;
|
rb.position = objectSyncTransform.transform.position;
|
||||||
rb.rotation = objectSyncTransform.transform.rotation;
|
rb.rotation = objectSyncTransform.transform.rotation;
|
||||||
_transforms[i].localScale = objectSyncTransform.transform.scale;
|
if (objectSyncTransform.transform.scale.HasValue)
|
||||||
|
{
|
||||||
|
_transforms[i].localScale = objectSyncTransform.transform.scale.Value;
|
||||||
|
}
|
||||||
//_transforms[i].ApplySimpleTransform(objectSyncTransform.transform);
|
//_transforms[i].ApplySimpleTransform(objectSyncTransform.transform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ namespace BoneSync.Sync
|
|||||||
spawnInfo = new SpawnPoolableInfo()
|
spawnInfo = new SpawnPoolableInfo()
|
||||||
{
|
{
|
||||||
spawnableTitle = spawnableTitle,
|
spawnableTitle = spawnableTitle,
|
||||||
spawnLocation = new SimpleSyncTransform(syncable.poolee.transform),
|
spawnLocation = new SimpleSyncTransform(syncable.poolee.transform, false),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user