예제 #1
0
 void OnEnable()
 {
     Instance     = this;
     OnNextFrame += LoadFromMemoryOrFile;
     PixelDriver.Add(PixelRoad.Checkerboard(Color.white, new Color(0.97f, 0.97f, 0.97f)).SetWeight(0.3f));
     PixelDriver.Add(PixelRoad.NodeBackground().SetWeight(0.1f));
 }
예제 #2
0
    public void OnPointerClick(PointerEventData eventData)
    {
        if (_dragging || Input.touchCount > 1 || eventData.button != PointerEventData.InputButton.Left)
        {
            return;
        }

        if (nextClickOverride != null)
        {
            nextClickOverride();
            nextClickOverride = null;
            return;
        }

        Utils.GetInputCoords(out var x, out var y);
        if (FieldMatrix.Get(x, y, out var block))
        {
            block.logic.Click(eventData);
        }
        else
        {
            PixelDriver.Add(PixelRoad.Circle(Colors.GetPalette(-1)[3],
                                             3f, 3f, 0.05f, 0.5f, x, y).SetWeight(0.05f));
        }
    }
예제 #3
0
    void Update()
    {
        var c = PixelDriver.GetColor(X, Y);

        if (c == _current)
        {
            return;
        }
        SetColor(c);
    }
예제 #4
0
 void Update()
 {
     Animator.Update();
     PixelDriver.Update();
     OnNextFrame?.Invoke();
     OnNextFrame = null;
     foreach (var root in Roots.Root.Values)
     {
         root.pulse.Update();
     }
 }
예제 #5
0
    void OnPulseDeadEnd(Block from)
    {
        if (from == null || BindMatrix.GetOutBindsCount(this) != 0)
        {
            return;
        }
        var dir  = Utils.DirFromCoords(logic.Position - from.logic.Position);
        var root = Roots.Root[rootId].block;

        root.soundsPlayer.Play(dir);
        PixelDriver.Add(PixelRoad.Circle(root.view.PrimaryPainter.palette.GetColor(dir),
                                         2f, 3f, 0.05f, 0.5f, logic.X, logic.Y).SetWeight(0.3f));
    }