using System; using UnityEngine; using wf; [RequireComponent(typeof(iTweenPath))] public class FishMove : MonoBehaviour { private void Start() { Vector3[] path = iTweenPath.GetPath(this.PathName); for (int i = 0; i < this.DuplicationObjectCount; i++) { GameObject childObject = UTY.GetChildObject(base.gameObject, "ObjectRoot", false); GameObject gameObject = Utility.CreatePrefab(new GameObject("Fish" + i) { transform = { parent = childObject.transform } }, this.CreatePrefabName, false); gameObject.transform.localPosition = path[0]; gameObject.transform.rotation = this.FirstDirection; Fish fish = gameObject.AddComponent(); fish.Init(path, this.MinTime, this.MaxTime, this.LookTime); fish.MovePath(); } } public float MinTime = 6f; public float MaxTime = 12f; public float LookTime = 2f; public string PathName = "Path1"; public int DuplicationObjectCount = 1; public string CreatePrefabName = string.Empty; public Quaternion FirstDirection = Quaternion.identity; }