Ejemplo n.º 1
0
        public override void OnDrawOutport(int outportIndex, OutportContainer outportContainer)
        {
            base.OnDrawOutport(outportIndex, outportContainer);

            SerializedProperty setterValueProp = TargetProperty.FindPropertyRelative(BlackboardSetter.SetterValueVarName);

            outportContainer.OutportBody.Add(new Label(BlackboardSetter.GetOutportLabel(setterValueProp)));
        }
Ejemplo n.º 2
0
        private void ValidateBlackboardElement(int undoGroup = -1)
        {
            TargetProperty.serializedObject.Update();

            if (undoGroup == -1)
            {
                undoGroup = Undo.GetCurrentGroup();
            }

            BlackboardSetter target = (Target as BlackboardSetter);

            if (BlackboardProperties.GetElementById(target.BlackboardElementId) == null)
            {
                TargetProperty.FindPropertyRelative(BlackboardSetter.BlackboardElementIdVarName).stringValue = "";
                SerializedProperty setterValueProp = TargetProperty.FindPropertyRelative(BlackboardSetter.SetterValueVarName);
                setterValueProp.managedReferenceValue = null;
                TargetProperty.serializedObject.ApplyModifiedProperties();
            }
            Undo.CollapseUndoOperations(undoGroup);
            TargetProperty.serializedObject.Update();
        }