Disconnect() public static méthode

public static Disconnect ( Playable target, int inputPort ) : void
target Playable
inputPort int
Résultat void
Exemple #1
0
        public unsafe bool SetInputs(IEnumerable <Playable> sources)
        {
            for (int i = 0; i < this.inputCount; i++)
            {
                Playable.Disconnect(*((Playable *)this), i);
            }
            bool flag            = false;
            int  targetInputPort = 0;

            foreach (Playable playable in sources)
            {
                if (targetInputPort < this.inputCount)
                {
                    flag |= Playable.Connect(playable, *((Playable *)this), -1, targetInputPort);
                }
                else
                {
                    flag |= Playable.Connect(playable, *((Playable *)this), -1, -1);
                }
                this.node.SetInputWeight(targetInputPort, 1f);
                targetInputPort++;
            }
            for (int j = targetInputPort; j < this.inputCount; j++)
            {
                this.node.SetInputWeight(j, 0f);
            }
            return(flag);
        }
Exemple #2
0
        public bool SetInputs(IEnumerable <Playable> sources)
        {
            for (int i = 0; i < this.inputCount; i++)
            {
                Playable.Disconnect(this, i);
            }
            bool flag = false;
            int  num  = 0;

            foreach (Playable current in sources)
            {
                if (num < this.inputCount)
                {
                    flag |= Playable.Connect(current, this, -1, num);
                }
                else
                {
                    flag |= Playable.Connect(current, this, -1, -1);
                }
                this.node.SetInputWeight(num, 1f);
                num++;
            }
            for (int j = num; j < this.inputCount; j++)
            {
                this.node.SetInputWeight(j, 0f);
            }
            return(flag);
        }
        public virtual bool SetInputs(IEnumerable <AnimationPlayable> sources)
        {
            Playable[] inputs = base.GetInputs();
            int        num    = inputs.Length;

            for (int i = 0; i < num; i++)
            {
                Playable.Disconnect(this, i);
            }
            bool flag = false;
            int  num2 = 0;

            foreach (AnimationPlayable current in sources)
            {
                if (num2 < num)
                {
                    flag |= Playable.Connect(current, this, -1, num2);
                }
                else
                {
                    flag |= Playable.Connect(current, this, -1, -1);
                }
                base.SetInputWeight(num2, 1f);
                num2++;
            }
            for (int j = num2; j < num; j++)
            {
                base.SetInputWeight(j, 0f);
            }
            return(flag);
        }
Exemple #4
0
        public virtual bool SetInputs(IEnumerable <AnimationPlayable> sources)
        {
            int length = this.GetInputs().Length;

            for (int inputPort = 0; inputPort < length; ++inputPort)
            {
                Playable.Disconnect((Playable)this, inputPort);
            }
            bool flag = false;
            int  num  = 0;

            foreach (AnimationPlayable source in sources)
            {
                if (num < length)
                {
                    flag |= Playable.Connect((Playable)source, (Playable)this, -1, num);
                }
                else
                {
                    flag |= Playable.Connect((Playable)source, (Playable)this, -1, -1);
                }
                this.SetInputWeight(num, 1f);
                ++num;
            }
            for (int inputIndex = num; inputIndex < length; ++inputIndex)
            {
                this.SetInputWeight(inputIndex, 0.0f);
            }
            return(flag);
        }
Exemple #5
0
 /// <summary>
 /// <para>Removes a playable from the list of inputs.</para>
 /// </summary>
 /// <param name="index">Index of the playable to remove.</param>
 /// <returns>
 /// <para>Returns false if the removal could not be removed because it wasn't found.</para>
 /// </returns>
 public unsafe bool RemoveInput(int index)
 {
     if (!Playables.CheckInputBounds(*((Playable *)this), index))
     {
         return(false);
     }
     Playable.Disconnect(*((Playable *)this), index);
     return(true);
 }
Exemple #6
0
 public bool RemoveInput(int index)
 {
     if (!Playables.CheckInputBounds(this, index))
     {
         return(false);
     }
     Playable.Disconnect(this, index);
     return(true);
 }
