Beispiel #1
0
 protected override void OnValueChanged()
 {
     if (!((Object)this.target == (Object)null))
     {
         this.ignore = true;
         if (base.getter != null)
         {
             this.target.value = BloxUtil.AsFloat(base.getter.Value);
         }
         this.ignore = false;
     }
 }
 public override void Execute(object blackboardValue)
 {
     this.CacheAttribute();
     if (this.valSetterSource != null && this.att != null)
     {
         float num = BloxUtil.AsFloat(this.valSetterSource.GetValue(base.owner, blackboardValue));
         if (this.attValType == ValueType.Value)
         {
             this.att.Value = num;
         }
         else
         {
             this.att.MaxValue = num;
         }
     }
 }
        private void UpdateLocalValue()
        {
            float time = BloxUtil.AsFloat(this.param1.Value);

            this._val = this.curve.Evaluate(time);
            if (this.roundingOpt != 0)
            {
                if (this.roundingOpt == RoundingOption.Round)
                {
                    this._val = Mathf.Round(this._val);
                }
                else if (this.roundingOpt == RoundingOption.Floor)
                {
                    this._val = Mathf.Floor(this._val);
                }
                else if (this.roundingOpt == RoundingOption.Ceil)
                {
                    this._val = Mathf.Ceil(this._val);
                }
            }
        }
        private void UpdateLocalValue()
        {
            object value  = this.param1.Value;
            object value2 = this.param2.Value;
            object o      = null;

            try
            {
                switch (this.opt)
                {
                case MathsOperation.Add:
                    o = BloxMathsUtil.Add(value, value2);
                    break;

                case MathsOperation.Subtract:
                    o = BloxMathsUtil.Subtract(value, value2);
                    break;

                case MathsOperation.Multiply:
                    o = BloxMathsUtil.Multiply(value, value2);
                    break;

                case MathsOperation.Divide:
                    o = BloxMathsUtil.Divide(value, value2);
                    break;

                case MathsOperation.Modulo:
                    o = BloxMathsUtil.Modulo(value, value2);
                    break;
                }
                this._val = BloxUtil.AsFloat(o);
            }
            catch (Exception ex)
            {
                Debug.LogError(ex.Message);
            }
        }
Beispiel #5
0
        private void UpdateLocalValue()
        {
            float num = BloxUtil.AsFloat(this.param1.Value);

            this._val = (float)(this.yIsInput ? this.curve.GetXValue(num) : this.curve.GetYValue(Mathf.RoundToInt(num)));
        }