123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- 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;
- }
|