void OnEnable() { m_Weight = serializedObject.FindProperty("m_Weight"); m_SourceObjectsToggle = serializedObject.FindProperty("m_SourceObjectsGUIToggle"); m_SettingsToggle = serializedObject.FindProperty("m_SettingsGUIToggle"); var data = serializedObject.FindProperty("m_Data"); m_ConstrainedObject = data.FindPropertyRelative("m_ConstrainedObject"); m_ConstrainedPositionAxes = data.FindPropertyRelative("m_ConstrainedPositionAxes"); m_ConstrainedRotationAxes = data.FindPropertyRelative("m_ConstrainedRotationAxes"); m_SourceObjects = data.FindPropertyRelative("m_SourceObjects"); m_MaintainPositionOffset = data.FindPropertyRelative("m_MaintainPositionOffset"); m_MaintainRotationOffset = data.FindPropertyRelative("m_MaintainRotationOffset"); m_ReorderableList = ReorderableListHelper.Create(serializedObject, m_SourceObjects); if (m_ReorderableList.count == 0) { ((MultiParentConstraint)serializedObject.targetObject).data.sourceObjects.Add(WeightedJobTransform.defaultNoSync(1f)); } m_ReorderableList.onAddCallback = (ReorderableList list) => { ((MultiParentConstraint)serializedObject.targetObject).data.sourceObjects.Add(WeightedJobTransform.defaultNoSync(1f)); }; }
void OnEnable() { m_Rigs = serializedObject.FindProperty("m_RigLayers"); m_ReorderableList = ReorderableListHelper.Create(serializedObject, m_Rigs, true, true); if (m_ReorderableList.count == 0) { ((RigBuilder)serializedObject.targetObject).layers.Add(new RigBuilder.RigLayer(null)); } m_ReorderableList.drawHeaderCallback = (Rect rect) => EditorGUI.LabelField(rect, k_RigLabel); m_ReorderableList.onAddCallback = (ReorderableList list) => { ((RigBuilder)(serializedObject.targetObject)).layers.Add(new RigBuilder.RigLayer(null, true)); }; }
void OnEnable() { m_Weight = serializedObject.FindProperty("m_Weight"); m_SourceObjectsToggle = serializedObject.FindProperty("m_SourceObjectsGUIToggle"); var data = serializedObject.FindProperty("m_Data"); m_Driver = data.FindPropertyRelative("m_Driver"); m_SourceObjects = data.FindPropertyRelative("m_SourceObjects"); m_ReorderableList = ReorderableListHelper.Create(serializedObject, m_SourceObjects, false); m_DrivingLabels = new List <string>(); UpdateDrivingList(m_ReorderableList.count); if (m_ReorderableList.count == 0) { ((MultiReferentialConstraint)serializedObject.targetObject).data.sourceObjects.Add(JobTransform.defaultNoSync); } }
void OnEnable() { m_Weight = serializedObject.FindProperty("m_Weight"); m_TwistNodesToggle = serializedObject.FindProperty("m_TwistNodesGUIToggle"); var data = serializedObject.FindProperty("m_Data"); m_Source = data.FindPropertyRelative("m_Source"); m_TwistAxis = data.FindPropertyRelative("m_TwistAxis"); m_TwistNodes = data.FindPropertyRelative("m_TwistNodes"); m_ReorderableList = ReorderableListHelper.Create(serializedObject, m_TwistNodes, false); if (m_ReorderableList.count == 0) { ((TwistCorrection)serializedObject.targetObject).data.twistNodes.Add(new TwistNode(null)); } m_ReorderableList.onAddCallback = (ReorderableList list) => { ((TwistCorrection)serializedObject.targetObject).data.twistNodes.Add(new TwistNode(null)); }; }