예제 #1
0
    /// <summary>
    /// Sets the start position (the position of the first checker).
    /// </summary>
    private void SetStartPosition()
    {
        BoxCollider boxCollider = GetComponent <BoxCollider>();

        Vector3[] vertices = BoxColliderHelper.GetVertices(boxCollider);

        m_Start.x = transform.position.x;

        switch (m_Floor)
        {
        case (Floor.Bottom):
        {
            m_Start.y = Vector3Helper.GetMinY(vertices) + (m_Increment.y / 2);
        }
        break;

        case (Floor.Top):
        {
            m_Start.y = Vector3Helper.GetMaxY(vertices) + (m_Increment.y / 2);
        }
        break;
        }

        switch (m_StackDirection)
        {
        case (StackDirection.Foward):
        {
            m_Start.z = Vector3Helper.GetMinZ(vertices) + (m_Increment.z / 2);
        }
        break;

        case (StackDirection.Backward):
        {
            m_Start.z = Vector3Helper.GetMaxZ(vertices) - (m_Increment.z / 2);
        }
        break;
        }
    }