Skip to content

Commit

Permalink
added fov control, added scale use or assume mode for loaded objects
Browse files Browse the repository at this point in the history
  • Loading branch information
dooly123 committed Feb 25, 2025
1 parent 2f0a359 commit f79a44d
Show file tree
Hide file tree
Showing 24 changed files with 3,403 additions and 4,142 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ public struct LocalLoadResource
public float ScaleZ;

public bool Persist;
/// <summary>
/// this is used to state if the scale should be set or
/// just use whatever scale it thinks it is.
/// </summary>
public bool ModifyScale;
//will never remove this item from the server,
//if off when player count on server is zero it will be removed.
public void Deserialize(NetDataReader Writer)
Expand All @@ -44,6 +49,7 @@ public void Deserialize(NetDataReader Writer)
BundleURL = Writer.GetString();
IsLocalLoad = Writer.GetBool();
Persist = Writer.GetBool();
ModifyScale = Writer.GetBool();
if (Mode == 0)
{
PositionX = Writer.GetFloat();
Expand All @@ -69,6 +75,7 @@ public void Serialize(NetDataWriter Writer)
Writer.Put(BundleURL);
Writer.Put(IsLocalLoad);
Writer.Put(Persist);
Writer.Put(ModifyScale);
if (Mode == 0)
{
Writer.Put(PositionX);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class BasisLoadableConfiguration
public float ScaleZ = 1f;

public bool Persist = false;

public bool ModifyScale;
public static BasisLoadableConfiguration[] LoadAllFromFolder(string folderPath)
{
if (!Directory.Exists(folderPath))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public static LocalLoadResource FromBasisLoadableConfiguration(BasisLoadableConf
ScaleX = config.ScaleX,
ScaleY = config.ScaleY,
ScaleZ = config.ScaleZ,
Persist = config.Persist
Persist = config.Persist,
ModifyScale = config.ModifyScale
};
}
public const string exampleXml = @"<BasisLoadableConfiguration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ MonoBehaviour:
m_DefaultGroup: 37c75a6cf72db324eb01200602299fc8
m_currentHash:
serializedVersion: 2
Hash: 920aad7d21db81c2fc8af62e86b03f62
Hash: 00000000000000000000000000000000
m_OptimizeCatalogSize: 0
m_BuildRemoteCatalog: 0
m_CatalogRequestsTimeout: 0
Expand Down
317 changes: 0 additions & 317 deletions Basis/Assets/AddressableAssetsData/link.xml

This file was deleted.

7 changes: 0 additions & 7 deletions Basis/Assets/AddressableAssetsData/link.xml.meta

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static bool RequestSceneLoad(string UnlockPassword, string BundleURL, str
return true;
}

public static bool RequestGameObjectLoad(string UnlockPassword, string BundleURL, string MetaURL, bool IsLocal, Vector3 Position, Quaternion Rotation, Vector3 Scale, bool Persistent, out LocalLoadResource LocalLoadResource)
public static bool RequestGameObjectLoad(string UnlockPassword, string BundleURL, string MetaURL, bool IsLocal, Vector3 Position, Quaternion Rotation, Vector3 Scale, bool Persistent,bool ModifysScale, out LocalLoadResource LocalLoadResource)
{
if (string.IsNullOrEmpty(BundleURL) || string.IsNullOrEmpty(MetaURL) || string.IsNullOrEmpty(UnlockPassword))
{
Expand Down Expand Up @@ -75,6 +75,7 @@ public static bool RequestGameObjectLoad(string UnlockPassword, string BundleURL
ScaleY = Scale.y,
ScaleZ = Scale.z,
Persist = Persistent,
ModifyScale = ModifysScale,
};

LiteNetLib.Utils.NetDataWriter writer = new LiteNetLib.Utils.NetDataWriter();
Expand Down Expand Up @@ -183,7 +184,7 @@ public static async Task<GameObject> SpawnGameObject(LocalLoadResource localLoad
new Vector3(localLoadResource.PositionX, localLoadResource.PositionY, localLoadResource.PositionZ),
new Quaternion(localLoadResource.QuaternionX, localLoadResource.QuaternionY, localLoadResource.QuaternionZ, localLoadResource.QuaternionW),
new Vector3(localLoadResource.ScaleX, localLoadResource.ScaleY, localLoadResource.ScaleZ),
true, BasisNetworkManagement.Instance.transform);
localLoadResource.ModifyScale, BasisNetworkManagement.Instance.transform);

if (reference.TryGetComponent<BasisContentBase>(out BasisContentBase BasisContentBase))
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using Basis.Scripts.Device_Management;
using Basis.Scripts.Drivers;
using BattlePhaze.SettingsManager;

public class SMModuleFOVSettings : SettingsManagerOption
{
public void Awake()
{
BasisLocalCameraDriver.InstanceExists += InstanceExists;
if(BasisLocalCameraDriver.Instance != null)
{
InstanceExists();
}
}
public void OnDestroy()
{
BasisLocalCameraDriver.InstanceExists -= InstanceExists;
}
private void InstanceExists()
{
if (BasisDeviceManagement.IsUserInDesktop())
{
BasisLocalCameraDriver.Instance.Camera.fieldOfView = SelectedFOV;
}
}
public float SelectedFOV = 60;
public override void ReceiveOption(SettingsMenuInput Option, SettingsManager Manager)
{
if (NameReturn(0, Option))
{
if (SliderReadOption(Option, Manager, out SelectedFOV))
{
if (BasisLocalCameraDriver.Instance != null)
{
InstanceExists();
}
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ public override void ReceiveOption(SettingsMenuInput Option, SettingsManager Man
{
#if UNITY_ANDROID
#else
ChangeOpaque(Option.SelectedValue);
// ChangeOpaque(Option.SelectedValue);
#endif
QualitySettings.SetQualityLevel(QualitySettings.GetQualityLevel(), true);
}
if (NameReturn(1, Option))
{
#if UNITY_ANDROID
#else
ChangeDepth(Option.SelectedValue);
// ChangeDepth(Option.SelectedValue);
#endif
QualitySettings.SetQualityLevel(QualitySettings.GetQualityLevel(), true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public class BasisHamburgerMenu : BasisUIBase
{
public Button Settings;
public Button AvatarButton;
public Button CloseUI;
public Button FullBody;
public Button Respawn;
public static string MainMenuAddressableID = "MainMenu";
Expand All @@ -26,7 +25,6 @@ public override void InitalizeEvent()
Instance = this;
Settings.onClick.AddListener(SettingsPanel);
AvatarButton.onClick.AddListener(AvatarButtonPanel);
CloseUI.onClick.AddListener(CloseThisMenu);
FullBody.onClick.AddListener(PutIntoCalibrationMode);
Respawn.onClick.AddListener(RespawnLocalPlayer);
BasisCursorManagement.UnlockCursor(nameof(BasisHamburgerMenu));
Expand Down
Loading

0 comments on commit f79a44d

Please sign in to comment.