Beispiel #1
0
    /// <summary>
    /// オブジェクトの移動
    /// </summary>
    void MoveGameObject(int i_index, ScrollVec i_type)
    {
        Vector3 pos  = m_listObjects[i_index].transform.position;
        float   posX = pos.x;
        float   posZ = pos.z;
        float   newY = 0;

        switch (i_type)
        {
        case ScrollVec.UP:
            newY = m_nowLastObject.transform.localPosition.y - m_GridCellHeight;
            break;

        case ScrollVec.DOWN:
            newY = m_listObjects[i_index + 1 == m_createGameObjectNum ? 0 : i_index + 1].transform.localPosition.y + m_GridCellHeight;
            break;
        }
        m_listObjects[i_index].transform.localPosition = new Vector3(posX, newY, posZ);
    }
 /// <summary>
 /// オブジェクトの移動
 /// </summary>
 void MoveGameObject(int i_index, ScrollVec i_type) {
     Vector3 pos = m_listObjects[i_index].transform.position;
     float posX = pos.x;
     float posZ = pos.z;
     float newY = 0;
     switch (i_type) {
         case ScrollVec.UP:
             newY = m_nowLastObject.transform.localPosition.y - m_GridCellHeight;
             break;
         case ScrollVec.DOWN:
             newY = m_listObjects[i_index + 1 == m_createGameObjectNum ? 0 : i_index + 1].transform.localPosition.y + m_GridCellHeight;
             break;
     }
     m_listObjects[i_index].transform.localPosition = new Vector3(posX, newY, posZ);
 }