UnityEngine.MonoBehaviour.StartCoroutine C# (CSharp) Method

StartCoroutine() public method

public StartCoroutine ( IEnumerator routine ) : Coroutine
routine IEnumerator
return Coroutine
        public Coroutine StartCoroutine(IEnumerator routine)
        {
            AssertNull();

			try
			{
				var coroutine = new Coroutine(routine);
				ScheduleCoroutine(coroutine);
				return coroutine;
			}
			catch (InvalidOperationException)
			{
				return null;
			}
        }

Same methods

MonoBehaviour::StartCoroutine ( string methodName ) : Coroutine
MonoBehaviour::StartCoroutine ( string methodName, object value ) : Coroutine

Usage Example

コード例 #1
0
ファイル: MenuBase.cs プロジェクト: Killer40008/TSFSTAKBLCKS
    //
    public static void HideAndShow(MonoBehaviour sender ,string panelHide, string panelShow)
    {

        //hide menu
        GameObject.Find(panelHide).GetComponent<CanvasGroup>().interactable = false;
        sender.StartCoroutine(MenuBase.FadeHide(GameObject.Find(panelHide).GetComponent<CanvasGroup>()));


        //show
        GameObject diffObj = GameObject.Find(panelShow);
        diffObj.GetComponent<CanvasGroup>().interactable = true;
        sender.StartCoroutine(MenuBase.FadeShow(diffObj.GetComponent<CanvasGroup>()));
        MenuBase.BringToFront(diffObj);
    }
All Usage Examples Of UnityEngine.MonoBehaviour::StartCoroutine