Esempio n. 1
0
        public EyesTargetContainer Clone(int cloneFlags)
        {
            var t = new EyesTargetContainer();

            CopyTo(t, cloneFlags);
            return(t);
        }
Esempio n. 2
0
 public Preview(EyesModifier m, EyesTargetContainer tc, float alpha)
 {
     modifier = m;
     t        = tc;
     alpha_   = alpha * AlphaFactor;
     Create();
 }
Esempio n. 3
0
        public EyesTargetContainer AddTarget(EyesTargetContainer t = null)
        {
            if (t == null)
            {
                t = new EyesTargetContainer();
            }

            targets_.Add(t);
            return(t);
        }
Esempio n. 4
0
        public EyesModifierTargetUIContainer(EyesModifier m, EyesTargetContainer t)
        {
            modifier_  = m;
            container_ = t;

            delete_ = new ConfirmableButton(
                "Delete target", DeleteTarget, Widget.Right);

            types_ = new FactoryStringList <EyesTargetFactory, IEyesTarget>(
                "Type", TypeChanged, Widget.Right);

            enabled_ = new Checkbox(
                "Enabled", t.Enabled, EnabledChanged, Widget.Right);

            collapsible_ = new Collapsible(
                container_.Name, null, Widget.Right);

            UpdateWidgets();
        }
Esempio n. 5
0
        public override bool FromJSON(J.Node n)
        {
            if (!base.FromJSON(n))
            {
                return(false);
            }

            var o = n.AsObject("EyesModifier");

            if (o == null)
            {
                return(false);
            }

            targets_.Clear();

            var targetsArray = o.Get("targets").AsArray();

            if (targetsArray != null)
            {
                targetsArray.ForEach((node) =>
                {
                    var tc = new EyesTargetContainer();
                    if (tc.FromJSON(node))
                    {
                        targets_.Add(tc);
                    }
                });
            }

            o.Opt("saccadeTime", ref saccadeTime_);
            o.Opt("saccadeMin", saccadeMin_);
            o.Opt("saccadeMax", saccadeMax_);
            o.Opt("minDistance", minDistance_);
            o.Opt("focusDuration", ref focusDuration_);
            o.Opt("gaze", ref gazeSetting_);
            o.Opt("blink", ref blinkSetting_);

            UpdateAtom();

            return(true);
        }
Esempio n. 6
0
        public RandomEyesTargetUI(
            EyesModifierTargetUIContainer parent, EyesTargetContainer tc)
            : base(parent, tc)
        {
            target_ = tc.Target as RandomEyesTarget;

            var r = new FloatRange(0, 10);

            atom_ = new AtomList(
                "Relative atom", target_?.Atom?.uid, AtomChanged,
                null, Widget.Right);

            rel_ = new ForceReceiverList(
                "Relative receiver", target_?.RelativeTo?.name,
                ReceiverChanged, Widget.Right);

            distance_ = new FloatSlider(
                "Distance", target_.Distance, r, DistanceChanged, Widget.Right);

            centerX_ = new FloatSlider(
                "Offset X", target_.CenterX, r, CenterXChanged, Widget.Right);

            centerY_ = new FloatSlider(
                "Offset Y", target_.CenterY, r, CenterYChanged, Widget.Right);

            xRange_ = new FloatSlider(
                "Range X", target_.RangeX, r, RangeXChanged, Widget.Right);

            yRange_ = new FloatSlider(
                "Range Y", target_.RangeY, r, RangeYChanged, Widget.Right);

            avoidXRange_ = new FloatSlider(
                "Avoid range X", target_.AvoidRangeX, r,
                AvoidRangeXChanged, Widget.Right);

            avoidYRange_ = new FloatSlider(
                "Avoid range Y", target_.AvoidRangeY, r,
                AvoidRangeYChanged, Widget.Right);

            rel_.Atom = target_.Atom;
        }
Esempio n. 7
0
        public RigidbodyEyesTargetUI(
            EyesModifierTargetUIContainer parent, EyesTargetContainer tc)
            : base(parent, tc)
        {
            target_ = tc.Target as RigidbodyEyesTarget;

            atom_ = new AtomList(
                "Atom", target_?.Atom?.uid, AtomChanged,
                null, Widget.Right);

            receiver_ = new ForceReceiverList(
                "Receiver", target_?.Receiver?.name,
                ReceiverChanged, Widget.Right);

            offset_ = new Vector3UI(
                "Offset", Widget.Right,
                new FloatRange(-10, 10), OffsetChanged);

            offset_.Value  = target_.Offset;
            receiver_.Atom = target_.Atom;
        }
Esempio n. 8
0
 public PlayerEyesTargetUI(
     EyesModifierTargetUIContainer parent, EyesTargetContainer t)
     : base(parent, t)
 {
 }
Esempio n. 9
0
 public BasicEyesModifierTargetUI(
     EyesModifierTargetUIContainer parent, EyesTargetContainer t)
 {
     parent_ = parent;
     target_ = t;
 }
Esempio n. 10
0
 private void CopyTo(EyesTargetContainer c, int cloneFlags)
 {
     c.target_  = target_?.Clone(cloneFlags);
     c.enabled_ = enabled_;
 }
Esempio n. 11
0
 public void RemoveTarget(EyesTargetContainer t)
 {
     targets_.Remove(t);
 }