Esempio n. 1
0
        /// <summary>
        /// Draw a vector3 variable.
        /// <param name="rect">The position to draw the variable.</param>
        /// <param name="vector3Var">The vector3 variable to be drawn.</param>
        /// </summary>
        static void DrawVector3Var(Rect rect, Vector3Var vector3Var)
        {
            rect.yMin += 3f;
            rect.yMax -= 2f;
            rect.xMin += 6f;
            rect.xMax -= 6f;

            DrawName(new Rect(rect.x, rect.y, c_SmallNameWidth, rect.height), vector3Var);

            rect.xMin += c_SmallNameWidth + c_Space;
            rect.xMax -= c_MinusButtonWidth + c_RightPadding;
            #if UNITY_4_0_0 || UNITY_4_1 || UNITY_4_2
            rect.y -= 19f;
            #endif
            EditorGUI.BeginChangeCheck();
            var newValue = EditorGUI.Vector3Field(rect, string.Empty, vector3Var.Value);
            if (EditorGUI.EndChangeCheck() && newValue != vector3Var.Value)
            {
                // Register undo
                if (vector3Var.blackboard != null)
                {
                    #if UNITY_4_0_0 || UNITY_4_1 || UNITY_4_2
                    Undo.RegisterUndo(vector3Var.blackboard, "Variable Value");
                    #else
                    Undo.RecordObject(vector3Var.blackboard, "Variable Value");
                    #endif
                }

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

            rect.x += rect.width + 2f;
            #if UNITY_4_0_0 || UNITY_4_1 || UNITY_4_2
            rect.y += 19f;
            #endif
            rect.width = c_MinusButtonWidth;
            rect.yMin -= 2f;
            rect.yMax += 2f;
            if (GUI.Button(rect, s_Styles.iconToolbarMinus, s_Styles.invisbleButton))
            {
                s_VariableToRemove = vector3Var;
            }
        }
Esempio n. 2
0
    // Update is called once per frame
    public override Status Update()
    {
        if (other.isNone)
        {
            return(Status.Error);
        }
        if (var.isNone)
        {
            return(Status.Error);
        }

        Vector3Var otherVar = other.Value.GetComponent <InternalBlackboard>().GetVector3Var(varName);

        if (otherVar != null)
        {
            otherVar.Value = var.Value;
        }

        return(Status.Success);
    }
Esempio n. 3
0
 // Use this for initialization
 public override void Reset()
 {
     other = new ConcreteGameObjectVar();
     var   = new ConcreteVector3Var();
 }
Esempio n. 4
0
 // Use this for initialization
 public override void Reset()
 {
     storePos        = new ConcreteVector3Var();
     storeGameObject = new ConcreteGameObjectVar();
     storeNormal     = new ConcreteVector3Var();
 }
Esempio n. 5
0
 // Use this for initialization
 public override void Reset()
 {
     inDir    = new ConcreteVector3Var();
     inNormal = new ConcreteVector3Var();
     outDir   = new ConcreteVector3Var();
 }
 // Use this for initialization
 public override void Reset()
 {
     list        = new ConcreteDynamicList();
     index       = new ConcreteIntVar();
     storeObject = new ConcreteVector3Var();
 }
Esempio n. 7
0
 // Use this for initialization
 public override void Reset()
 {
     hitpos = new ConcreteVector3Var();
     hitedGameObjectStore = new ConcreteGameObjectVar();
     storeNormal          = new ConcreteVector3Var();
 }
Esempio n. 8
0
 // Use this for initialization
 public override void Reset()
 {
     storeDir = new ConcreteVector3Var();
 }