static private CheckPlayableValidity ( |
||
playable | ||
name | string | |
return | bool |
/// <summary> /// <para>Disconnects an input from a Playable.</para> /// </summary> /// <param name="right">Playable from which the input will be disconnected.</param> /// <param name="inputPort">Index of the input to disconnect.</param> /// <param name="target"></param> public static void Disconnect(Playable target, int inputPort) { if (!Playable.CheckPlayableValidity(target, "target") || !target.CheckInputBounds(inputPort)) { return; } Playable.DisconnectInternal(target, inputPort); }
/// <summary> /// <para>Connects two Playables together.</para> /// </summary> /// <param name="source">Playable to be used as input.</param> /// <param name="target">Playable on which the input will be connected.</param> /// <param name="sourceOutputPort">Optional index of the output on the source Playable.</param> /// <param name="targetInputPort">Optional index of the input on the target Playable.</param> /// <returns> /// <para>Returns false if the operation could not be completed.</para> /// </returns> public static bool Connect(Playable source, Playable target, int sourceOutputPort, int targetInputPort) { if (!Playable.CheckPlayableValidity(source, "source") && !Playable.CheckPlayableValidity(target, "target") || source != (Playable)null && !source.CheckInputBounds(sourceOutputPort, true) || !target.CheckInputBounds(targetInputPort, true)) { return(false); } return(Playable.ConnectInternal(source, target, sourceOutputPort, targetInputPort)); }
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); }
/// <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); }
/// <summary> /// <para>Connects two Playables together.</para> /// </summary> /// <param name="source">Playable to be used as input.</param> /// <param name="target">Playable on which the input will be connected.</param> /// <param name="sourceOutputPort">Optional index of the output on the source Playable.</param> /// <param name="targetInputPort">Optional index of the input on the target Playable.</param> /// <returns> /// <para>Returns false if the operation could not be completed.</para> /// </returns> public static bool Connect(Playable source, Playable target, int sourceOutputPort, int targetInputPort) { return((Playable.CheckPlayableValidity(source, "source") || Playable.CheckPlayableValidity(target, "target")) && (!(source != null) || source.CheckInputBounds(sourceOutputPort, true)) && target.CheckInputBounds(targetInputPort, true) && Playable.ConnectInternal(source, target, sourceOutputPort, targetInputPort)); }