1
Support / Re: Mesh Combine for tilemap
« on: May 10, 2014, 06:57:23 am »
Why can't i add a jpg?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


void FixedUpdate()
{
// rigidbody.WakeUp();
detectKey();
updateAniByState();
System.Diagnostics.Debug.Assert(rigidbody.position.z == -0.5);
print("rigidbody.velocity = " + rigidbody.velocity + " rbody = " + rigidbody);
}
void detectKey()
{
if (Input.GetKey(KeyCode.D) || Input.GetKey(KeyCode.RightArrow))
{
moveTowardRight();
}
else if (Input.GetKey(KeyCode.A) || Input.GetKey(KeyCode.LeftArrow))
{
// rigidbody.transform.Translate(Vector3.left * SPEED * Time.deltaTime);
moveTowardLeft();
}
if (Input.GetKey(KeyCode.D) || Input.GetKey(KeyCode.RightArrow))
{
moveTowardRight();
}
void moveTowardRight()
{
cleanFlag(STATE_STANDBY);
cleanFlag(STATE_RUN_LEFT);
addFlag(STATE_RUN_RIGHT);
Vector3 vy = rigidbody.velocity.y * (hasFlag(STATE_JUMP) ? Vector3.up : Vector3.zero);
rigidbody.velocity = vy + Vector3.right * SPEED;
}
so quickly reply!!!