コード例 #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
ファイル: GetProperty.cs プロジェクト: xclouder/godbattle
 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
ファイル: GetProperty.cs プロジェクト: xclouder/godbattle
 /// <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
ファイル: PropertyOrField.cs プロジェクト: xclouder/godbattle
 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
ファイル: ObjectSet.cs プロジェクト: xclouder/godbattle
 public override void Reset () {
     variable = new ConcreteObjectVar();
     newValue = new ConcreteObjectVar();
 }
コード例 #11
0
 public override void Reset()
 {
     gameObject = new ConcreteGameObjectVar(this.self);
     newClip    = new ConcreteObjectVar();
 }
コード例 #12
0
 public override void Reset()
 {
     material      = new ConcreteMaterialVar();
     newShaderName = "Diffuse";
     newShader     = new ConcreteObjectVar();
 }
コード例 #13
0
ファイル: SetAudioClip.cs プロジェクト: xclouder/godbattle
 public override void Reset () {
     gameObject = new ConcreteGameObjectVar(this.self);
     newClip = new ConcreteObjectVar();
 } 
コード例 #14
0
 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
ファイル: SendMessage.cs プロジェクト: xclouder/godbattle
 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
ファイル: ObjectRandom.cs プロジェクト: xclouder/godbattle
 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
ファイル: BoolToObject.cs プロジェクト: xclouder/godbattle
 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();
 }
コード例 #24
0
 public override void Reset()
 {
     gameObject    = new ConcreteGameObjectVar(this.self);
     newShaderName = "Diffuse";
     newShader     = new ConcreteObjectVar();
 }
コード例 #25
0
 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();
 }