Base Scene
This commit is contained in:
8
Assets/Scripts/Utilities/Extensions.cs
Normal file
8
Assets/Scripts/Utilities/Extensions.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Exsersewo.Nydaliv.Extensions
|
||||
{
|
||||
public static class Extensions
|
||||
{
|
||||
public static float Remap(this float value, float min1, float max1, float min2, float max2)
|
||||
=> min2 + (max2 - min2) * ((value - min1) / (max1 - min1));
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Utilities/Extensions.cs.meta
Normal file
11
Assets/Scripts/Utilities/Extensions.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2267714de683f994393354008d214520
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
13
Assets/Scripts/Utilities/NumberUtilities.cs
Normal file
13
Assets/Scripts/Utilities/NumberUtilities.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace Exsersewo.Nydaliv.Utilities
|
||||
{
|
||||
public static class NumberUtilities
|
||||
{
|
||||
public static ulong GetXPLevelRequirement(ulong level, double growthmod)
|
||||
=> (ulong)Math.Round(Math.Pow(level, 2) * 50 * growthmod, MidpointRounding.AwayFromZero);
|
||||
|
||||
public static ulong GetLevelFromTotalXP(ulong totalxp, double growthmod)
|
||||
=> (ulong)(Math.Sqrt(totalxp / (50 * growthmod)));
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Utilities/NumberUtilities.cs.meta
Normal file
11
Assets/Scripts/Utilities/NumberUtilities.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 62a269b0b6bc30a43843ddb73142d5d9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
7
Assets/Scripts/Utilities/Props.cs
Normal file
7
Assets/Scripts/Utilities/Props.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Exsersewo.Nydaliv.Utilities
|
||||
{
|
||||
public static class Props
|
||||
{
|
||||
public const float PHI = 1.618f;
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Utilities/Props.cs.meta
Normal file
11
Assets/Scripts/Utilities/Props.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 272b839b5585de5478d092fc247aeeeb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user