-5

我有这么长的 if 语句。它给了我错误

>= Operand cannot be applied to types Bool and Float

if (tl.State == TouchLocationState.Pressed && 
    (tl.Position.X >= harePlayer.Position.X >= tl.Position.X && 
     tl.Position.Y >= harePlayer.Position.Y &&
     harePlayer.Position.X <= (harePlayer.Position.X + 52) &&
     tl.Position.Y <= (harePlayer.Position.Y + 50)))

谁能告诉我修复方法是什么?谢谢你。:)

4

1 回答 1

8

tl.Position.X >= harePlayer.Position.X >= tl.Position.X不是正确的 c# 条件。您必须编写两个单独的条件并使用以下方法合并它们&&

tl.Position.X >= harePlayer.Position.X && harePlayer.Position.X >= tl.Position.X
于 2014-01-18T20:36:16.237 回答