"unity recttransform resize event" Code Answer's
You're definitely familiar with the best coding language C# that developers use to develop their projects and they get all their queries like "unity recttransform resize event" answered properly. Developers are finding an appropriate answer about unity recttransform resize event related to the C# coding language. By visiting this online portal developers get answers concerning C# codes question like unity recttransform resize event. Enter your desired code related query in the search bar and get every piece of information about C# code related question on unity recttransform resize event.
unity recttransform resize event
using UnityEngine;
using UnityEngine.UI;
namespace FeelFreeToBorrowThisCode
{
[RequireComponent(typeof(HorizontalLayoutGroup))]
public class ResponsiveColumns : MonoBehaviour
{
RectTransform _leftSide;
RectTransform _rightSide;
RectTransform _column2;
bool _vertical = true;
void Start()
{
RectTransform rtrans = (RectTransform)transform;
_leftSide = (RectTransform)rtrans.GetChild(0);
_rightSide = (RectTransform)rtrans.GetChild(1);
_column2 = (RectTransform)_leftSide.GetChild(1);
UpdateLayout();
}
void OnRectTransformDimensionsChange()
{
UpdateLayout();
}
void UpdateLayout()
{
if (_leftSide == null) return;
if (Screen.width > Screen.height)
{
if (_vertical)
{
_column2.SetParent(_rightSide);
_rightSide.gameObject.SetActive(true);
_vertical = false;
}
}
else if (!_vertical)
{
_column2.SetParent(_leftSide);
_rightSide.gameObject.SetActive(false);
_vertical = true;
}
}
}
}
Source: answers.unity.com
All those coders who are working on the C# based application and are stuck on unity recttransform resize event can get a collection of related answers to their query. Programmers need to enter their query on unity recttransform resize event related to C# code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about unity recttransform resize event for the programmers working on C# code while coding their module. Coders are also allowed to rectify already present answers of unity recttransform resize event while working on the C# language code. Developers can add up suggestions if they deem fit any other answer relating to "unity recttransform resize event". Visit this developer's friendly online web community, CodeProZone, and get your queries like unity recttransform resize event resolved professionally and stay updated to the latest C# updates.