123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- using System;
- using System.Collections.Generic;
- using UnityEngine;
- using wf;
- [Serializable]
- public class AMTranslationKey : AMKey
- {
- public bool setInterpolation(int _interp)
- {
- if (_interp != this.interp)
- {
- this.interp = _interp;
- return true;
- }
- return false;
- }
- public bool setPosition(Vector3 position)
- {
- if (position != this.position)
- {
- this.position = position;
- return true;
- }
- return false;
- }
- public override AMKey CreateClone()
- {
- AMTranslationKey amtranslationKey = ScriptableObject.CreateInstance<AMTranslationKey>();
- amtranslationKey.frame = this.frame;
- amtranslationKey.position = this.position;
- amtranslationKey.interp = this.interp;
- amtranslationKey.easeType = this.easeType;
- amtranslationKey.customEase = new List<float>(this.customEase);
- return amtranslationKey;
- }
- public override void CreateFromStringData(string data_text)
- {
- string[] array = data_text.Split(new char[]
- {
- ':'
- });
- if (array.Length == 0 || array[0] != "Translation")
- {
- return;
- }
- int num = 1;
- this.frame = int.Parse(array[num++]);
- this.position = Parse.Vector3(array[num++]);
- this.interp = int.Parse(array[num++]);
- this.easeType = int.Parse(array[num++]);
- int num2 = int.Parse(array[num++]);
- this.customEase = new List<float>();
- for (int i = 0; i < num2; i++)
- {
- this.customEase.Add(float.Parse(array[num++]));
- }
- }
- public override string ToStringData()
- {
- List<string> list = new List<string>();
- list.Add("Translation");
- list.Add(this.frame.ToString());
- list.Add(this.position.ToString("G"));
- list.Add(this.interp.ToString());
- list.Add(this.easeType.ToString());
- list.Add(this.customEase.Count.ToString());
- foreach (float num in this.customEase)
- {
- list.Add(num.ToString());
- }
- string text = list[0];
- for (int i = 1; i < list.Count; i++)
- {
- text = text + ":" + list[i];
- }
- return text;
- }
- public static string[] InterpolationNames = new string[]
- {
- "Curve",
- "Linear"
- };
- public Vector3 position;
- public int interp;
- public enum Interpolation
- {
- Curve,
- Linear
- }
- }
|