You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
659 B
28 lines
659 B
using System; |
|
using System.Collections.Generic; |
|
using NUnit.Framework; |
|
using UnityEditor; |
|
using UnityEngine; |
|
|
|
[TestFixture] |
|
public abstract class UnityUnitTest |
|
{ |
|
public GameObject CreateGameObject() |
|
{ |
|
return CreateGameObject(""); |
|
} |
|
|
|
public GameObject CreateGameObject(string name) |
|
{ |
|
var go = string.IsNullOrEmpty(name) ? new GameObject() : new GameObject(name); |
|
Undo.RegisterCreatedObjectUndo(go, ""); |
|
return go; |
|
} |
|
|
|
public GameObject CreatePrimitive(PrimitiveType type) |
|
{ |
|
var p = GameObject.CreatePrimitive(type); |
|
Undo.RegisterCreatedObjectUndo(p, ""); |
|
return p; |
|
} |
|
}
|
|
|