public override void Reset()
        {
            base.Reset();

            a = new ConcreteObjectVar();
            b = new ConcreteObjectVar();
        }
 public override void Reset()
 {
     boolVariable = new ConcreteBoolVar();
     trueValue    = (UnityEngine.Object)null;
     falseValue   = (UnityEngine.Object)null;
     storeObject  = new ConcreteObjectVar();
 }
Exemple #3
0
 public override void Reset () {
     base.Reset();
     SingleValue = new ConcreteFloatVar();
     intValue = new ConcreteIntVar();
     BooleanValue = new ConcreteBoolVar();
     StringValue = new ConcreteStringVar();
     Vector3Value = new ConcreteVector3Var();
     RectValue = new ConcreteRectVar();
     ColorValue = new ConcreteColorVar();
     GameObjectValue = new ConcreteGameObjectVar(this.self);
     MaterialValue = new ConcreteMaterialVar();
     TextureValue = new ConcreteTextureVar();
     ObjectValue = new ConcreteObjectVar();
 }
 public override void Reset()
 {
     base.Reset();
     SingleValue     = new ConcreteFloatVar();
     intValue        = new ConcreteIntVar();
     BooleanValue    = new ConcreteBoolVar();
     StringValue     = new ConcreteStringVar();
     Vector3Value    = new ConcreteVector3Var();
     RectValue       = new ConcreteRectVar();
     ColorValue      = new ConcreteColorVar();
     GameObjectValue = new ConcreteGameObjectVar(this.self);
     MaterialValue   = new ConcreteMaterialVar();
     TextureValue    = new ConcreteTextureVar();
     ObjectValue     = new ConcreteObjectVar();
 }
