Copy Aetheria Code

Added a bunch of code from the old Aetheria project
This commit is contained in:
hyperion51 2020-02-27 18:51:07 +00:00
commit c58ba0b1da
1704 changed files with 175081 additions and 313 deletions

View file

@ -0,0 +1,78 @@
using System.Collections.Generic;
namespace UnityEngine.UI.Extensions.Examples
{
[RequireComponent(typeof(UILineRenderer))]
public class LineRendererOrbit : MonoBehaviour
{
UILineRenderer lr;
Circle circle;
public GameObject OrbitGO;
RectTransform orbitGOrt;
float orbitTime;
[SerializeField]
private float _xAxis = 3;
public float xAxis
{
get { return _xAxis; }
set { _xAxis = value; GenerateOrbit(); }
}
[SerializeField]
private float _yAxis = 3;
public float yAxis
{
get { return _yAxis; }
set { _yAxis = value; GenerateOrbit(); }
}
[SerializeField]
private int _steps = 10;
public int Steps
{
get { return _steps; }
set { _steps = value; GenerateOrbit(); }
}
// Use this for initialization
void Awake()
{
lr = GetComponent<UILineRenderer>();
orbitGOrt = OrbitGO.GetComponent<RectTransform>();
GenerateOrbit();
}
// Update is called once per frame
void Update()
{
orbitTime = orbitTime > _steps ? orbitTime = 0 : orbitTime + Time.deltaTime;
orbitGOrt.localPosition = circle.Evaluate(orbitTime);
}
void GenerateOrbit()
{
circle = new Circle(xAxis: _xAxis, yAxis: _yAxis, steps: _steps);
List<Vector2> Points = new List<Vector2>();
for (int i = 0; i < _steps; i++)
{
Points.Add(circle.Evaluate(i));
}
Points.Add(circle.Evaluate(0));
lr.Points = Points.ToArray();
}
private void OnValidate()
{
if (lr != null)
{
GenerateOrbit();
}
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 544c2baa26170b34fb34c19cb04b1fb1
timeCreated: 1498381316
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,25 @@
using System.Collections.Generic;
namespace UnityEngine.UI.Extensions.Examples
{
public class TestAddingPoints : MonoBehaviour
{
public UILineRenderer LineRenderer;
public Text XValue;
public Text YValue;
// Use this for initialization
public void AddNewPoint()
{
var point = new Vector2() { x = float.Parse(XValue.text), y = float.Parse(YValue.text) };
var pointlist = new List<Vector2>(LineRenderer.Points);
pointlist.Add(point);
LineRenderer.Points = pointlist.ToArray();
}
public void ClearPoints()
{
LineRenderer.Points = new Vector2[0];
}
}
}

View file

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 6f7b10baa6c50634a979160a8c4f142c
timeCreated: 1463340207
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b01f9e610467c714c9077cf2622eb7b2
timeCreated: 1464634788
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant: