123456789101112131415161718192021222324252627282930313233343536373839404142 |
- 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>();
- 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;
- }
|