-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Unity Companion License (“License”) | ||
Software Copyright © 2017 Unity Technologies ApS | ||
|
||
Unity Technologies ApS (“Unity”) grants to you a worldwide, non-exclusive, no-charge, and royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute the software that is made available under this License (“Software”), subject to the following terms and conditions: | ||
|
||
1. Unity Companion Use Only. Exercise of the license granted herein is limited to exercise for the creation, use, and/or distribution of applications, software, or other content pursuant to a valid Unity content authoring and rendering engine software license (“Engine License”). That means while use of the Software is not limited to use in the software licensed under the Engine License, the Software may not be used for any purpose other than the creation, use, and/or distribution of Engine License-dependent applications, software, or other content. No other exercise of the license granted herein is permitted, and in no event may the Software be used for competitive analysis or to develop a competing product or service. | ||
|
||
2. No Modification of Engine License. Neither this License nor any exercise of the license granted herein modifies the Engine License in any way. | ||
|
||
3. Ownership & Grant Back to You. | ||
|
||
3.1 You own your content. In this License, “derivative works” means derivatives of the Software itself--works derived only from the Software by you under this License (for example, modifying the code of the Software itself to improve its efficacy); “derivative works” of the Software do not include, for example, games, apps, or content that you create using the Software. You keep all right, title, and interest to your own content. | ||
|
||
3.2 Unity owns its content. While you keep all right, title, and interest to your own content per the above, as between Unity and you, Unity will own all right, title, and interest to all intellectual property rights (including patent, trademark, and copyright) in the Software and derivative works of the Software, and you hereby assign and agree to assign all such rights in those derivative works to Unity. | ||
|
||
3.3 You have a license to those derivative works. Subject to this License, Unity grants to you the same worldwide, non-exclusive, no-charge, and royalty-free copyright license to derivative works of the Software you create as is granted to you for the Software under this License. | ||
|
||
4. Trademarks. You are not granted any right or license under this License to use any trademarks, service marks, trade names, products names, or branding of Unity or its affiliates (“Trademarks”). Descriptive uses of Trademarks are permitted; see, for example, Unity’s Branding Usage Guidelines at https://unity3d.com/public-relations/brand. | ||
|
||
5. Notices & Third-Party Rights. This License, including the copyright notice associated with the Software, must be provided in all substantial portions of the Software and derivative works thereof (or, if that is impracticable, in any other location where such notices are customarily placed). Further, if the Software is accompanied by a Unity “third-party notices” or similar file, you acknowledge and agree that software identified in that file is governed by those separate license terms. | ||
|
||
6. DISCLAIMER, LIMITATION OF LIABILITY. THE SOFTWARE AND ANY DERIVATIVE WORKS THEREOF IS PROVIDED ON AN "AS IS" BASIS, AND IS PROVIDED WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND/OR NONINFRINGEMENT. IN NO EVENT SHALL ANY COPYRIGHT HOLDER OR AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES (WHETHER DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL, INCLUDING PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF USE, DATA, OR PROFITS, AND BUSINESS INTERRUPTION), OR OTHER LIABILITY WHATSOEVER, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM OR OUT OF, OR IN CONNECTION WITH, THE SOFTWARE OR ANY DERIVATIVE WORKS THEREOF OR THE USE OF OR OTHER DEALINGS IN SAME, EVEN WHERE ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
7. USE IS ACCEPTANCE and License Versions. Your receipt and use of the Software constitutes your acceptance of this License and its terms and conditions. Software released by Unity under this License may be modified or updated and the License with it; upon any such modification or update, you will comply with the terms of the updated License for any use of any of the Software under the updated License. | ||
|
||
8. Use in Compliance with Law and Termination. Your exercise of the license granted herein will at all times be in compliance with applicable law and will not infringe any proprietary rights (including intellectual property rights); this License will terminate immediately on any breach by you of this License. | ||
|
||
9. Severability. If any provision of this License is held to be unenforceable or invalid, that provision will be enforced to the maximum extent possible and the other provisions will remain in full force and effect. | ||
|
||
10. Governing Law and Venue. This License is governed by and construed in accordance with the laws of Denmark, except for its conflict of laws rules; the United Nations Convention on Contracts for the International Sale of Goods will not apply. If you reside (or your principal place of business is) within the United States, you and Unity agree to submit to the personal and exclusive jurisdiction of and venue in the state and federal courts located in San Francisco County, California concerning any dispute arising out of this License (“Dispute”). If you reside (or your principal place of business is) outside the United States, you and Unity agree to submit to the personal and exclusive jurisdiction of and venue in the courts located in Copenhagen, Denmark concerning any Dispute. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System; | ||
using NUnit.Framework; | ||
using Unity.Entities.Tests; | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace Unity.Entities.Editor.Tests | ||
{ | ||
public class ComponentTypeFilterUITests : ECSTestsFixture | ||
{ | ||
|
||
public void SetFilterDummy(ComponentGroup group) | ||
{ | ||
|
||
} | ||
|
||
private World WorldSelectionGetter() | ||
{ | ||
return World.Active; | ||
} | ||
|
||
[Test] | ||
public void ComponentTypeFilterUI_GetTypesIgnoresNullWorld() | ||
{ | ||
var filterUI = new ComponentTypeFilterUI(SetFilterDummy, () => null); | ||
Assert.DoesNotThrow(filterUI.GetTypes); | ||
} | ||
|
||
[Test] | ||
public void ComponentTypeFilterUI_ComparisonToTypeManagerCorrect() | ||
{ | ||
var filterUI = new ComponentTypeFilterUI(SetFilterDummy, WorldSelectionGetter); | ||
Assert.IsFalse(filterUI.TypeListValid()); | ||
filterUI.GetTypes(); | ||
Assert.IsTrue(filterUI.TypeListValid()); | ||
} | ||
|
||
[Test] | ||
public void ComponentTypeFilterUI_ComponentGroupCaches() | ||
{ | ||
var filterUI = new ComponentTypeFilterUI(SetFilterDummy, WorldSelectionGetter); | ||
var types = new ComponentType[] | ||
{ComponentType.Create<EcsTestData>(), ComponentType.ReadOnly<EcsTestData2>()}; | ||
Assert.IsNull(filterUI.GetExistingGroup(types)); | ||
var group = filterUI.GetComponentGroup(types); | ||
Assert.AreEqual(group, filterUI.GetExistingGroup(types)); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
using System; | ||
using NUnit.Framework; | ||
using Unity.Entities.Tests; | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace Unity.Entities.Editor.Tests | ||
{ | ||
public class EntityDebuggerTests : ECSTestsFixture | ||
{ | ||
|
||
private EntityDebugger m_Window; | ||
private ComponentSystem m_System; | ||
private ComponentGroup m_ComponentGroup; | ||
private Entity m_Entity; | ||
|
||
class SingleGroupSystem : ComponentSystem | ||
{ | ||
|
||
#pragma warning disable 0169 // "never used" warning | ||
struct Group | ||
{ | ||
private int Length; | ||
private ComponentDataArray<EcsTestData> testDatas; | ||
} | ||
|
||
[Inject] private Group entities; | ||
#pragma warning restore 0169 | ||
|
||
protected override void OnUpdate() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
|
||
private static void CloseAllDebuggers() | ||
{ | ||
var windows = Resources.FindObjectsOfTypeAll<EntityDebugger>(); | ||
foreach (var window in windows) | ||
window.Close(); | ||
} | ||
|
||
public override void Setup() | ||
{ | ||
base.Setup(); | ||
|
||
CloseAllDebuggers(); | ||
|
||
m_Window = EditorWindow.GetWindow<EntityDebugger>(); | ||
|
||
m_System = World.Active.GetOrCreateManager<SingleGroupSystem>(); | ||
|
||
m_ComponentGroup = m_System.ComponentGroups[0]; | ||
|
||
m_Entity = m_Manager.CreateEntity(typeof(EcsTestData)); | ||
} | ||
|
||
public override void TearDown() | ||
{ | ||
CloseAllDebuggers(); | ||
|
||
base.TearDown(); | ||
} | ||
|
||
[Test] | ||
public void EntityDebugger_SetAllSelections() | ||
{ | ||
|
||
EntityDebugger.SetAllSelections(World.Active, m_System, m_ComponentGroup, m_Entity); | ||
|
||
Assert.AreEqual(World.Active, m_Window.WorldSelection); | ||
Assert.AreEqual(m_System, m_Window.SystemSelection); | ||
Assert.AreEqual(m_ComponentGroup, m_Window.ComponentGroupSelection); | ||
Assert.AreEqual(m_Entity, m_Window.EntitySelection); | ||
} | ||
|
||
[Test] | ||
public void EntityDebugger_RememberSelections() | ||
{ | ||
|
||
EntityDebugger.SetAllSelections(World.Active, m_System, m_ComponentGroup, m_Entity); | ||
|
||
m_Window.SetWorldSelection(null, true); | ||
|
||
m_Window.SetWorldSelection(World.Active, true); | ||
|
||
Assert.AreEqual(World.Active, m_Window.WorldSelection); | ||
Assert.AreEqual(m_System, m_Window.SystemSelection); | ||
Assert.AreEqual(m_ComponentGroup, m_Window.ComponentGroupSelection); | ||
Assert.AreEqual(m_Entity, m_Window.EntitySelection); | ||
} | ||
|
||
[Test] | ||
public void EntityDebugger_SetAllEntitiesFilter() | ||
{ | ||
var components = new ComponentType[] {ComponentType.Create<EcsTestData>() }; | ||
var componentGroup = World.Active.GetExistingManager<EntityManager>().CreateComponentGroup(components); | ||
|
||
m_Window.SetWorldSelection(World.Active, true); | ||
m_Window.SetSystemSelection(null, true, true); | ||
m_Window.SetAllEntitiesFilter(componentGroup); | ||
Assert.AreEqual(componentGroup, m_Window.ComponentGroupSelection); | ||
|
||
m_Window.SetComponentGroupSelection(null, true, true); | ||
m_Window.SetSystemSelection(World.Active.GetExistingManager<EntityManager>(), true, true); | ||
m_Window.SetAllEntitiesFilter(componentGroup); | ||
Assert.AreEqual(componentGroup, m_Window.ComponentGroupSelection); | ||
|
||
m_Window.SetSystemSelection(m_System, true, true); | ||
m_Window.SetAllEntitiesFilter(componentGroup); | ||
Assert.AreNotEqual(componentGroup, m_Window.ComponentGroupSelection); | ||
} | ||
|
||
[Test] | ||
public void EntityDebugger_StylesIntact() | ||
{ | ||
Assert.IsNotNull(EntityDebuggerStyles.ComponentRequired); | ||
Assert.IsNotNull(EntityDebuggerStyles.ComponentSubtractive); | ||
Assert.IsNotNull(EntityDebuggerStyles.ComponentReadOnly); | ||
Assert.IsNotNull(EntityDebuggerStyles.ComponentReadWrite); | ||
|
||
Assert.IsNotNull(EntityDebuggerStyles.ComponentRequired.normal.background); | ||
Assert.IsNotNull(EntityDebuggerStyles.ComponentSubtractive.normal.background); | ||
Assert.IsNotNull(EntityDebuggerStyles.ComponentReadOnly.normal.background); | ||
Assert.IsNotNull(EntityDebuggerStyles.ComponentReadWrite.normal.background); | ||
} | ||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
using System.Collections.Generic; | ||
using NUnit.Framework; | ||
using Unity.Entities.Tests; | ||
using UnityEditor.IMGUI.Controls; | ||
|
||
namespace Unity.Entities.Editor.Tests | ||
{ | ||
public class ListViewTests : ECSTestsFixture | ||
{ | ||
public static void SetEntitySelection(Entity s, bool updateList) | ||
{ | ||
} | ||
|
||
public World GetWorldSelection() | ||
{ | ||
return World.Active; | ||
} | ||
|
||
public static void SetComponentGroupSelection(ComponentGroup group, bool updateList, bool propagate) | ||
{ | ||
} | ||
|
||
public static void SetSystemSelection(ScriptBehaviourManager system, bool updateList, bool propagate) | ||
{ | ||
} | ||
|
||
[Test] | ||
public void EntityListView_CanSetNullGroup() | ||
{ | ||
var listView = new EntityListView(new TreeViewState(), null, SetEntitySelection, GetWorldSelection); | ||
|
||
Assert.DoesNotThrow( () => listView.SelectedComponentGroup = null ); | ||
} | ||
|
||
[Test] | ||
public void ComponentGroupListView_CanSetNullSystem() | ||
{ | ||
var listView = new ComponentGroupListView(new TreeViewState(), EmptySystem, SetComponentGroupSelection, GetWorldSelection); | ||
|
||
Assert.DoesNotThrow(() => listView.SelectedSystem = null); | ||
} | ||
|
||
[Test] | ||
public void SystemListView_CanCreateWithNullWorld() | ||
{ | ||
SystemListView listView; | ||
var states = new List<TreeViewState>(); | ||
var stateNames = new List<string>(); | ||
Assert.DoesNotThrow(() => | ||
{ | ||
listView = SystemListView.CreateList(states, stateNames, SetSystemSelection, GetWorldSelection); | ||
listView.Reload(); | ||
}); | ||
} | ||
|
||
[Test] | ||
public void ComponentGroupListView_SortOrderExpected() | ||
{ | ||
var typeList = new List<ComponentType>(); | ||
var subtractive = ComponentType.Subtractive<EcsTestData>(); | ||
var readWrite = ComponentType.Create<EcsTestData2>(); | ||
var readOnly = ComponentType.ReadOnly<EcsTestData3>(); | ||
|
||
typeList.Add(subtractive); | ||
typeList.Add(readOnly); | ||
typeList.Add(readWrite); | ||
typeList.Sort(ComponentGroupListView.CompareTypes); | ||
|
||
Assert.AreEqual(readOnly, typeList[0]); | ||
Assert.AreEqual(readWrite, typeList[1]); | ||
Assert.AreEqual(subtractive, typeList[2]); | ||
} | ||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "Unity.Entities.Editor.Tests", | ||
"references": [ | ||
"Unity.Entities", | ||
"Unity.Entities.Editor", | ||
"Unity.Collections", | ||
"Unity.Entities.Tests" | ||
], | ||
"optionalUnityReferences": [ | ||
"TestAssemblies" | ||
], | ||
"includePlatforms": [ | ||
"Editor" | ||
], | ||
"excludePlatforms": [], | ||
"allowUnsafeCode": true | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
| ||
using System.Runtime.CompilerServices; | ||
|
||
[assembly:InternalsVisibleTo("Unity.Entities.Editor.Tests")] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.