Ejemplo n.º 1
0
    void Solver_OnCollision(object sender, Obi.ObiSolver.ObiCollisionEventArgs e)
    {
        Oni.Contact[] contacts = e.contacts.Data;
        for (int i = 0; i < e.contacts.Count; ++i)
        {
            Oni.Contact c = contacts[i];
            // make sure this is an actual contact:
            if (c.distance < 0.01f)
            {
                // get the collider:
                Collider collider = ObiCollider.idToCollider[c.other] as Collider;

                if (collider != null)
                {
                    // make it blink:
                    Blinker blinker = collider.GetComponent <Blinker>();

                    if (blinker)
                    {
                        blinker.Blink();
                    }
                }
            }
        }
    }
Ejemplo n.º 2
0
 void Snare(int bar, int beat)
 {
     if ((bar % 2 == 0 && beat == 2) || (bar % 2 == 1 && beat == 3))
     {
         snare.Blink();
     }
 }
    void Solver_OnCollision(object sender, Obi.ObiSolver.ObiCollisionEventArgs e)
    {
        var colliderWorld = ObiColliderWorld.GetInstance();

        Oni.Contact[] contacts = e.contacts.Data;
        for (int i = 0; i < e.contacts.Count; ++i)
        {
            Oni.Contact c = contacts[i];
            // make sure this is an actual contact:
            if (c.distance < 0.01f)
            {
                // get the collider:
                var col = colliderWorld.colliderHandles[c.other].owner;

                if (col != null)
                {
                    // make it blink:
                    Blinker blinker = col.GetComponent <Blinker>();

                    if (blinker)
                    {
                        blinker.Blink();
                    }
                }
            }
        }
    }
Ejemplo n.º 4
0
    void Solver_OnCollision(object sender, Obi.ObiSolver.ObiCollisionEventArgs e)
    {
        if (solver.colliderGroup == null)
        {
            return;
        }

        foreach (Oni.Contact c in e.contacts)
        {
            // make sure this is an actual contact:
            if (c.distance < 0.01f)
            {
                // get the collider:
                Collider collider = solver.colliderGroup.colliders[c.other];

                // make it blink:
                Blinker blinker = collider.GetComponent <Blinker>();

                if (blinker)
                {
                    blinker.Blink();
                }
            }
        }
    }
Ejemplo n.º 5
0
    void Kick(int bar, int beat)
    {
        int bbeat = ((bar % 2) << 4) + beat;

        if (kicks[bbeat] == 1)
        {
            kick.Blink();
        }
    }
Ejemplo n.º 6
0
    void OnSixteenth(int bar, int beat)
    {
        int kbeat = ((bar % 2) << 4) + beat;

        if (kicks[kbeat] == 1)
        {
            kick.Blink();
        }

        if ((bar % 2 == 0 && beat == 8) || (bar % 2 == 1 && beat == 12) ||
            (bar % 16 == 7 && (beat == 13 || beat == 15)))
        {
            snare.Blink();
        }
    }
Ejemplo n.º 7
0
    void Solver_OnCollision(object sender, Obi.ObiSolver.ObiCollisionEventArgs e)
    {
        foreach (Oni.Contact c in e.contacts)
        {
            // make sure this is an actual contact:
            if (c.distance < 0.01f)
            {
                // get the collider:
                Collider collider = ObiCollider.idToCollider[c.other] as Collider;

                // make it blink:
                Blinker blinker = collider.GetComponent <Blinker>();

                if (blinker)
                {
                    blinker.Blink();
                }
            }
        }
    }
        private void btnGen_Click(object sender, EventArgs e)
        {
            try
            {
                if (String.IsNullOrEmpty(tbClassName.Text))
                {
                    Blinker.Blink(tbClassName, Color.Orange, Color.White);
                    return;
                }

                grd.AllowUserToAddRows = false;
                if (grd.Rows.Count > 0)
                {
                    var sb = new StringBuilder();
                    sb.Append("Public Class " + tbClassName.Text + Environment.NewLine);

                    for (int i = 0; i < grd.RowCount; i++)
                    {
                        var pname = GetCellValue(i, FName);
                        var ptype = (String.IsNullOrEmpty(GetCellValue(i, FCustom)) ? GetCellValue(i, FType) : GetCellValue(i, FCustom));
                        if (String.IsNullOrEmpty(pname))
                        {
                            grd.Rows[i].Cells[FName.Index].Style.BackColor          = Color.Orange;
                            grd.Rows[i].Cells[FName.Index].Style.SelectionBackColor = Color.DarkOrange;
                            return;
                        }

                        if (String.IsNullOrEmpty(ptype))
                        {
                            grd.Rows[i].Cells[FType.Index].Style.BackColor            = Color.Orange;
                            grd.Rows[i].Cells[FCustom.Index].Style.BackColor          = Color.Orange;
                            grd.Rows[i].Cells[FCustom.Index].Style.SelectionBackColor = Color.DarkOrange;
                            return;
                        }

                        grd.Rows[i].Cells[FName.Index].Style.BackColor            = Color.White;
                        grd.Rows[i].Cells[FType.Index].Style.BackColor            = Color.White;
                        grd.Rows[i].Cells[FCustom.Index].Style.BackColor          = Color.White;
                        grd.Rows[i].Cells[FCustom.Index].Style.SelectionBackColor = System.Drawing.SystemColors.Highlight;
                        grd.Rows[i].Cells[FName.Index].Style.SelectionBackColor   = System.Drawing.SystemColors.Highlight;

                        sb.Append(String.Format(@"
    Private _{0} As {1}
    Public Property {0}() As {1}
        Get
            Return _{0}
        End Get
        Set(ByVal value As {1})
            _{0} = value
        End Set
    End Property

", pname, ptype));
                    }

                    sb.Append("End Class ");

                    System.IO.File.WriteAllText(System.IO.Path.Combine(Application.StartupPath, tbClassName.Text + ".vb"), sb.ToString());

                    MessageBox.Show("Done");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                grd.AllowUserToAddRows = true;
            }
        }
Ejemplo n.º 9
0
 public void Blink()
 {
     blinker.Blink();
 }
Ejemplo n.º 10
0
 void OnWhole(int bar, int beat)
 {
     whole.Blink();
 }