5
为什么在Vector3s中不能使用运算符'> ='?
我正在尝试获得一个矩形,以便在我称为_positionA和的两个位置之间移动_positionB。两者都是类型Vector3。矩形移动得很好。但是,到达时_positionB它不会像应该的那样朝相反的方向移动。 我回到代码中看一看。我得出的结论是,随着对象的移动,if代码中的语句错过了rects位置等于的框架_positionB。如果rects的位置大于或等于, 我决定将代码修改为反向_positionB。我的代码不太长,因此我将在下面显示它: using UnityEngine; using System.Collections; public class Rectangle : MonoBehaviour { private Vector3 _positionA = new Vector3(-0.97f, -4.28f); //Start position private Vector3 _positionB = new Vector3(11.87f, -4.28f); //End position private Transform _rect_tfm; private bool _atPosA = false, _atPosB = false; public Vector2 speed = new Vector2(1f, 0f); private …
9
unity
c#
vector
mathematics
vector
matrix
unity
c#
transformation
java
3d
terrain-rendering
shading
ios
opengl-es
opengl
rendering
optimization
python
scripting
minecraft-modding
modding
pc
3d-meshes
mesh
culling
point-cloud
networking
interpolation
mathematics
game-design
ai
game-mechanics
animation
unreal-4
skeletal-animation
3dsmax
unity
c#
3d
opengl
c++
textures
unity
ide
cocos2d
cocos2d-x-js
unity
c#
mono
il2cpp
c++
game-loop
timer
linux
flash
actionscript-3
java
glsl
c++
vector
entity-component
c++
directx11
windows
visual-studio
libgdx
mouse
unity
c#
architecture
storage
unity
c#
rotation
coordinates
quaternion
vrpn
movement
vector
unreal-4
unity
shaders
unity
gui
text
bug
shooter
3d
animation
rendering
voxels
c++
mmo
multithreading
linux
textures
procedural-generation
terrain-rendering
multiplayer
mmo
game-state
java
android
libgdx
opengl
procedural-generation
unity
gui
3d
animation
tools
geometry-shader
mobile
advertisements
unity
c#
animation
scripting
unity
animation
unityscript
coroutines
unity
shaders
lighting
camera