Exemple #7
0
 /// <summary>
 ///   <para>Removes a playable from the list of inputs.</para>
 /// </summary>
 /// <param name="index">Index of the playable to remove.</param>
 /// <param name="playable">AnimationPlayable to remove.</param>
 /// <returns>
 ///   <para>Returns false if the removal could not be removed because it wasn't found.</para>
 /// </returns>
 public virtual bool RemoveInput(int index)
 {
     if (!this.CheckInputBounds(index))
     {
         return(false);
     }
     Playable.Disconnect((Playable)this, index);
     return(true);
 }
Exemple #8
0
 /// <summary>
 /// <para>Removes a playable from the list of inputs.</para>
 /// </summary>
 /// <param name="playable">The Playable to remove.</param>
 /// <returns>
 /// <para>Returns false if the removal could not be removed because it wasn't found.</para>
 /// </returns>
 public unsafe bool RemoveInput(Playable playable)
 {
     for (int i = 0; i < this.inputCount; i++)
     {
         if (this.GetInput(i) == playable)
         {
             Playable.Disconnect(*((Playable *)this), i);
             return(true);
         }
     }
     return(false);
 }
Exemple #9
0
 /// <summary>
 /// <para>Sets an Playable as an input.</para>
 /// </summary>
 /// <param name="source">Playable to be used as input.</param>
 /// <param name="index">Index of the input.</param>
 /// <returns>
 /// <para>Returns false if the operation could not be completed.</para>
 /// </returns>
 public unsafe bool SetInput(Playable source, int index)
 {
     if (!this.node.CheckInputBounds(index))
     {
         return(false);
     }
     if (this.GetInput(index).IsValid())
     {
         Playable.Disconnect(*((Playable *)this), index);
     }
     return(Playable.Connect(source, *((Playable *)this), -1, index));
 }
Exemple #10
0
 /// <summary>
 ///   <para>Sets an AnimationPlayable as an input.</para>
 /// </summary>
 /// <param name="source">AnimationPlayable to be used as input.</param>
 /// <param name="index">Index of the input.</param>
 /// <returns>
 ///   <para>Returns false if the operation could not be completed.</para>
 /// </returns>
 public virtual bool SetInput(AnimationPlayable source, int index)
 {
     if (!this.CheckInputBounds(index))
     {
         return(false);
     }
     if (this.GetInputs()[index] != (Playable)null)
     {
         Playable.Disconnect((Playable)this, index);
     }
     return(Playable.Connect((Playable)source, (Playable)this, -1, index));
 }
 /// <summary>
 ///   <para>Sets an AnimationPlayable as an input.</para>
 /// </summary>
 /// <param name="source">AnimationPlayable to be used as input.</param>
 /// <param name="index">Index of the input.</param>
 /// <returns>
 ///   <para>Returns false if the operation could not be completed.</para>
 /// </returns>
 public virtual bool SetInput(AnimationPlayable source, int index)
 {
     if (!base.CheckInputBounds(index))
     {
         return(false);
     }
     Playable[] inputs = base.GetInputs();
     if (inputs[index] != null)
     {
         Playable.Disconnect(this, index);
     }
     return(Playable.Connect(source, this, -1, index));
 }
        public bool RemoveInput(int index)
        {
            bool result;

            if (!Playables.CheckInputBounds(this, index))
            {
                result = false;
            }
            else
            {
                Playable.Disconnect(this, index);
                result = true;
            }
            return(result);
        }
Exemple #13
0
 public virtual bool RemoveInput(AnimationPlayable playable)
 {
     if (Playable.CheckPlayableValidity(playable, "playable"))
     {
         Playable[] inputs = base.GetInputs();
         for (int i = 0; i < inputs.Length; i++)
         {
             if (inputs[i] == playable)
             {
                 Playable.Disconnect(this, i);
                 return(true);
             }
         }
     }
     return(false);
 }
        public bool RemoveInput(Playable playable)
        {
            bool result;

            for (int i = 0; i < this.inputCount; i++)
            {
                if (this.GetInput(i) == playable)
                {
                    Playable.Disconnect(this, i);
                    result = true;
                    return(result);
                }
            }
            result = false;
            return(result);
        }
