Archived
添加一些单例系统,材质方法
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.Windows;
|
||||
|
||||
namespace XericLibrary.Runtime.MacroLibrary
|
||||
{
|
||||
@@ -50,6 +51,21 @@ namespace XericLibrary.Runtime.MacroLibrary
|
||||
|
||||
#region 数学
|
||||
|
||||
/// <summary>
|
||||
/// pmod
|
||||
/// </summary>
|
||||
/// <param name="a"></param>
|
||||
/// <param name="b"></param>
|
||||
/// <returns></returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static int PMod(int a, int b)
|
||||
{
|
||||
if(b <= 0)
|
||||
return 0;
|
||||
var mod = a % b;
|
||||
return a < 0 ? (b + mod) % b : mod;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// pmod
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user