示例#1
0
	public Quaternion GetLetterRotation(int object_idx, TRANSFORM_SPACE transform_space = TRANSFORM_SPACE.WORLD)
	{
		if (m_letters == null || m_letters.Length == 0)
			return Quaternion.identity;

		object_idx = Mathf.Clamp(object_idx, 0, m_letters.Length - 1);

		return transform_space == TRANSFORM_SPACE.WORLD ? m_letters[object_idx].Rotation : m_letters[object_idx].RotationLocal;
	}
示例#2
0
	public Vector3 GetLetterScale(int object_idx, TRANSFORM_SPACE transform_space = TRANSFORM_SPACE.WORLD)
	{
		if (m_letters == null || m_letters.Length == 0)
			return Vector3.one;

		object_idx = Mathf.Clamp(object_idx, 0, m_letters.Length - 1);

		return transform_space == TRANSFORM_SPACE.WORLD ? m_letters[object_idx].Scale : m_letters[object_idx].ScaleLocal;
	}
示例#3
0
	public Vector3 GetLetterPosition(int object_idx, OBJ_POS position_requested = OBJ_POS.CENTER, TRANSFORM_SPACE transform_space = TRANSFORM_SPACE.WORLD)
	{
		if (m_letters == null || m_letters.Length == 0)
			return Vector3.zero;

		object_idx = Mathf.Clamp(object_idx, 0, m_letters.Length - 1);

		switch (position_requested)
		{
			case OBJ_POS.CENTER:
				return transform_space == TRANSFORM_SPACE.WORLD ? m_letters[object_idx].Center : m_letters[object_idx].CenterLocal;
			case OBJ_POS.BOTTOM_LEFT:
				return transform_space == TRANSFORM_SPACE.WORLD ? m_letters[object_idx].BottomLeft : m_letters[object_idx].BottomLeftLocal;
			case OBJ_POS.BOTTOM_RIGHT:
				return transform_space == TRANSFORM_SPACE.WORLD ? m_letters[object_idx].BottomRight : m_letters[object_idx].BottomRightLocal;
			case OBJ_POS.TOP_LEFT:
				return transform_space == TRANSFORM_SPACE.WORLD ? m_letters[object_idx].TopLeft : m_letters[object_idx].TopLeftLocal;
			case OBJ_POS.TOP_RIGHT:
				return transform_space == TRANSFORM_SPACE.WORLD ? m_letters[object_idx].TopRight : m_letters[object_idx].TopRightLocal;

			default:
				return Vector3.zero;
		}
	}