using System.Collections; using System.Collections.Generic; using UnityEngine; namespace UnityEngine.UCMobile { public class UCMobile : MonoBehaviour { public UCNoise ucNoise = new UCNoise(); public MoveToTarget moveTotarget = new MoveToTarget(); private List mobileList; // Use this for initialization void Start() { mobileList = new List(); mobileList.Add(ucNoise); mobileList.Add(moveTotarget); } // Update is called once per frame void Update() { foreach(UCMobileModel mobile in mobileList) { if (mobile.IsUsed) mobile.DoBehavier(gameObject); } } } }