private static void CheckMesh(SerializedCylinderTarget serializedObject) { foreach (CylinderTargetAbstractBehaviour expr_15 in serializedObject.GetBehaviours()) { MeshFilter component = expr_15.gameObject.GetComponent <MeshFilter>(); MeshRenderer component2 = expr_15.gameObject.GetComponent <MeshRenderer>(); if (component == null || component.sharedMesh == null || component2 == null || component2.sharedMaterials.Length == 0 || component2.sharedMaterials[0] == null) { ConfigData.CylinderTargetData ctConfig; ConfigDataManager.Instance.GetConfigData(serializedObject.GetDataSetName()).GetCylinderTarget(serializedObject.TrackableName, out ctConfig); CylinderTargetEditor.UpdateAspectRatio(serializedObject, ctConfig); } } }
internal static void UpdateAspectRatio(SerializedCylinderTarget serializedObject, ConfigData.CylinderTargetData ctConfig) { float num = ctConfig.topDiameter / ctConfig.sideLength; float num2 = ctConfig.bottomDiameter / ctConfig.sideLength; serializedObject.TopDiameterRatio = num; serializedObject.BottomDiameterRatio = num2; UnityEngine.Object[] targetObjects = serializedObject.SerializedObject.targetObjects; for (int i = 0; i < targetObjects.Length; i++) { CylinderTargetEditor.UpdateGeometry(((CylinderTargetAbstractBehaviour)targetObjects[i]).gameObject, 1f, num, num2, ctConfig.hasTopGeometry, ctConfig.hasBottomGeometry); } string arg_92_0 = serializedObject.GetDataSetName(); string trackableName = serializedObject.TrackableName; Material[] material = CylinderTargetEditor.UpdateMaterials(arg_92_0, trackableName, ctConfig.hasBottomGeometry, ctConfig.hasTopGeometry, true, serializedObject.GetMaterials()); serializedObject.SetMaterial(material); }