0
나는 away3D에 관한 작은 질문이 있습니다. 나는 똑같은 차원에있는 큐브를 똑같은 곳에 두었다. 큐브 스택을 클릭하면 마지막으로 추가 한 큐브에 클릭을 등록하고 싶습니다. 이 작업을 수행하는 대신 첫 번째로 추가 한 큐브에 클릭이 등록됩니다.away3D에서 최상위 아동을 얻는 방법?
컨테이너의 큐브 위치를 변경하는 방법을 찾았으므로 끝에있는 코드 (아래 코드)와 childrenArray를 시작했지만 아무 것도 작동하지 않는 것 같습니다. 나는 정말로 여기에 정말로 갇혀 있기 때문에 스택을 클릭 할 때 최상위 요소를 얻는 방법을 아는 사람이라면 기꺼이들을 수 있습니다.
//We get the targetCube's childIndex.
for(var i:uint = 0; i < _3DContent.children.length; i++)
{
if(_targetCube == _3DContent.children[i])
break;
}
//Now we rearrange the array if the targetCube is different from
//the last cube in our list of children.
if(i != _3DContent.children.length-1)
{
//We reposition the children.
for(var j:uint = i; j < _3DContent.children.length-1; j++)
_3DContent.children[j] = _3DContent.children[j+1];
//Lastly, we push the child.
_3DContent.children[_3DContent.children.length-1] = _targetCube;
}