refactoring
This commit is contained in:
@@ -3,6 +3,8 @@ using System;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using WacK;
|
using WacK;
|
||||||
|
|
||||||
|
namespace WacK.Things.TunnelObjects
|
||||||
|
{
|
||||||
public partial class SnapArrows : HBoxContainer
|
public partial class SnapArrows : HBoxContainer
|
||||||
{
|
{
|
||||||
private TextureRect[] arrows = new TextureRect[20];
|
private TextureRect[] arrows = new TextureRect[20];
|
||||||
@@ -55,3 +57,4 @@ public partial class SnapArrows : HBoxContainer
|
|||||||
Position = p;
|
Position = p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -13,12 +13,7 @@ namespace WacK.Things.TunnelObjects
|
|||||||
shader = (ShaderMaterial) Material;
|
shader = (ShaderMaterial) Material;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetCW(bool isCW)
|
public void Init(int pos, int size, bool isCW)
|
||||||
{
|
|
||||||
shader.SetShaderParameter("isCw", isCW);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetPosSize(int pos, int size)
|
|
||||||
{
|
{
|
||||||
var p = Position;
|
var p = Position;
|
||||||
var s = Size;
|
var s = Size;
|
||||||
@@ -39,6 +34,7 @@ namespace WacK.Things.TunnelObjects
|
|||||||
Position = p;
|
Position = p;
|
||||||
Size = s;
|
Size = s;
|
||||||
shader.SetShaderParameter("TileMult", s.Y / 64);
|
shader.SetShaderParameter("TileMult", s.Y / 64);
|
||||||
|
shader.SetShaderParameter("isCw", isCW);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,14 +14,6 @@ namespace WacK.Things.TunnelObjects
|
|||||||
{
|
{
|
||||||
this.noteData = noteData;
|
this.noteData = noteData;
|
||||||
SetPosSize((int)noteData.pos, (int)noteData.size);
|
SetPosSize((int)noteData.pos, (int)noteData.size);
|
||||||
|
|
||||||
// handle swipe arrow color
|
|
||||||
if (noteData.type == NotePlayType.SwipeCW)
|
|
||||||
{
|
|
||||||
var n = (SwipeArrow) FindChild("SwipeArrow");
|
|
||||||
// n.SetCW(noteData.type == NotePlayType.SwipeCW);
|
|
||||||
n.CallDeferred("SetCW", noteData.type == NotePlayType.SwipeCW);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetPosSize(int pos, int size)
|
public void SetPosSize(int pos, int size)
|
||||||
@@ -44,19 +36,17 @@ namespace WacK.Things.TunnelObjects
|
|||||||
nSize.X = sizePx;
|
nSize.X = sizePx;
|
||||||
noteBase.SetDeferred("size", nSize);
|
noteBase.SetDeferred("size", nSize);
|
||||||
|
|
||||||
// handle swipe arrow pos & size
|
// handle swipe arrow
|
||||||
if (noteData.type == NotePlayType.SwipeCW || noteData.type == NotePlayType.SwipeCCW)
|
if (noteData.type == NotePlayType.SwipeCW || noteData.type == NotePlayType.SwipeCCW)
|
||||||
{
|
{
|
||||||
var n = (SwipeArrow) FindChild("SwipeArrow");
|
var n = (SwipeArrow) FindChild("SwipeArrow");
|
||||||
// n.SetPosSize(pos, size);
|
n.CallDeferred("Init", pos, size, noteData.type == NotePlayType.SwipeCW);
|
||||||
n.CallDeferred("SetPosSize", pos, size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle snap arrow pos & size
|
// handle snap arrow
|
||||||
if (noteData.type == NotePlayType.SnapIn || noteData.type == NotePlayType.SnapOut)
|
if (noteData.type == NotePlayType.SnapIn || noteData.type == NotePlayType.SnapOut)
|
||||||
{
|
{
|
||||||
var n = (SnapArrows)FindChild("SnapArrows");
|
var n = (SnapArrows)FindChild("SnapArrows");
|
||||||
// n.SetPosSize(pos, size);
|
|
||||||
n.CallDeferred("Init", pos, size, noteData.type == NotePlayType.SnapIn);
|
n.CallDeferred("Init", pos, size, noteData.type == NotePlayType.SnapIn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user