using System.Collections; using System.Collections.Generic; using UnityEngine; public class otherWoniu : MonoBehaviour { public List EndPosList; // Start is called before the first frame update void Start() { //OtherWoniuMove(); } public void OtherWoniuMove() { int Index = Random.Range(0, EndPosList.Count); transform.GetComponent().EndPos = EndPosList[Index].transform; transform.GetComponent().StartMove(); } }