Skip to content

Commit

Permalink
v1.0.32 FluentKit:增加 Sin、Cos、SinAngle、CosAngle、Deg2Rad、Rad2Deg、ToVect…
Browse files Browse the repository at this point in the history
…or3 API
  • Loading branch information
liangxiegame committed Jan 10, 2023
1 parent 48d04c5 commit 21402d4
Show file tree
Hide file tree
Showing 8 changed files with 203 additions and 71 deletions.
Binary file modified QFramework.Toolkits.unitypackage
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class NoneMonoScript : IUnRegisterList

void Start()
{
TypeEventSystem.Global.Register<EasyEventExample.EventA>(a =>
TypeEventSystem.Global.Register<EventA>(a =>
{

}).AddToUnregisterList(this);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Id": "",
"Version": "v1.0.31",
"Version": "v1.0.32",
"Type": 0,
"AccessRight": 0,
"DownloadUrl": "",
Expand All @@ -11,10 +11,10 @@
],
"DocUrl": "https://liangxiegame.com",
"Readme": {
"version": "v1.0.31",
"content": "FluentKit 增加 Abs、Sign、Lerp、LocalScaleX、Y、Z",
"version": "v1.0.32",
"content": "FluentKit增加 Sin、Cos、SinAngle、CosAngle、Deg2Rad、Rad2Deg、ToVector3 API",
"author": "liangxie",
"date": "2023 年 01 月 09 日 10:27",
"date": "2023 年 01 月 10 日 10:35",
"PackageId": ""
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -334,63 +334,65 @@ public void OnDispose()
EditorPrefs.SetBool(KEY_AUTOGENERATE_CLASS, mEnableGenerateClass);
EditorPrefs.SetString(KEY_QAssetBundleBuilder_RESVERSION, mResVersion);
}

public class LocaleText
{
public static bool IsCN => LocaleKitEditor.IsCN.Value;
public static string ResKit => IsCN ? "Res Kit 设置" : "Res Kit Setting";

public static string GoToPersistent => IsCN ? "打开 Persistent 目录" : "Go To Persistance";

public static string GenerateClass => IsCN ? "生成代码(资源名常量)" : "Generate Class";

public static string Build => IsCN ? "打 AB 包" : "Build";

public static string ForceClear => IsCN ? "清空已生成的 AB" : "ForceClear";

public static string AutoGenerateClass => IsCN ? "打 AB 包时,自动生成资源名常量代码" : "auto generate class when build";

public static string SimulationMode =>
IsCN
? "模拟模式(勾选后每当资源修改时无需再打 AB 包,开发阶段建议勾选,打真机包时取消勾选并打一次 AB 包)"
: "Simulation Mode";

public static string CancelMark =>
IsCN
? "取消标记"
: "Cancel Mark";

public static string Select =>
IsCN
? "选择"
: "Select";

public static string MarkedAb =>
IsCN
? "已标记的 AB"
: "Marked AB";

// public static string EncryptAB
// {
// get
// {
// return Language.IsChinese
// ? "加密AB(AES加密)"
// : "EncryptAB";
// }
// }
//
// public static string EncryptKey
// {
// get
// {
// return Language.IsChinese
// ? "加密秘钥(RSA加密)"
// : "EncryptKey";
// }
// }
}
}

public class LocaleText
{
public static bool IsCN => LocaleKitEditor.IsCN.Value;
public static string ResKit => IsCN ? "Res Kit 设置" : "Res Kit Setting";

public static string GoToPersistent => IsCN ? "打开 Persistent 目录" : "Go To Persistance";

public static string GenerateClass => IsCN ? "生成代码(资源名常量)" : "Generate Class";

public static string Build => IsCN ? "打 AB 包" : "Build";

public static string ForceClear => IsCN ? "清空已生成的 AB" : "ForceClear";

public static string AutoGenerateClass => IsCN ? "打 AB 包时,自动生成资源名常量代码" : "auto generate class when build";

public static string SimulationMode =>
IsCN
? "模拟模式(勾选后每当资源修改时无需再打 AB 包,开发阶段建议勾选,打真机包时取消勾选并打一次 AB 包)"
: "Simulation Mode";

public static string CancelMark =>
IsCN
? "取消标记"
: "Cancel Mark";

public static string Select =>
IsCN
? "选择"
: "Select";

public static string MarkedAb =>
IsCN
? "已标记的 AB"
: "Marked AB";

// public static string EncryptAB
// {
// get
// {
// return Language.IsChinese
// ? "加密AB(AES加密)"
// : "EncryptAB";
// }
// }
//
// public static string EncryptKey
// {
// get
// {
// return Language.IsChinese
// ? "加密秘钥(RSA加密)"
// : "EncryptKey";
// }
// }
}

