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.
29 lines
659 B
29 lines
659 B
9 years ago
|
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;
|
||
|
}
|
||
|
}
|