void Start() { MyTexture = Resources.Load("Square") as Texture2D; isJumping = false; canJump = true; Bounds pbound = collider.bounds; platform1 = new CollisionHandler.Hitbox(CollisionHandler.Shape.Rectangle, new CollisionHandler.Rectangle(5, 5, 0.0001F, 0.000000000001F), Vector2.zero); top = new CollisionHandler.Hitbox(CollisionHandler.Shape.Rectangle, new CollisionHandler.Rectangle(0, 20, pbound.size.x/10, pbound.size.y/10), Vector2.zero); bottom = new CollisionHandler.Hitbox(CollisionHandler.Shape.Rectangle, new CollisionHandler.Rectangle(0, -6.1F, pbound.size.x/10, pbound.size.y/10), Vector2.zero); Cplayer = new CollisionHandler.Hitbox(CollisionHandler.Shape.Rectangle, new CollisionHandler.Rectangle(0, 3, 10, 10), Vector2.zero); }
// Use this for initialization void Start() { bottom = new CollisionHandler.Hitbox(CollisionHandler.Shape.Rectangle, new CollisionHandler.Rectangle(0, 1, 1, 1), Vector2.zero); MyTexture = Resources.Load("Square") as Texture2D; Graphics.DrawTexture(new Rect(thePlayer.transform.position.x, thePlayer.transform.position.y, thePlayer.GetComponent<Collider>().bounds.size.x, thePlayer.GetComponent<Collider>().bounds.size.y), MyTexture); }