Beispiel #1
0
 private void OnEnable()
 {
     _target = (LevelObject)target;
     _drawNetworkBehaviour = new SavedBool($"{_target.GetType()}.DrawNetworkBehaviour", false);
     _drawReferences       = new SavedBool($"{_target.GetType()}.DrawReferences", false);
     EditorUtility.SetDirty(target);
 }
Beispiel #2
0
        private void PropertiesPanel_Loaded(object sender, RoutedEventArgs e)
        {
            var typeConverter = new LevelObjectTypeConverter();

            ObjectIcon.Source = typeConverter.Convert(levelObject.ObjectType, typeof(BitmapImage),
                                                      "IgnoreExceptions", CultureInfo.InvariantCulture) as BitmapImage;
            ObjectName.Content = levelObject.ObjectType;

            foreach (var editableProperty in levelObject.GetEditableProperties())
            {
                string value = levelObject.GetType().GetProperty(editableProperty.Name).GetValue(levelObject).ToString();
                propertyList.Add(new PropertyListEntry {
                    Name = editableProperty.Name, Value = value
                });
            }

            PropertyList.ItemsSource = propertyList;
        }