Skip to content

Commit

Permalink
v0.0.12.19 release framework
Browse files Browse the repository at this point in the history
  • Loading branch information
liangxiegame committed Jan 21, 2019
1 parent e48c176 commit 55f8513
Show file tree
Hide file tree
Showing 1,341 changed files with 36,023 additions and 36,913 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
280 changes: 140 additions & 140 deletions ...xtension/Editor/CoroutineWindowExample.cs → ...xtension/Editor/CoroutineWindowExample.cs
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,141 +1,141 @@
using UnityEngine;
using System.Collections;
using UnityEditor;

namespace EditorCoroutines
{
public class CoroutineWindowExample : EditorWindow
{
[MenuItem("Window/Coroutine Example")]
public static void ShowWindow()
{
EditorWindow.GetWindow(typeof(CoroutineWindowExample));
}

void OnGUI()
{
if (GUILayout.Button("Start"))
{
this.StartCoroutine(Example());
}

if (GUILayout.Button("Start WWW"))
{
this.StartCoroutine(ExampleWWW());
}

if (GUILayout.Button("Start Nested"))
{
this.StartCoroutine(ExampleNested());
}

if (GUILayout.Button("Stop"))
{
this.StopCoroutine("Example");
}
if (GUILayout.Button("Stop all"))
{
this.StopAllCoroutines();
}

if (GUILayout.Button("Also"))
{
this.StopAllCoroutines();
}

if (GUILayout.Button("WaitUntil/WaitWhile"))
{
status = false;
this.StartCoroutine(ExampleWaitUntilWhile());
}

if (GUILayout.Button("Switch For WaitUntil/WaitWhile:" + (status ? "On" : "Off")))
{
status = !status;
EditorUtility.SetDirty(this);
}
}

private bool status;

IEnumerator ExampleWaitUntilWhile()
{
yield return new WaitUntil(()=>status);
Debug.Log("Switch On");
yield return new WaitWhile(()=>status);
Debug.Log("Switch Off");
}

IEnumerator Example()
{
while (true)
{
Debug.Log("Hello EditorCoroutine!");
yield return new WaitForSeconds(2f);
}
}

IEnumerator ExampleWWW()
{
while (true)
{
var www = new WWW("https://unity3d.com/");
yield return www;
Debug.Log("Hello EditorCoroutine!" + www.text);
yield return new WaitForSeconds(2f);
}
}

IEnumerator ExampleNested()
{
while (true)
{
yield return new WaitForSeconds(2f);
Debug.Log("I'm not nested");
yield return this.StartCoroutine(ExampleNestedOneLayer());
}
}

IEnumerator ExampleNestedOneLayer()
{
yield return new WaitForSeconds(2f);
Debug.Log("I'm one layer nested");
yield return this.StartCoroutine(ExampleNestedTwoLayers());
}

IEnumerator ExampleNestedTwoLayers()
{
yield return new WaitForSeconds(2f);
Debug.Log("I'm two layers nested");
}


class NonEditorClass
{
public void DoSomething(bool start, bool stop, bool stopAll)
{
if (start)
{
EditorCoroutines.StartCoroutine(Example(), this);
}
if (stop)
{
EditorCoroutines.StopCoroutine("Example", this);
}
if (stopAll)
{
EditorCoroutines.StopAllCoroutines(this);
}
}

IEnumerator Example()
{
while (true)
{
Debug.Log("Hello EditorCoroutine!");
yield return new WaitForSeconds(2f);
}
}
}
}
using UnityEngine;
using System.Collections;
using UnityEditor;

namespace EditorCoroutines
{
public class CoroutineWindowExample : EditorWindow
{
[MenuItem("Window/Coroutine Example")]
public static void ShowWindow()
{
EditorWindow.GetWindow(typeof(CoroutineWindowExample));
}

void OnGUI()
{
if (GUILayout.Button("Start"))
{
this.StartCoroutine(Example());
}

if (GUILayout.Button("Start WWW"))
{
this.StartCoroutine(ExampleWWW());
}

if (GUILayout.Button("Start Nested"))
{
this.StartCoroutine(ExampleNested());
}

if (GUILayout.Button("Stop"))
{
this.StopCoroutine("Example");
}
if (GUILayout.Button("Stop all"))
{
this.StopAllCoroutines();
}

if (GUILayout.Button("Also"))
{
this.StopAllCoroutines();
}

if (GUILayout.Button("WaitUntil/WaitWhile"))
{
status = false;
this.StartCoroutine(ExampleWaitUntilWhile());
}

if (GUILayout.Button("Switch For WaitUntil/WaitWhile:" + (status ? "On" : "Off")))
{
status = !status;
EditorUtility.SetDirty(this);
}
}

private bool status;

IEnumerator ExampleWaitUntilWhile()
{
yield return new WaitUntil(()=>status);
Debug.Log("Switch On");
yield return new WaitWhile(()=>status);
Debug.Log("Switch Off");
}

IEnumerator Example()
{
while (true)
{
Debug.Log("Hello EditorCoroutine!");
yield return new WaitForSeconds(2f);
}
}

IEnumerator ExampleWWW()
{
while (true)
{
var www = new WWW("https://unity3d.com/");
yield return www;
Debug.Log("Hello EditorCoroutine!" + www.text);
yield return new WaitForSeconds(2f);
}
}

IEnumerator ExampleNested()
{
while (true)
{
yield return new WaitForSeconds(2f);
Debug.Log("I'm not nested");
yield return this.StartCoroutine(ExampleNestedOneLayer());
}
}

IEnumerator ExampleNestedOneLayer()
{
yield return new WaitForSeconds(2f);
Debug.Log("I'm one layer nested");
yield return this.StartCoroutine(ExampleNestedTwoLayers());
}

IEnumerator ExampleNestedTwoLayers()
{
yield return new WaitForSeconds(2f);
Debug.Log("I'm two layers nested");
}


class NonEditorClass
{
public void DoSomething(bool start, bool stop, bool stopAll)
{
if (start)
{
EditorCoroutines.StartCoroutine(Example(), this);
}
if (stop)
{
EditorCoroutines.StopCoroutine("Example", this);
}
if (stopAll)
{
EditorCoroutines.StopAllCoroutines(this);
}
}

IEnumerator Example()
{
while (true)
{
Debug.Log("Hello EditorCoroutine!");
yield return new WaitForSeconds(2f);
}
}
}
}
}
File renamed without changes.
74 changes: 37 additions & 37 deletions ...nsion/Editor/EditorCoroutineExtensions.cs → ...nsion/Editor/EditorCoroutineExtensions.cs
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
using System.Collections;
using UnityEditor;

namespace EditorCoroutines
{
public static class EditorCoroutineExtensions
{
public static EditorCoroutines.EditorCoroutine StartCoroutine(this EditorWindow thisRef, IEnumerator coroutine)
{
return EditorCoroutines.StartCoroutine(coroutine, thisRef);
}

public static EditorCoroutines.EditorCoroutine StartCoroutine(this EditorWindow thisRef, string methodName)
{
return EditorCoroutines.StartCoroutine(methodName, thisRef);
}

public static EditorCoroutines.EditorCoroutine StartCoroutine(this EditorWindow thisRef, string methodName, object value)
{
return EditorCoroutines.StartCoroutine(methodName, value, thisRef);
}

public static void StopCoroutine(this EditorWindow thisRef, IEnumerator coroutine)
{
EditorCoroutines.StopCoroutine(coroutine, thisRef);
}

public static void StopCoroutine(this EditorWindow thisRef, string methodName)
{
EditorCoroutines.StopCoroutine(methodName, thisRef);
}

public static void StopAllCoroutines(this EditorWindow thisRef)
{
EditorCoroutines.StopAllCoroutines(thisRef);
}
}
using System.Collections;
using UnityEditor;

namespace EditorCoroutines
{
public static class EditorCoroutineExtensions
{
public static EditorCoroutines.EditorCoroutine StartCoroutine(this EditorWindow thisRef, IEnumerator coroutine)
{
return EditorCoroutines.StartCoroutine(coroutine, thisRef);
}

public static EditorCoroutines.EditorCoroutine StartCoroutine(this EditorWindow thisRef, string methodName)
{
return EditorCoroutines.StartCoroutine(methodName, thisRef);
}

public static EditorCoroutines.EditorCoroutine StartCoroutine(this EditorWindow thisRef, string methodName, object value)
{
return EditorCoroutines.StartCoroutine(methodName, value, thisRef);
}

public static void StopCoroutine(this EditorWindow thisRef, IEnumerator coroutine)
{
EditorCoroutines.StopCoroutine(coroutine, thisRef);
}

public static void StopCoroutine(this EditorWindow thisRef, string methodName)
{
EditorCoroutines.StopCoroutine(methodName, thisRef);
}

public static void StopAllCoroutines(this EditorWindow thisRef)
{
EditorCoroutines.StopAllCoroutines(thisRef);
}
}
}
File renamed without changes.
Loading

0 comments on commit 55f8513

Please sign in to comment.