Movimento.Update C# (CSharp) Method

Update() public method

public Update ( ) : void
return void
	void Update () {

		RaycastHit hit;

		if (Physics.Raycast (
				transform.position, 
				-Vector3.up, 
				out hit, 
				3f, 
				mascara)) 
		{
			//transform.rotation = hit.transform.rotation;
			transform.rotation = Quaternion.Slerp (
					transform.rotation, hit.transform.rotation, 
					Time.deltaTime * 10);
		}

		//

		transform.Translate (
			Input.GetAxis ("Horizontal"), 
			0, 
			velocidade, 
			Space.Self);
	}
}

Usage Example

Exemplo n.º 1
0
        public static void TestUpdateMovement()
        {
            using (var conn = new SqliteConnection(GlobalController.path))
            {
                conn.Open();

                Pessoa.Insert("fake name1", "m", "1995-01-01", "6198732711", null);
                Pessoa.Insert("fake name2", "m", "1995-01-02", "6198732712", null);

                Fisioterapeuta.Insert(1, "abracadabra1", "demais1", null, null);
                Fisioterapeuta.Insert(2, "abracadabra2", "demais2", "DF", "123424");

                Movimento.Insert(1, "Movimento1", "Musculo Redondo Maior", null);
                Movimento.Insert(2, "Movimento2", "Musculo Redondo Maior", "Dificuldade nesse local");

                Movimento.Update(1, 2, "Movimento11", "Musculo do Braquiorradial", null);
                Movimento.Update(2, 1, "Movimento12", "Musculo do Braquiorradial", null);

                var check = "SELECT * FROM MOVIMENTO;";

                var id     = 0;
                var result = "";
                int i      = 1;

                using (var cmd = new SqliteCommand(check, conn))
                {
                    using (IDataReader reader = cmd.ExecuteReader())
                    {
                        try
                        {
                            while (reader.Read())
                            {
                                if (!reader.IsDBNull(0))
                                {
                                    id = reader.GetInt32(0);
                                    Assert.AreEqual(id, i);
                                }

                                if (!reader.IsDBNull(1))
                                {
                                    id = reader.GetInt32(1);
                                    Assert.AreEqual(id, 3 - i);
                                }

                                if (!reader.IsDBNull(2))
                                {
                                    result = reader.GetString(2);
                                    Assert.AreEqual(result, string.Format("Movimento1{0}", i));
                                }

                                if (!reader.IsDBNull(3))
                                {
                                    result = reader.GetString(3);
                                    Assert.AreEqual(result, "Musculo do Braquiorradial");
                                }

                                Assert.AreEqual(reader.IsDBNull(4), true);


                                i++;
                            }
                        }
                        finally
                        {
                            reader.Dispose();
                            reader.Close();
                        }
                    }
                    cmd.Dispose();
                }
                conn.Dispose();
                conn.Close();
            }
        }
Movimento