/** * Called once at start */ protected void BaseStart() { state = EBaseState.WaitForShoot; shootComponent = GetComponent <Shoot>(); shootComponent.enabled = false; // Starting the coroutine waitCoroutine = WaitForShoot(); StartCoroutine(waitCoroutine); }
/// <summary> /// Constructor. /// </summary> public MyUGUIBase(string prefabName) { mState = EBaseState.Idle; mPrefabName = prefabName; mIsAssetBundleLoaded = false; }
/** * Small coroutines to wait the delay before * shooting */ private IEnumerator WaitForShoot() { yield return(new WaitForSeconds(shootDelay)); state = EBaseState.EnableShootComponent; }