public override void CopyFrom <T>(T other) { RectTemplate otherTemplate = null; if (other.GetType() == typeof(RectTemplate)) { otherTemplate = other as RectTemplate; } RectTransform otherRect = null; if (other.GetType() == typeof(RectTransform)) { otherRect = other as RectTransform; } if (otherRect == null && otherTemplate == null) { return; } if (otherRect != null) { CopyFrom(otherRect); } if (otherTemplate != null) { CopyFrom(otherTemplate); } }
public void CopyFrom(RectTemplate template) { anchorMin.value = template.anchorMin.value; anchorMax.value = template.anchorMax.value; sizeDelta.value = template.sizeDelta.value; offsetMax.value = template.offsetMax.value; offsetMin.value = template.offsetMin.value; pivot.value = template.pivot.value; anchoredPosition.value = template.anchoredPosition.value; anchorMin.apply = template.anchorMin.apply; anchorMax.apply = template.anchorMax.apply; sizeDelta.apply = template.sizeDelta.apply; offsetMax.apply = template.offsetMax.apply; offsetMin.apply = template.offsetMin.apply; pivot.apply = template.pivot.apply; anchoredPosition.apply = template.anchoredPosition.apply; }