public AtSimpleLine() { float[,] damagePattern = new float[, ] { { 1 } }; int maxRepitions = -1; float repitionDampening = 1f; bool[,] repitionPattern = new bool[, ] { { false, true, false }, { false, false, false }, { false, false, false } }; shape = new AttackShape(damagePattern, repitionPattern, maxRepitions, repitionDampening); }
void Start() { if (circle == null) { GameObject go = gameObject.transform.Find("Circle").gameObject; circle = go.GetComponent <AttackShape>(); } if (diamond == null) { GameObject go = gameObject.transform.Find("Diamond").gameObject; diamond = go.GetComponent <AttackShape>(); } if (diamond == null) { GameObject go = gameObject.transform.Find("Square").gameObject; square = go.GetComponent <AttackShape>(); } rt = GetComponent <RectTransform>(); if (rt.position.x > 0) { direction = Direction.Right; } else if (rt.position.x < 0) { direction = Direction.Left; } else if (rt.position.y > 0) { direction = Direction.Up; } else if (rt.position.y < 0) { direction = Direction.Down; } else { direction = Direction.Middle; } panelMaxSize = rt.sizeDelta; parent = transform.parent.gameObject; originalPos = rt.anchoredPosition; _animationSizePercent = 1; _activeScaleFactor = 1; }
public override void Read(BinaryReader reader) { base.Read(reader); attackShape = (AttackShape)reader.ReadInt32(); attackArg = reader.ReadSingle(); attackArg2 = reader.ReadSingle(); showShape = reader.ReadBoolean(); int len = reader.ReadInt32(); logicType = new LogicType[len]; effect = new float[len]; for (int i = 0; i < len; i++) { logicType[i] = (LogicType)reader.ReadInt32(); effect[i] = reader.ReadSingle(); } }
void Start() { if (circle == null) { GameObject go = gameObject.transform.Find("Circle").gameObject; circle = go.GetComponent <AttackShape>(); } if (diamond == null) { GameObject go = gameObject.transform.Find("Diamond").gameObject; diamond = go.GetComponent <AttackShape>(); } if (diamond == null) { GameObject go = gameObject.transform.Find("Square").gameObject; square = go.GetComponent <AttackShape>(); } _animationSizePercent = 1; _activeScaleFactor = 1; }