Prune code.

This commit is contained in:
2022-09-30 18:19:19 +08:00
parent e8e36b83bd
commit cd4ea557c3
41 changed files with 22 additions and 3592 deletions

View File

@@ -1,21 +1,9 @@
using Cryville.Common.Pdt;
using System;
using System.Collections;
using UnityEngine;
namespace Cryville.Crtr.Components {
public abstract class SpriteBase : SkinComponent {
public SpriteBase()
: base() {
/*
SubmitProperty("bound", new Property(typeof(BoundInfo), null, v => Bound = (BoundInfo)v));
SubmitProperty("transparent", new Property(typeof(bool), () => transparent, v => transparent = (bool)v));
SubmitProperty("pivot", new Property(typeof(Vector2), () => Pivot, v => Pivot = (Vector2)v));
SubmitProperty("scale", new Property(typeof(Vector2), () => Scale, v => Scale = (Vector2)v));
SubmitProperty("ui", new Property(typeof(bool), () => UI, v => UI = (bool)v));
SubmitProperty("zindex", new Property(typeof(short), () => ZIndex, v => ZIndex = (short)v));
*/
public SpriteBase() {
SubmitProperty("bound", new op_set_bound(this));
SubmitProperty("transparent", new PropOp.Boolean(v => transparent = v));
SubmitProperty("pivot", new PropOp.Vector2(v => Pivot = v));
@@ -87,28 +75,6 @@ namespace Cryville.Crtr.Components {
get { return Vector2.zero; }
}
#if false
[Obsolete]
public struct BoundInfo : IConstructable {
public Vector2 Pivot;
public Vector3 Position;
public void Load(object data, IEvaluator etor) {
var d = (IList)data;
Pivot = (Vector2)etor.Cast(typeof(Vector2), d[0]);
Position = (Vector3)etor.Cast(typeof(Vector3), d[1]);
}
}
[Obsolete]
public BoundInfo Bound {
set {
var r = Quaternion.Inverse(transform.rotation);
var da = value.Pivot - Pivot;
var dp = r * (value.Position - transform.localPosition);
if (da.x != 0) _scale.x = dp.x / da.x;
if (da.y != 0) _scale.y = dp.z / da.y;
}
}
#endif
public void SetBound(Vector2 piv, Vector3 pos) {
var r = Quaternion.Inverse(transform.rotation);
var da = piv - Pivot;