Exemple #15
0
 /// <summary>
 ///   <para>Removes a playable from the list of inputs.</para>
 /// </summary>
 /// <param name="index">Index of the playable to remove.</param>
 /// <param name="playable">AnimationPlayable to remove.</param>
 /// <returns>
 ///   <para>Returns false if the removal could not be removed because it wasn't found.</para>
 /// </returns>
 public virtual bool RemoveInput(AnimationPlayable playable)
 {
     if (!Playable.CheckPlayableValidity((Playable)playable, "playable"))
     {
         return(false);
     }
     Playable[] inputs = this.GetInputs();
     for (int inputPort = 0; inputPort < inputs.Length; ++inputPort)
     {
         if (inputs[inputPort] == (Playable)playable)
         {
             Playable.Disconnect((Playable)this, inputPort);
             return(true);
         }
     }
     return(false);
 }
        public bool SetInput(Playable source, int index)
        {
            bool result;

            if (!this.node.CheckInputBounds(index))
            {
                result = false;
            }
            else
            {
                if (this.GetInput(index).IsValid())
                {
                    Playable.Disconnect(this, index);
                }
                result = Playable.Connect(source, this, -1, index);
            }
            return(result);
        }
Exemple #17
0
        public virtual bool SetInputs(IEnumerable <AnimationPlayable> sources)
        {
            int length = base.GetInputs().Length;

            for (int i = 0; i < length; i++)
            {
                Playable.Disconnect(this, i);
            }
            bool flag            = false;
            int  targetInputPort = 0;
            IEnumerator <AnimationPlayable> enumerator = sources.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    AnimationPlayable current = enumerator.Current;
                    if (targetInputPort < length)
                    {
                        flag |= Playable.Connect(current, this, -1, targetInputPort);
                    }
                    else
                    {
                        flag |= Playable.Connect(current, this, -1, -1);
                    }
                    base.SetInputWeight(targetInputPort, 1f);
                    targetInputPort++;
                }
            }
            finally
            {
                if (enumerator == null)
                {
                }
                enumerator.Dispose();
            }
            for (int j = targetInputPort; j < length; j++)
            {
                base.SetInputWeight(j, 0f);
            }
            return(flag);
        }
Exemple #18
0
        public unsafe bool SetInputs(IEnumerable <Playable> sources)
        {
            for (int i = 0; i < this.inputCount; i++)
            {
                Playable.Disconnect(*((Playable *)this), i);
            }
            bool flag            = false;
            int  targetInputPort = 0;
            IEnumerator <Playable> enumerator = sources.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    Playable current = enumerator.Current;
                    if (targetInputPort < this.inputCount)
                    {
                        flag |= Playable.Connect(current, *((Playable *)this), -1, targetInputPort);
                    }
                    else
                    {
                        flag |= Playable.Connect(current, *((Playable *)this), -1, -1);
                    }
                    this.node.SetInputWeight(targetInputPort, 1f);
                    targetInputPort++;
                }
            }
            finally
            {
                if (enumerator == null)
                {
                }
                enumerator.Dispose();
            }
            for (int j = targetInputPort; j < this.inputCount; j++)
            {
                this.node.SetInputWeight(j, 0f);
            }
            return(flag);
        }
Exemple #19
0
        public virtual bool SetInputs(IEnumerable <AnimationPlayable> sources)
        {
            Playable[] inputs = GetInputs();
            int        num    = inputs.Length;

            for (int i = 0; i < num; i++)
            {
                Playable.Disconnect(this, i);
            }
            bool flag = false;
            int  num2 = 0;

            foreach (AnimationPlayable source in sources)
            {
                flag = ((num2 >= num) ? (flag | Playable.Connect(source, this, -1, -1)) : (flag | Playable.Connect(source, this, -1, num2)));
                SetInputWeight(num2, 1f);
                num2++;
            }
            for (int j = num2; j < num; j++)
            {
                SetInputWeight(j, 0f);
            }
            return(flag);
        }