Exemple #5
0
 /// <summary>
 /// Behaviour Machine callback called when a value is changed in the inspector (Called in the editor only).
 /// </summary>
 public override void OnValidate () {
     // The property is a unity object?
     var propertyType = this.propertyType;
     if (propertyType != null && propertyType.IsSubclassOf(typeof(Object))) {
         if (ObjectValue.isConstant) {
             ObjectValue.ObjectType = propertyType;
             ObjectValue.OnValidate();
         }
         else {
             var objectType = ObjectValue.ObjectType;
             if (objectType != propertyType && !objectType.IsSubclassOf(propertyType)) {
                 ObjectValue = new ConcreteObjectVar();
             }
         }
     }
 }
 public override void Reset()
 {
     gameObject          = new ConcreteGameObjectVar(this.self);
     methodName          = new ConcreteStringVar();
     options             = SendMessageOptions.RequireReceiver;
     floatParameter      = new ConcreteFloatVar();
     intParameter        = new ConcreteIntVar();
     boolParameter       = new ConcreteBoolVar();
     stringParameter     = new ConcreteStringVar();
     vector3Parameter    = new ConcreteVector3Var();
     rectParameter       = new ConcreteRectVar();
     colorParameter      = new ConcreteColorVar();
     quaternionParameter = new ConcreteQuaternionVar();
     gameObjectParameter = new ConcreteGameObjectVar(this.self);
     textureParameter    = new ConcreteTextureVar();
     materialParameter   = new ConcreteMaterialVar();
     fsmEventParameter   = new ConcreteFsmEvent();
     objectParameter     = new ConcreteObjectVar();
     messageType         = MessageType.SendMessage;
 }
        /// <summary>
        /// Behaviour Machine callback called when a value is changed in the inspector (Called in the editor only).
        /// </summary>
        public override void OnValidate()
        {
            // The property is a unity object?
            var propertyType = this.propertyType;

            if (propertyType != null && propertyType.IsSubclassOf(typeof(Object)))
            {
                if (ObjectValue.isConstant)
                {
                    ObjectValue.ObjectType = propertyType;
                    ObjectValue.OnValidate();
                }
                else
                {
                    var objectType = ObjectValue.ObjectType;
                    if (objectType != propertyType && !objectType.IsSubclassOf(propertyType))
                    {
                        ObjectValue = new ConcreteObjectVar();
                    }
                }
            }
        }
 public override void Reset () {
     targetObject = (UnityEngine.Object)null;
     propertyName = string.Empty;
 }
        /// <summary> 
        /// Draw an object variable.
        /// <param name="rect">The position to draw the variable.</param>
        /// <param name="objectVar">The object variable to be drawn.</param>
        /// <param name="isAsset">The variable blackboard is an asset?</param>
        /// </summary>
        static void DrawObjectVar (Rect rect, ObjectVar objectVar, bool isAsset) {
            // Name
            rect.yMin += 3f;
            rect.yMax -= 2f;
            rect.xMin += 6f;
            rect.xMax -= 6f;
            rect.height -= c_TwoLinesHeight - c_OneLineHeight;
            DrawName(new Rect (rect.x, rect.y, c_SmallNameWidth, rect.height), objectVar);

            // Value
            rect.xMin += c_SmallNameWidth + c_Space;
            rect.xMax -= c_MinusButtonWidth + c_RightPadding;
            var objectType = objectVar.ObjectType;
            EditorGUI.BeginChangeCheck();
            var newValue = EditorGUI.ObjectField (rect, GUIContent.none, objectVar.Value, objectType, !isAsset);
            if (EditorGUI.EndChangeCheck() && newValue != objectVar.Value) {
                // Register undo
                if (objectVar.blackboard != null) { 
                    #if UNITY_4_0_0 || UNITY_4_1 || UNITY_4_2
                    Undo.RegisterUndo(objectVar.blackboard, "Variable Value");
                    #else
                    Undo.RecordObject(objectVar.blackboard, "Variable Value");
                    #endif
                }

                // Update variable value
                objectVar.Value = newValue;
                // Set blackboard dirty flag
                if (objectVar.blackboard != null) EditorUtility.SetDirty(objectVar.blackboard);
            }

            // Object Type
            rect.y += rect.height + 3f;
            var objectTypeAsString = objectType.ToString();
            if (GUI.Button(rect, objectTypeAsString, EditorStyles.popup)) {
                var menu = new GenericMenu();
                // Add None
                menu.AddItem(new GUIContent("None"), string.IsNullOrEmpty(objectTypeAsString), SetObjectType, new SetObjectVarType(objectVar, typeof(UnityEngine.Object)));

                // Add to menu all types that inherites from UnityEngine.Object
                var types = TypeUtility.GetDerivedTypes(typeof(UnityEngine.Object));
                for (int y = 0; y < types.Length; y++) { 
                    var typeAsString = types[y].ToString();
                    menu.AddItem(new GUIContent(typeAsString.Replace('.', '/')), objectTypeAsString == typeAsString, SetObjectType, new SetObjectVarType(objectVar, types[y]));
                }

                menu.ShowAsContext();
            }

            // Minus button
            rect.x += rect.width + 2f;
            rect.y -= rect.height + 3f;
            rect.width = c_MinusButtonWidth;
            rect.yMin -= 2f;
            rect.yMax += 2f;
            if (GUI.Button(rect, s_Styles.iconToolbarMinus, s_Styles.invisbleButton))
                s_VariableToRemove = objectVar;
        }
Exemple #10
0
 public override void Reset () {
     variable = new ConcreteObjectVar();
     newValue = new ConcreteObjectVar();
 }
Exemple #11
0
 public override void Reset()
 {
     gameObject = new ConcreteGameObjectVar(this.self);
     newClip    = new ConcreteObjectVar();
 }
 public override void Reset()
 {
     material      = new ConcreteMaterialVar();
     newShaderName = "Diffuse";
     newShader     = new ConcreteObjectVar();
 }
Exemple #13
0
 public override void Reset () {
     gameObject = new ConcreteGameObjectVar(this.self);
     newClip = new ConcreteObjectVar();
 } 
 public override void Reset()
 {
     audioClip   = new ConcreteObjectVar();
     position    = new ConcreteVector3Var();
     volumeScale = 1f;
 }
