publicclassUIOfflineData : OfflineData { public Vector2[] m_AnchorMax; public Vector2[] m_AnchorMin; public Vector2[] m_Pivot; public Vector2[] m_SizeDelta; public Vector3[] m_AnchoredPos; public ParticleSystem[] m_Particle;
publicoverridevoidResetProp() { int allPointCount = m_AllPoint.Length; for (int i = 0; i < allPointCount; i++) { RectTransform tempTrans = m_AllPoint[i] as RectTransform; if (tempTrans != null) { tempTrans.localPosition = m_Pos[i]; tempTrans.localRotation = m_Rot[i]; tempTrans.localScale = m_Scale[i]; tempTrans.anchorMax = m_AnchorMax[i]; tempTrans.anchorMin = m_AnchorMin[i]; tempTrans.pivot = m_Pivot[i]; tempTrans.sizeDelta = m_SizeDelta[i]; tempTrans.anchoredPosition3D = m_AnchoredPos[i];
if (m_AllPointActive[i]) { if (!tempTrans.gameObject.activeSelf) { tempTrans.gameObject.SetActive(true); } } else { if (tempTrans.gameObject.activeSelf) { tempTrans.gameObject.SetActive(false); } }
if (tempTrans.childCount > m_AllPointChildCount[i]) { int childCount = tempTrans.childCount; for (int j = m_AllPointChildCount[i]; j < childCount; j++) { GameObject tempObj = tempTrans.GetChild(j).gameObject; if (!ObjectPoolManager.Instance.IsPoolManagerCreat(tempObj)) { GameObject.Destroy(tempObj); } } }
}
} int particleCount = m_Particle.Length; for (int i = 0; i < particleCount; i++) { m_Particle[i].Clear(true); m_Particle[i].Play(); }
}
publicoverridevoidBindData() { Transform[] allTrans = gameObject.GetComponentsInChildren<Transform>(true); int allTransCount = allTrans.Length; for (int i = 0; i < allTransCount; i++) { GetOrAddRectTransform(allTrans[i]); }
int allPointCount = m_AllPoint.Length; m_AllPointChildCount = newint[allPointCount]; m_AllPointActive = newbool[allPointCount]; m_Pos = new Vector3[allPointCount]; m_Rot = new Quaternion[allPointCount]; m_Scale = new Vector3[allPointCount];
m_Pivot = new Vector2[allPointCount]; m_AnchorMax = new Vector2[allPointCount]; m_AnchorMin = new Vector2[allPointCount]; m_SizeDelta = new Vector2[allPointCount]; m_AnchoredPos = new Vector3[allPointCount];
for (int i = 0; i < allPointCount; i++) { RectTransform temp = m_AllPoint[i] as RectTransform; m_AllPointChildCount[i] = temp.childCount; m_AllPointActive[i] = temp.gameObject.activeSelf; m_Pos[i] = temp.localPosition; m_Rot[i] = temp.localRotation; m_Scale[i] = temp.localScale;