예제 #1
0
        public override void Reset()
        {
            base.Reset();

            a = new ConcreteObjectVar();
            b = new ConcreteObjectVar();
        }
예제 #2
0
 public override void Reset()
 {
     boolVariable = new ConcreteBoolVar();
     trueValue    = (UnityEngine.Object)null;
     falseValue   = (UnityEngine.Object)null;
     storeObject  = new ConcreteObjectVar();
 }
예제 #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();
 }
예제 #4
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();
 }
예제 #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();
             }
         }
     }
 }
예제 #6
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;
 }
예제 #7
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();
                    }
                }
            }
        }
예제 #8
0
 public override void Reset () {
     targetObject = (UnityEngine.Object)null;
     propertyName = string.Empty;
 }
예제 #9
0
        /// <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;
        }
예제 #10
0
 public override void Reset () {
     variable = new ConcreteObjectVar();
     newValue = new ConcreteObjectVar();
 }
예제 #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();
 }
예제 #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;
 }
예제 #15
0
 public override void Reset()
 {
     material    = new ConcreteMaterialVar();
     storeShader = new ConcreteObjectVar();
 }
예제 #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;
 }
예제 #17
0
 public override void Reset () {
     objects = new ObjectVar[0];
     storeObject = new ConcreteObjectVar();
 }
예제 #18
0
 public override void Reset()
 {
     gameObject  = new ConcreteGameObjectVar(this.self);
     storeShader = new ConcreteObjectVar();
 }
예제 #19
0
 public override void Reset()
 {
     targetObject = (UnityEngine.Object)null;
     propertyName = string.Empty;
 }
예제 #20
0
 public override void Reset () {
     boolVariable = new ConcreteBoolVar();
     trueValue = (UnityEngine.Object)null;
     falseValue = (UnityEngine.Object)null;
     storeObject = new ConcreteObjectVar();
 }
예제 #21
0
 public override void Reset()
 {
     newGuiskin = new ConcreteObjectVar();
 }
예제 #22
0
 public override void Reset()
 {
     variable = new ConcreteObjectVar();
     newValue = new ConcreteObjectVar();
 }
예제 #23
0
 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();
 }
예제 #26
0
 public override void Reset () {
     gameObject = new ConcreteGameObjectVar(this.self);
     audioClip = new ConcreteObjectVar();
     volumeScale = 1f;
 } 
예제 #27
0
 public override void Reset()
 {
     gameObject  = new ConcreteGameObjectVar(this.self);
     audioClip   = new ConcreteObjectVar();
     volumeScale = 1f;
 }
예제 #28
0
 public override void Reset () {
     gameObject = new ConcreteGameObjectVar(this.self);
     storeShader = new ConcreteObjectVar();
 }
예제 #29
0
 /// <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;
 }
예제 #30
0
 public override void Reset () {
     gameObject = this.self;
     newSprite = new ConcreteObjectVar();
     newColor = new ConcreteColorVar();
 }
예제 #31
0
        public override void Reset () {
            base.Reset();

            a = new ConcreteObjectVar();
            b = new ConcreteObjectVar();
        }
예제 #32
0
 public override void Reset () {
     material = new ConcreteMaterialVar();
     storeShader = new ConcreteObjectVar();
 }