Exemple #15
0
 public override void Reset()
 {
     material    = new ConcreteMaterialVar();
     storeShader = new ConcreteObjectVar();
 }
Exemple #16
0
 public override void Reset () {
     gameObject = new ConcreteGameObjectVar(this.self);
     methodName = new ConcreteStringVar();
     options = SendMessageOptions.RequireReceiver;
     floatParameter = new ConcreteFloatVar();
     intParameter = new ConcreteIntVar();
     boolParameter = new ConcreteBoolVar();
     stringParameter = new ConcreteStringVar();
     vector3Parameter = new ConcreteVector3Var();
     rectParameter = new ConcreteRectVar();
     colorParameter = new ConcreteColorVar();
     quaternionParameter = new ConcreteQuaternionVar();
     gameObjectParameter = new ConcreteGameObjectVar(this.self);
     textureParameter = new ConcreteTextureVar();
     materialParameter = new ConcreteMaterialVar();
     fsmEventParameter = new ConcreteFsmEvent();
     objectParameter = new ConcreteObjectVar();
     messageType = MessageType.SendMessage;
 }
Exemple #17
0
 public override void Reset () {
     objects = new ObjectVar[0];
     storeObject = new ConcreteObjectVar();
 }
Exemple #18
0
 public override void Reset()
 {
     gameObject  = new ConcreteGameObjectVar(this.self);
     storeShader = new ConcreteObjectVar();
 }
 public override void Reset()
 {
     targetObject = (UnityEngine.Object)null;
     propertyName = string.Empty;
 }
Exemple #20
0
 public override void Reset () {
     boolVariable = new ConcreteBoolVar();
     trueValue = (UnityEngine.Object)null;
     falseValue = (UnityEngine.Object)null;
     storeObject = new ConcreteObjectVar();
 }
Exemple #21
0
 public override void Reset()
 {
     newGuiskin = new ConcreteObjectVar();
 }
 public override void Reset()
 {
     variable = new ConcreteObjectVar();
     newValue = new ConcreteObjectVar();
 }
 public override void Reset()
 {
     objects     = new ObjectVar[0];
     storeObject = new ConcreteObjectVar();
 }
 public override void Reset()
 {
     gameObject    = new ConcreteGameObjectVar(this.self);
     newShaderName = "Diffuse";
     newShader     = new ConcreteObjectVar();
 }
 public override void Reset()
 {
     gameObject = this.self;
     newSprite  = new ConcreteObjectVar();
     newColor   = new ConcreteColorVar();
 }
 public override void Reset () {
     gameObject = new ConcreteGameObjectVar(this.self);
     audioClip = new ConcreteObjectVar();
     volumeScale = 1f;
 } 
 public override void Reset()
 {
     gameObject  = new ConcreteGameObjectVar(this.self);
     audioClip   = new ConcreteObjectVar();
     volumeScale = 1f;
 }
 public override void Reset () {
     gameObject = new ConcreteGameObjectVar(this.self);
     storeShader = new ConcreteObjectVar();
 }
 /// <summary> 
 /// The class constructor.
 /// <param name= "objectVar">The target ObjectVar.</param>
 /// <param name= "objectType">The new ObjectVar type.</param>
 /// </summary>
 public SetObjectVarType (ObjectVar objectVar, System.Type objectType) {
     this.objectVar = objectVar;
     this.objectType = objectType;
 }
 public override void Reset () {
     gameObject = this.self;
     newSprite = new ConcreteObjectVar();
     newColor = new ConcreteColorVar();
 }
        public override void Reset () {
            base.Reset();

            a = new ConcreteObjectVar();
            b = new ConcreteObjectVar();
        }
 public override void Reset () {
     material = new ConcreteMaterialVar();
     storeShader = new ConcreteObjectVar();
 }