Example #1
0
        public FoldoutTree(Transform tr, SerializedStringTable expandedFoldouts)
        {
            List <FoldoutObjectState> list = new List <FoldoutObjectState>();

            new FoldoutObjectState(tr.gameObject, list, expandedFoldouts, 0);
            this.m_States = list.ToArray();
        }
        public AnimationSelection(GameObject[] animatedOptions, SerializedStringTable chosenAnimated, SerializedStringTable chosenClip, AnimationWindow editor)
        {
            this.m_AnimationWindow = editor;
            this.m_AnimatedOptions = animatedOptions;
            string stringArrayHashCode = AnimationSelection.GetStringArrayHashCode(this.GetAnimatedObjectNames());

            if (!chosenAnimated.Contains(stringArrayHashCode))
            {
                chosenAnimated.Set(stringArrayHashCode, animatedOptions.Length - 1);
            }
            this.m_AnimatedObjectIndex = chosenAnimated.Get(stringArrayHashCode);
            this.RefreshChosenClip(chosenClip);
        }
		public FoldoutComponentState(UnityEngine.Object obj, SerializedStringTable expandedFoldouts, Transform tr, int level)
		{
			this.m_Object = obj;
			if (level == 0 && this.m_Object.GetType() == typeof(Transform))
			{
				this.m_Expanded = true;
			}
			else
			{
				if (expandedFoldouts.Contains(this.GetString(tr)))
				{
					this.m_Expanded = true;
				}
			}
		}
Example #4
0
 public FoldoutComponentState(UnityEngine.Object obj, SerializedStringTable expandedFoldouts, Transform tr, int level)
 {
     this.m_Object = obj;
     if (level == 0 && this.m_Object.GetType() == typeof(Transform))
     {
         this.m_Expanded = true;
     }
     else
     {
         if (expandedFoldouts.Contains(this.GetString(tr)))
         {
             this.m_Expanded = true;
         }
     }
 }
		public FoldoutObjectState(GameObject obj, List<FoldoutObjectState> states, SerializedStringTable expandedFoldouts, int level)
		{
			this.m_Object = obj;
			states.Add(this);
			if (level == 0)
			{
				this.m_Expanded = true;
			}
			else
			{
				if (expandedFoldouts.Contains(AnimationSelection.GetPath(obj.transform)))
				{
					this.m_Expanded = true;
				}
			}
			List<int> list = new List<int>();
			foreach (Transform transform in obj.transform)
			{
				list.Add(states.Count);
				new FoldoutObjectState(transform.gameObject, states, expandedFoldouts, level + 1);
			}
			this.m_Children = list.ToArray();
		}
 private void RefreshChosenClip(SerializedStringTable chosenClip)
 {
     if (this.hasAnimationComponent)
     {
         string stringArrayHashCode = AnimationSelection.GetStringArrayHashCode(this.GetClipNames());
         if (!chosenClip.Contains(stringArrayHashCode))
         {
             this.m_Clip = null;
             AnimationClip[] animationClips = AnimationUtility.GetAnimationClips(this.animatedObject);
             for (int i = 0; i < animationClips.Length; i++)
             {
                 if (animationClips[i] != null)
                 {
                     this.m_Clip = animationClips[i];
                     break;
                 }
             }
         }
         else
         {
             this.m_Clip = this.GetClipAtIndex(chosenClip.Get(stringArrayHashCode));
         }
     }
 }
Example #7
0
        public FoldoutObjectState(GameObject obj, List <FoldoutObjectState> states, SerializedStringTable expandedFoldouts, int level)
        {
            this.m_Object = obj;
            states.Add(this);
            if (level == 0)
            {
                this.m_Expanded = true;
            }
            else
            {
                if (expandedFoldouts.Contains(AnimationSelection.GetPath(obj.transform)))
                {
                    this.m_Expanded = true;
                }
            }
            List <int> list = new List <int>();

            foreach (Transform transform in obj.transform)
            {
                list.Add(states.Count);
                new FoldoutObjectState(transform.gameObject, states, expandedFoldouts, level + 1);
            }
            this.m_Children = list.ToArray();
        }
		public void Awake()
		{
			if (this.state == null)
			{
				this.state = new AnimationWindowState();
				this.state.m_ShowCurveEditor = false;
				this.state.m_AnimationWindow = this;
			}
			this.state.timeArea = null;
			base.minSize = new Vector2(400f, 200f);
			this.m_HorizontalSplitter = new SplitterState(new float[]
			{
				250f,
				10000f
			}, new int[]
			{
				250,
				150
			}, null);
			this.m_HorizontalSplitter.realSizes[0] = 300;
			base.wantsMouseMove = true;
			AnimationWindow.m_Selected = new AnimationSelection[0];
			if (this.m_ExpandedFoldouts == null)
			{
				this.m_ExpandedFoldouts = new SerializedStringTable();
			}
			if (this.m_ChosenAnimated == null)
			{
				this.m_ChosenAnimated = new SerializedStringTable();
			}
			if (this.m_ChosenClip == null)
			{
				this.m_ChosenClip = new SerializedStringTable();
			}
			this.m_CurveEditor = new CurveEditor(new Rect(base.position.x, base.position.y, 500f, 200f), new CurveWrapper[0], false);
			this.SetGridColors();
			this.m_CurveEditor.m_TimeUpdater = this;
			this.m_CurveEditor.m_DefaultBounds = new Bounds(new Vector3(1f, 1f, 0f), new Vector3(2f, 1000f, 0f));
			this.m_CurveEditor.SetShownHRangeInsideMargins(0f, 2f);
			this.m_CurveEditor.hTicks.SetTickModulosForFrameRate(this.state.frameRate);
			this.InitAllViews();
			this.InitSelection();
		}
Example #9
0
		public FoldoutTree(Transform tr, SerializedStringTable expandedFoldouts)
		{
			List<FoldoutObjectState> list = new List<FoldoutObjectState>();
			new FoldoutObjectState(tr.gameObject, list, expandedFoldouts, 0);
			this.m_States = list.ToArray();
		}
		private void RefreshChosenClip(SerializedStringTable chosenClip)
		{
			if (this.hasAnimationComponent)
			{
				string stringArrayHashCode = AnimationSelection.GetStringArrayHashCode(this.GetClipNames());
				if (!chosenClip.Contains(stringArrayHashCode))
				{
					this.m_Clip = null;
					AnimationClip[] animationClips = AnimationUtility.GetAnimationClips(this.animatedObject);
					for (int i = 0; i < animationClips.Length; i++)
					{
						if (animationClips[i] != null)
						{
							this.m_Clip = animationClips[i];
							break;
						}
					}
				}
				else
				{
					this.m_Clip = this.GetClipAtIndex(chosenClip.Get(stringArrayHashCode));
				}
			}
		}
		public AnimationSelection(GameObject[] animatedOptions, SerializedStringTable chosenAnimated, SerializedStringTable chosenClip, AnimationWindow editor)
		{
			this.m_AnimationWindow = editor;
			this.m_AnimatedOptions = animatedOptions;
			string stringArrayHashCode = AnimationSelection.GetStringArrayHashCode(this.GetAnimatedObjectNames());
			if (!chosenAnimated.Contains(stringArrayHashCode))
			{
				chosenAnimated.Set(stringArrayHashCode, animatedOptions.Length - 1);
			}
			this.m_AnimatedObjectIndex = chosenAnimated.Get(stringArrayHashCode);
			this.RefreshChosenClip(chosenClip);
		}