Skip to content

Commit

Permalink
Minor refactorings
Browse files Browse the repository at this point in the history
Minor refactorings
  • Loading branch information
0x7c13 committed Mar 26, 2022
1 parent 3bb1fe2 commit 38971d9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 33 deletions.
1 change: 0 additions & 1 deletion Assets/Scripts/Core/DataReader/Pol/PolFileReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ private static TagNode ReadTagNodeInfo(BinaryReader reader)
Tx = reader.ReadSingle(), Ty = reader.ReadSingle(), Tz = reader.ReadSingle(), Tw = reader.ReadSingle()
});
var origin = GameBoxInterpreter.ToUnityPosition(transformMatrix.MultiplyPoint(Vector3.zero));
Debug.Log("Transform position from matrix is: " + origin);

var type = reader.ReadInt32();
var customColorStringLength = reader.ReadInt32();
Expand Down
8 changes: 1 addition & 7 deletions Assets/Scripts/Core/Utils/UnsafeBinaryReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
namespace Core.Utils
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
Expand All @@ -19,15 +17,10 @@ namespace Core.Utils
public sealed unsafe class UnsafeBinaryReader : IDisposable
{
private const int GBK_CODE_PAGE = 936; // GBK Encoding's code page

private readonly byte[] _data;

private byte* _dataPtr;

private GCHandle _handle;

private bool _disposedValue;

public UnsafeBinaryReader(byte[] data)
{
_data = data;
Expand Down Expand Up @@ -171,6 +164,7 @@ public void Close()
Dispose(true);
}

private bool _disposedValue;
private void Dispose(bool disposing)
{
if (!_disposedValue)
Expand Down
7 changes: 3 additions & 4 deletions Assets/Scripts/Editor/GameVariantSwitcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ private static void ApplyPlayerSettingsForVariant(string appName)
{
PlayerSettings.productName = appName;
PlayerSettings.companyName = GameConstants.CompanyName;
PlayerSettings.bundleVersion = GameConstants.Version;
PlayerSettings.SetApplicationIdentifier(
EditorUserBuildSettings.selectedBuildTargetGroup,
$"{GameConstants.AppIdentifierPrefix}.{appName}");
PlayerSettings.SetApplicationIdentifier(
EditorUserBuildSettings.selectedBuildTargetGroup,
$"{GameConstants.AppIdentifierPrefix}.{appName}");
// TODO: Add icon based on variant
//PlayerSettings.SetIconsForTargetGroup(BuildTargetGroup.Unknown, icons);
AssetDatabase.SaveAssets();
Expand Down
2 changes: 0 additions & 2 deletions Assets/Scripts/Pal3/MetaData/GameConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ public static class GameConstants
public const string AppNameCNFull = "仙剑奇侠传三外传";
#endif

public const string Version = "0.15";

public const string CompanyName = "OSS";

public const string AppIdentifierPrefix = "com" + "." + CompanyName;
Expand Down
4 changes: 2 additions & 2 deletions Assets/Scripts/Pal3/UI/InformationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private void OnEnable()
$"CPU: {SystemInfo.processorType.Trim()} GPU: {SystemInfo.graphicsDeviceName.Trim()}\n" +
$"RAM: {SystemInfo.systemMemorySize / 1024f:0.0} GB VRAM: {SystemInfo.graphicsMemorySize / 1024f:0.0} GB\n" +
$"{GameConstants.ContactInfo}\n" +
$"Version: Alpha v{GameConstants.Version}\n";
$"Version: Alpha v{Application.version}\n";

_debugInfoStringFormat = deviceInfo + "Heap size: {0:0.00} MB\n" + "{1:0.} fps";

Expand All @@ -65,7 +65,7 @@ private void OnDisable()
if (_noteAnimation != null) StopCoroutine(_noteAnimation);
CommandExecutorRegistry<ICommand>.Instance.UnRegister(this);
}

private void Update()
{
var currentTime = Time.realtimeSinceStartupAsDouble;
Expand Down
20 changes: 3 additions & 17 deletions ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,6 @@ PlayerSettings:
Others: 1
bundleVersion: 0.15
preloadedAssets:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
metroInputSource: 0
wsaTransparentSwapchain: 0
m_HolographicPauseOnTrackingLoss: 1
Expand All @@ -168,8 +154,8 @@ PlayerSettings:
androidMaxAspectRatio: 2.1
applicationIdentifier:
Android: com.OSS.PAL3
Standalone: com.OSS.PAL3
iPhone: com.OSS.PAL3
Standalone: com.Jackil.PAL3
iPhone: com.Jackil.PAL3
buildNumber:
Standalone: 0
iPhone: 0
Expand Down Expand Up @@ -239,7 +225,7 @@ PlayerSettings:
metalAPIValidation: 1
iOSRenderExtraFrameOnPause: 0
iosCopyPluginsCodeInsteadOfSymlink: 0
appleDeveloperTeamID:
appleDeveloperTeamID: 4997CKN8MT
iOSManualSigningProvisioningProfileID:
tvOSManualSigningProvisioningProfileID:
iOSManualSigningProvisioningProfileType: 0
Expand Down

0 comments on commit 38971d9

Please sign in to comment.