using System;
using System.Collections.Generic;
using UnityEngine;
using wf;

[Serializable]
public class AMPropertyKey : AMKey
{
	public bool setValueMegaMorph(List<float> morph)
	{
		bool flag = false;
		if (this.morph == null || this.morph.Count != morph.Count)
		{
			flag = true;
		}
		else
		{
			for (int i = 0; i < morph.Count; i++)
			{
				if (this.morph[i] != morph[i])
				{
					flag = true;
					break;
				}
			}
		}
		if (flag)
		{
			this.morph = new List<float>(morph);
			return true;
		}
		return false;
	}

	public bool setValue(float val)
	{
		if (this.val != (double)val)
		{
			this.val = (double)val;
			return true;
		}
		return false;
	}

	public bool setValue(Vector3 vect3)
	{
		if (this.vect3 != vect3)
		{
			this.vect3 = vect3;
			return true;
		}
		return false;
	}

	public bool setValue(Color color)
	{
		if (this.color != color)
		{
			this.color = color;
			return true;
		}
		return false;
	}

	public bool setValue(Rect rect)
	{
		if (this.rect != rect)
		{
			this.rect = rect;
			return true;
		}
		return false;
	}

	public bool setValue(Vector2 vect2)
	{
		if (this.vect2 != vect2)
		{
			this.vect2 = vect2;
			return true;
		}
		return false;
	}

	public bool setValue(double val)
	{
		if (this.val != val)
		{
			this.val = val;
			return true;
		}
		return false;
	}

	public bool setValue(int val)
	{
		if (this.val != (double)val)
		{
			this.val = (double)val;
			return true;
		}
		return false;
	}

	public bool setValue(long val)
	{
		if (this.val != (double)val)
		{
			this.val = (double)val;
			return true;
		}
		return false;
	}

	public override AMKey CreateClone()
	{
		AMPropertyKey ampropertyKey = ScriptableObject.CreateInstance<AMPropertyKey>();
		ampropertyKey.frame = this.frame;
		ampropertyKey.val = this.val;
		ampropertyKey.vect2 = this.vect2;
		ampropertyKey.vect3 = this.vect3;
		ampropertyKey.color = this.color;
		ampropertyKey.rect = this.rect;
		if (this.morph != null)
		{
			ampropertyKey.morph = new List<float>(this.morph);
		}
		ampropertyKey.easeType = this.easeType;
		ampropertyKey.customEase = new List<float>(this.customEase);
		return ampropertyKey;
	}

	public override void CreateFromStringData(string data_text)
	{
		string[] array = data_text.Split(new char[]
		{
			':'
		});
		if (array.Length == 0 || array[0] != "Property")
		{
			return;
		}
		int num = 1;
		this.frame = int.Parse(array[num++]);
		this.val = double.Parse(array[num++]);
		this.vect2 = Parse.Vector2(array[num++]);
		this.vect3 = Parse.Vector3(array[num++]);
		this.color = Parse.Color(array[num++]);
		this.rect.x = float.Parse(array[num++]);
		this.rect.y = float.Parse(array[num++]);
		this.rect.width = float.Parse(array[num++]);
		this.rect.height = float.Parse(array[num++]);
		this.morph = null;
		int num2 = int.Parse(array[num++]);
		if (0 <= num2)
		{
			this.morph = new List<float>();
			for (int i = 0; i < num2; i++)
			{
				this.morph.Add(float.Parse(array[num++]));
			}
		}
		this.easeType = int.Parse(array[num++]);
		int num3 = int.Parse(array[num++]);
		this.customEase = new List<float>();
		for (int j = 0; j < num3; j++)
		{
			this.customEase.Add(float.Parse(array[num++]));
		}
	}

	public override string ToStringData()
	{
		List<string> list = new List<string>();
		list.Add("Property");
		list.Add(this.frame.ToString());
		list.Add(this.val.ToString());
		list.Add(this.vect2.ToString("G"));
		list.Add(this.vect3.ToString("G"));
		list.Add(this.color.ToString("G"));
		list.Add(this.rect.x.ToString());
		list.Add(this.rect.y.ToString());
		list.Add(this.rect.width.ToString());
		list.Add(this.rect.height.ToString());
		list.Add(((this.morph != null) ? this.morph.Count : -1).ToString());
		if (this.morph != null)
		{
			foreach (float num in this.morph)
			{
				list.Add(num.ToString());
			}
		}
		list.Add(this.easeType.ToString());
		list.Add(this.customEase.Count.ToString());
		foreach (float num2 in this.customEase)
		{
			list.Add(num2.ToString());
		}
		string text = list[0];
		for (int i = 1; i < list.Count; i++)
		{
			text = text + ":" + list[i];
		}
		return text;
	}

	public double val;

	public Vector2 vect2;

	public Vector3 vect3;

	public Color color;

	public Rect rect;

	public List<float> morph;
}
