Exemplo n.º 1
0
    static void Init()
    {
        ShowColliderAlert alertWindow = (ShowColliderAlert)EditorWindow.GetWindow(typeof(ShowColliderAlert), true, "Caution!", true);

        alertWindow.position = new Rect(Screen.width / 2, Screen.height / 2, 500, 100);
        alertWindow.ShowPopup();
    }
Exemplo n.º 2
0
	void checkForCollider() {

		if (!myWindow.lockedObject.GetComponent("MeshCollider")) { // add a collider if none...

			ShowColliderAlert alertWindow = (ShowColliderAlert)EditorWindow.GetWindow(typeof(ShowColliderAlert), true, "Caution!", true);
			alertWindow.position = new Rect(myWindow.position.x, myWindow.position.y + 200, 500, 150);				  
			MeshCollider newCollider = (MeshCollider)myWindow.lockedObject.AddComponent<MeshCollider>();

			newCollider.sharedMesh = myWindow.lockedMesh;

		}
	
	}