Aimbot Enviroment very first

Basic environment include Multi scene, Reward Change, Visible chart, etc....
This commit is contained in:
2022-09-05 20:46:08 +09:00
parent aa337c5fc2
commit 2d404cfdf2
1552 changed files with 162551 additions and 0 deletions
@@ -0,0 +1,71 @@
using System;
using UnityEngine;
namespace XCharts.Runtime
{
/// <summary>
/// Polar coordinate can be used in scatter and line chart. Every polar coordinate has an angleAxis and a radiusAxis.
/// |极坐标系组件。
/// 极坐标系,可以用于散点图和折线图。每个极坐标系拥有一个角度轴和一个半径轴。
/// </summary>
[Serializable]
[ComponentHandler(typeof(PolarCoordHandler), true)]
public class PolarCoord : CoordSystem, ISerieContainer
{
[SerializeField] private bool m_Show = true;
[SerializeField] private float[] m_Center = new float[2] { 0.5f, 0.45f };
[SerializeField] private float m_Radius = 0.35f;
[SerializeField] private Color m_BackgroundColor;
public PolarCoordContext context = new PolarCoordContext();
/// <summary>
/// Whether to show the polor component.
/// |是否显示极坐标。
/// </summary>
public bool show
{
get { return m_Show; }
set { if (PropertyUtil.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
}
/// <summary>
/// The center of ploar. The center[0] is the x-coordinate, and the center[1] is the y-coordinate.
/// When value between 0 and 1 represents a percentage relative to the chart.
/// |极坐标的中心点。数组的第一项是横坐标,第二项是纵坐标。
/// 当值为0-1之间时表示百分比,设置成百分比时第一项是相对于容器宽度,第二项是相对于容器高度。
/// </summary>
public float[] center
{
get { return m_Center; }
set { if (value != null) { m_Center = value; SetAllDirty(); } }
}
/// <summary>
/// the radius of polar.
/// |极坐标的半径。
/// </summary>
public float radius
{
get { return m_Radius; }
set { if (PropertyUtil.SetStruct(ref m_Radius, value)) SetAllDirty(); }
}
/// <summary>
/// Background color of polar, which is transparent by default.
/// |极坐标的背景色,默认透明。
/// </summary>
public Color backgroundColor
{
get { return m_BackgroundColor; }
set { if (PropertyUtil.SetColor(ref m_BackgroundColor, value)) SetVerticesDirty(); }
}
public bool IsPointerEnter()
{
return context.isPointerEnter;
}
public bool Contains(Vector3 pos)
{
return Vector3.Distance(pos, context.center) < context.radius;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ec567fac460994411a8aadcb5e0f9b68
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,20 @@
using System;
using UnityEngine;
namespace XCharts.Runtime
{
public class PolarCoordContext : MainComponentContext
{
/// <summary>
/// the center position of polar in container.
/// |极坐标在容器中的具体中心点。
/// </summary>
public Vector3 center;
/// <summary>
/// the true radius of polar.
/// |极坐标的运行时实际半径。
/// </summary>
public float radius;
public bool isPointerEnter;
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2eaaaa315fbae4fc3a9976f51a1396b3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,35 @@
using System;
using UnityEngine;
using UnityEngine.UI;
using XUGL;
namespace XCharts.Runtime
{
[UnityEngine.Scripting.Preserve]
internal sealed class PolarCoordHandler : MainComponentHandler<PolarCoord>
{
public override void Update()
{
PolarHelper.UpdatePolarCenter(component, chart.chartPosition, chart.chartWidth, chart.chartHeight);
if (chart.isPointerInChart)
component.context.isPointerEnter = component.Contains(chart.pointerPos);
else
component.context.isPointerEnter = false;
}
public override void DrawBase(VertexHelper vh)
{
DrawPolar(vh, component);
}
private void DrawPolar(VertexHelper vh, PolarCoord polar)
{
PolarHelper.UpdatePolarCenter(polar, chart.chartPosition, chart.chartWidth, chart.chartHeight);
if (!ChartHelper.IsClearColor(polar.backgroundColor))
{
UGL.DrawCricle(vh, polar.context.center, polar.context.radius, polar.backgroundColor);
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: af4b941946def4928b416260dec7ac9b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,27 @@
using UnityEngine;
namespace XCharts.Runtime
{
internal static class PolarHelper
{
public static void UpdatePolarCenter(PolarCoord polar, Vector3 chartPosition, float chartWidth, float chartHeight)
{
if (polar.center.Length < 2) return;
var centerX = polar.center[0] <= 1 ? chartWidth * polar.center[0] : polar.center[0];
var centerY = polar.center[1] <= 1 ? chartHeight * polar.center[1] : polar.center[1];
polar.context.center = chartPosition + new Vector3(centerX, centerY);
if (polar.radius <= 0)
{
polar.context.radius = 0;
}
else if (polar.radius <= 1)
{
polar.context.radius = Mathf.Min(chartWidth, chartHeight) * polar.radius;
}
else
{
polar.context.radius = polar.radius;
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: feb363cc2ae0846b89612143ce4535ae
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: