示例#1
0
 void _ChangeBallMovement(CorrectColorSelectedEvent e)
 {
     ParticleSystem.MainModule settings = deathParticle.main;
     settings.startColor = new ParticleSystem.MinMaxGradient(ballMesh.material.color);
     deathAnimation.transform.position = ball.transform.position;
     deathAnimation.SetActive(true);
     deathAnimation.GetComponent <MeshRenderer>().material = ballMesh.material;
     deathAnimation.GetComponent <Rigidbody>().velocity    = ballRd.velocity * 2f;
     deathParticle.Play();
     shoot = true;
 }
 void _CheckButton(ButtonPressedEvent e)
 {
     if (!check)
     {
         if (e.ID == r)
         {
             CorrectColorSelectedEvent c = new CorrectColorSelectedEvent();
             _EventBus.Publish <CorrectColorSelectedEvent>(c);
             check = true;
             UpdateScore();
             //Debug.Log("correct!" + Time.deltaTime);
         }
     }
 }