internal class EditorLifecycle
{
static EditorLifecycle()
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,145 @@ public static float Sign(this float self)
{
return Mathf.Sign(self);
}

#if UNITY_EDITOR
// Added in v1.0.32
[MethodAPI]
[APIDescriptionCN("Mathf.Cos")]
[APIDescriptionEN("Mathf.Cos")]
[APIExampleCode(@"
var cos = (90.0f * Mathf.Deg2Rad).Cos();
// cos is 0f
")]
#endif
public static float Cos(this float self)
{
return Mathf.Cos(self);
}

public static float Cos(this int self)
{
return Mathf.Cos(self);
}

#if UNITY_EDITOR
// Added in v1.0.32
[MethodAPI]
[APIDescriptionCN("Mathf.Sin")]
[APIDescriptionEN("Mathf.Sin")]
[APIExampleCode(@"
var sin = (90.0f * Mathf.Deg2Rad).Sin();
// sin is 1f
")]
#endif
public static float Sin(this float self)
{
return Mathf.Sin(self);
}

public static float Sin(this int self)
{
return Mathf.Sin(self);
}

#if UNITY_EDITOR
// Added in v1.0.32
[MethodAPI]
[APIDescriptionCN("Mathf.Cos(x * Mathf.Deg2Rad)")]
[APIDescriptionEN("Mathf.Cos(x * Mathf.Deg2Rad)")]
[APIExampleCode(@"
var cos = (90.0f).CosAngle();
// cos is 0f
")]
#endif
public static float CosAngle(this float self)
{
return Mathf.Cos(self * Mathf.Deg2Rad);
}

public static float CosAngle(this int self)
{
return Mathf.Cos(self * Mathf.Deg2Rad);
}

#if UNITY_EDITOR
// Added in v1.0.32
[MethodAPI]
[APIDescriptionCN("Mathf.Sin(x * Mathf.Deg2Rad)")]
[APIDescriptionEN("Mathf.Sin(x * Mathf.Deg2Rad)")]
[APIExampleCode(@"
var sin = (90.0f).SinAngle();
// sin is 1f
")]
#endif
public static float SinAngle(this float self)
{
return Mathf.Sin(self * Mathf.Deg2Rad);
}

public static float SinAngle(this int self)
{
return Mathf.Sin(self * Mathf.Deg2Rad);
}

#if UNITY_EDITOR
// Added in v1.0.32
[MethodAPI]
[APIDescriptionCN("Mathf.Deg2Rad")]
[APIDescriptionEN("Mathf.Deg2Rad")]
[APIExampleCode(@"
var radius = (90.0f).Deg2Rad();
// radius is 1.57f
")]
#endif
public static float Deg2Rad(this float self)
{
return self * Mathf.Deg2Rad;
}

public static float Deg2Rad(this int self)
{
return self * Mathf.Deg2Rad;
}


#if UNITY_EDITOR
// Added in v1.0.32
[MethodAPI]
[APIDescriptionCN("Mathf.Rad2Deg")]
[APIDescriptionEN("Mathf.Rad2Deg")]
[APIExampleCode(@"
var degree = 1.57f.Rad2Deg();
// degree is 90f
")]
#endif
public static float Rad2Deg(this float self)
{
return self * Mathf.Rad2Deg;
}

public static float Rad2Deg(this int self)
{
return self * Mathf.Rad2Deg;
}

#if UNITY_EDITOR
// Added in v1.0.32
[MethodAPI]
[APIDescriptionCN("new Vector3(vec2.x,vec2.y,0 or z)")]
[APIDescriptionEN("new Vector3(vec2.x,vec2.y,0 or z)")]
[APIExampleCode(@"
var vec3 = new Vector2(1,1).ToVector3();
// vec3 is (1,1,0)
vec3 = new Vector2(1,1).ToVector3(1);
// vec3 is (1,1,1)
")]
#endif
public static Vector3 ToVector3(this Vector2 self,float z = 0)
{
return new Vector3(self.x, self.y, z);
}
}

#if UNITY_EDITOR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public static PackageInfosRequestCache Get()
return new PackageInfosRequestCache();
}
}
catch (Exception _)
catch (Exception)
{
return new PackageInfosRequestCache();
}
Expand Down
3 changes: 1 addition & 2 deletions QFramework.Unity2018+/QFramework.Unity2018+.sln
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

Microsoft Visual Studio Solution File, Format Version 11.00
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QFramework.CoreKit", "QFramework.CoreKit.csproj", "{D3A89052-43AC-6A8A-EF6B-9211E51A1595}"
EndProject
Expand Down

0 comments on commit 21402d4

Please sign in to comment.