AddTransition() 공개 메소드

public AddTransition ( ) : void
리턴 void
예제 #1
0
파일: U9T.cs 프로젝트: unit9/swip3
	public static U9SerialTransition PrioritySequence( U9Transition[] transitions, float staggerTime = 0f ) {

		//Debug.Log ("START PRIORITY SEQUENCE -------------");
		List<U9Transition> transList = new List<U9Transition>( transitions );
		//transList.Sort( CompareTransitionPriority );
		IEnumerable enumerator = transList.OrderBy (t => t.Priority);

		int? currentPriority = null;
		U9SerialTransition serial = new U9SerialTransition ();
		List<U9Transition> parallelGroup = new List<U9Transition> ();

		foreach (U9Transition t in enumerator) {

			if (t != null) {
				if (t.Priority != currentPriority) {
					if (parallelGroup.Count > 0) {
						//Debug.Log ("Priority group: " + currentPriority + " = " + parallelGroup.Count );
						serial.AddTransition (U9T.Stagger (staggerTime, parallelGroup.ToArray ()));
						parallelGroup.Clear ();
					}
					currentPriority = t.Priority;
				}
				parallelGroup.Add (t);
			}

		}
		if (parallelGroup.Count > 0) {
			//Debug.Log ("Priority group: " + currentPriority + " = " + parallelGroup.Count );
			serial.AddTransition( U9T.Stagger( staggerTime, parallelGroup.ToArray() ) );
			parallelGroup.Clear ();
		}
		return serial;
	}
예제 #2
0
파일: U9T.cs 프로젝트: bigstupidx/swip3
    public static U9SerialTransition PrioritySequence(U9Transition[] transitions, float staggerTime = 0f)
    {
        //Debug.Log ("START PRIORITY SEQUENCE -------------");
        List <U9Transition> transList = new List <U9Transition>(transitions);
        //transList.Sort( CompareTransitionPriority );
        IEnumerable enumerator = transList.OrderBy(t => t.Priority);

        int?currentPriority               = null;
        U9SerialTransition  serial        = new U9SerialTransition();
        List <U9Transition> parallelGroup = new List <U9Transition> ();

        foreach (U9Transition t in enumerator)
        {
            if (t != null)
            {
                if (t.Priority != currentPriority)
                {
                    if (parallelGroup.Count > 0)
                    {
                        //Debug.Log ("Priority group: " + currentPriority + " = " + parallelGroup.Count );
                        serial.AddTransition(U9T.Stagger(staggerTime, parallelGroup.ToArray()));
                        parallelGroup.Clear();
                    }
                    currentPriority = t.Priority;
                }
                parallelGroup.Add(t);
            }
        }
        if (parallelGroup.Count > 0)
        {
            //Debug.Log ("Priority group: " + currentPriority + " = " + parallelGroup.Count );
            serial.AddTransition(U9T.Stagger(staggerTime, parallelGroup.ToArray()));
            parallelGroup.Clear();
        }
        return(serial);
    }