This commit is contained in:
Fabrizio Perria 2018-05-02 14:53:05 +02:00
Родитель 09fae9d5ce
Коммит 11da0cdbf2
83 изменённых файлов: 4421 добавлений и 208 удалений

73
.editorconfig Normal file
Просмотреть файл

@ -0,0 +1,73 @@
# see http://editorconfig.org/ for docs on this file
root = true
[*]
# help with sharing files across os's (i.e. network share or through local vm)
#end_of_line = lf
#charset temporarily disabled due to bug in VS2017 changing to UTF-8 with BOM (https://favro.com/card/c564ede4ed3337f7b17986b6/Uni-17877)
#charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
# formattable file extensions (keep in sync with format.ini from unity-meta repo)
#
# Note: We need to split the formattable files configs into shorter duplicate entries (logically grouped)
# due to known issue in VS editorconfig extension where there is a limit of 51 characters (empirically determined).
# see: https://github.com/editorconfig/editorconfig-visualstudio/issues/21
#
## uncrustify
[*.{c,h,cpp,hpp,m,mm,cc,cs}]
indent_style = space
indent_size = 4
## generic formatter (shaders)
[*.{cg,cginc,glslinc,hlsl,shader,y,ypp,yy}]
indent_style = space
indent_size = 4
## generic formatter (misc)
[*.{asm,s,S,pch,pchmm,java,sh,uss}]
indent_style = space
indent_size = 4
## perltidy
[*.{pl,pm,t,it}]
indent_style = space
indent_size = 4
## unity special
[*.{bindings,mem.xml}]
indent_style = space
indent_size = 4
# other filetypes we want to overwrite default configuration to preserve the standard
[{Makefile,makefile}]
# TAB characters are part of the Makefile format
indent_style = tab
[*.{md,markdown}]
# trailing whitespace is significant in markdown (bad choice, bad!)
trim_trailing_whitespace = false
# keep these and the VS stuff below in sync with .hgeol's CRLF extensions
[*.{vcproj,bat,cmd,xaml,tt,t4,ttinclude}]
end_of_line = crlf
# this VS-specific stuff is based on experiments to see how VS will modify a file after it has been manually edited.
# the settings are meant to closely match what VS does to minimize unnecessary diffs. this duplicates some settings in *
# but let's be explicit here to be safe (in case someone wants to copy-paste this out to another .editorconfig).
[*.{vcxproj,vcxproj.filters,csproj,props,targets}]
indent_style = space
indent_size = 2
end_of_line = crlf
charset = utf-8-bom
trim_trailing_whitespace = true
insert_final_newline = false
[*.{sln,sln.template}]
indent_style = tab
indent_size = 4
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

4
.gitignore поставляемый
Просмотреть файл

@ -2,9 +2,8 @@
**/Temp/
**/obj/
**/.vscode
**/.vscode/
**/.vs
**/.editorconfig
**/Assets/Plugins/*
**/Assets/Plugins.meta
@ -23,3 +22,4 @@
.vs/
build/*
TwoStickShooter/Pure/Library/AnnotationManager
*.rsp

Просмотреть файл

@ -30,11 +30,11 @@ The final parameter is the schedule mode. There are two scheduling modes to choo
Once the schedule parameters are created we actually schedule the job. There are three ways to schedule jobs depending on their type:
```C#
JobHandle Schedule(ref JobScheduleParameters parameters);
JobHandle ScheduleParallelFor(ref JobScheduleParameters parameters, int arrayLength, int innerloopBatchCount);
JobHandle ScheduleParallelForTransform(ref JobScheduleParameters parameters, IntPtr transfromAccesssArray);
JobHandle ScheduleParallelFor(ref JobScheduleParameters parameters, int arrayLength, int innerLoopBatchCount);
JobHandle ScheduleParallelForTransform(ref JobScheduleParameters parameters, IntPtr transfromAccessArray);
```
Schedule can only be used if the __ScheduleParameters__ are created with __JobType.Single__, the other two schedule functions require __JobType.ParallelFor__.
The __arrayLength__ and __innerloopBatchCount__ parameter passed to __ScheduleParallelFor__ are used to determine how many indices the jobs should process and how many indices it should handle in the inner loop (see the section on [__Execution__ and __JobRanges__](#execution-and-jobranges) for more information on the inner loop count).
The __arrayLength__ and __innerLoopBatchCount__ parameter passed to __ScheduleParallelFor__ are used to determine how many indices the jobs should process and how many indices it should handle in the inner loop (see the section on [__Execution__ and __JobRanges__](#execution-and-jobranges) for more information on the inner loop count).
__ScheduleParallelForTransform__ is similar to ScheduleParallelFor, but it also has access to a __TransformAccessArray__ that allows you to modify __Transform__ components on __GameObjects__. The number of indices and batch size is inferred from the TransformAccessArray.
## Execution and JobRanges
@ -51,7 +51,7 @@ The JobRanges contain the batches and indices a ParallelFor job is supposed to p
```C#
JobsUtility.GetWorkStealingRange(ref ranges, jobIndex, out begin, out end)
```
This continues until it returns `false`, and after calling it process all items with index between begin and end.
This continues until it returns `false`, and after calling it process all items with index between __begin__ and __end__.
The reason you get batches of items, rather than the full set of items the job should process, is that Unity will apply [work stealing](https://en.wikipedia.org/wiki/Work_stealing) if one job completes before the others. Work stealing in this context means that when one job is done it will look at the other jobs running and see if any of them still have a lot of work left. If it finds a job which is not complete it will steal some of the batches that it has not yet started; to dynamically redistribute the work.
Before a ParallelFor job starts processing items it also needs to limit the write access to NativeContainers on the range of items which the job is processing. If it does not do this several jobs can potentially write to the same index which leads to race conditions. The NativeContainers that need to be limited is passed to the job and there is a function to patch them; so they cannot access items outside the correct range. The code to do it looks like this:

Просмотреть файл

@ -27,7 +27,7 @@ IComponentData structs may not contain references to managed objects. Since the
An __EntityArchetype__ is a unique array of __ComponentType__. __EntityManager__ uses EntityArchetypes to group all Entities using the same ComponentTypes in chunks.
```
```C#
// Using typeof to create an EntityArchetype from a set of components
EntityArchetype archetype = EntityManager.CreateArchetype(typeof(MyComponentData), typeof(MySharedComponent));
@ -98,7 +98,8 @@ The ComponentData for each Entity is stored in what we internally refer to as a
A chunk is always linked to a specific EntityArchetype. Thus all Entities in one chunk follow the exact same memory layout. When iterating over components, memory access of components within a chunk is always completely linear, with no waste loaded into cache lines. This is a hard guarantee.
__ComponentDataArray__ is essentially an iterator over all EntityArchetypes compatible with the set of required components; for each EntityArchetype iterating over all chunks compatible with it and for each chunk iterating over all Entities in that chunk.
__ComponentDataArray__ is essentially a convenience index based iterator for a single component type;
First we iterate over all EntityArchetypes compatible with the ComponentGroup; for each EntityArchetype iterating over all chunks compatible with it and for each chunk iterating over all Entities in that chunk.
Once all Entities of a chunk have been visited, we find the next matching chunk and iterate through those Entities.
@ -115,6 +116,22 @@ By default we create a single World when entering Play Mode and populate it with
> Note: We are currently working on multiplayer demos, that will show how to work in a setup with separate simulation & presentation Worlds. This is a work in progress, so right now have no clear guidelines and are likely missing features in ECS to enable it.
## System update order
In ECS all systems are updated on the main thread. The order in which the are updated is based on a set of constraints and an optimization pass which tries to order the system in a way so that the time between scheduling a job and waiting for it is as long as possible.
The attributes to specify update order of systems are ```[UpdateBefore(typeof(OtherSystem))]``` and ```[UpdateAfter(typeof(OtherSystem))]```. In addition to update before or after other ECS systems it is possible to update before or after different phases of the Unity PlayerLoop by using typeof([UnityEngine.Experimental.PlayerLoop.FixedUpdate](https://docs.unity3d.com/2018.1/Documentation/ScriptReference/Experimental.PlayerLoop.FixedUpdate.html)) or one of the other phases in the same namespace.
The UpdateInGroup attribute will put the system in a group and the same __UpdateBefore__ and __UpdateAfter__ attributes can be specified on a group or with a group as the target of the before/after dependency.
To use __UpdateInGroup__ you need to create and empty class and pass the type of that to the __UpdateInGroup__ attribute
```cs
public class UpdateGroup
{}
[UpdateInGroup(typeof(UpdateGroup))]
class MySystem : ComponentSystem
```
## Automatic job dependency management (JobComponentSystem)
Managing dependencies is hard. This is why in __JobComponentSystem__ we are doing it automatically for you. The rules are simple: jobs from different systems can read from IComponentData of the same type in parallel. If one of the jobs is writing to the data then they can't run in parallel and will be scheduled with a dependency between the jobs.
@ -294,7 +311,7 @@ Lastly you can also inject a reference to another system. This will populate the
## ComponentGroup
The ComponentGroup is foundation class on top of which all iteration methods are built (Injection, foreach, IJobProcessComponetnData etc)
The ComponentGroup is foundation class on top of which all iteration methods are built (Injection, foreach, IJobProcessComponentData etc)
Essentially a ComponentGroup is constructed with a set of required components, subtractive components.
@ -348,7 +365,9 @@ class PositionToRigidbodySystem : ComponentSystem
The Entity struct identifies an Entity. If you need to access component data on another Entity, the only stable way of referencing that component data is via the Entity ID. EntityManager provides a simple get & set component data API for it.
```cs
Entity myEntity = ...;
var position = EntityManager.SetComponentData<LocalPosition>(entity);
var position = EntityManager.GetComponentData<LocalPosition>(entity);
...
EntityManager.SetComponentData(entity, position);
```
However EntityManager can't be used on a C# job. __ComponentDataFromEntity__ gives you a simple API that can also be safely used in a job.
@ -364,10 +383,78 @@ var position = m_LocalPositions[myEntity];
## ExclusiveEntityTransaction
EntityTransaction is an API to create & destroy entities from a job. The purpose is to enable procedural generation scenarios where construction of massive scale instantiation must happen on jobs. This API is very much a work in progress.
EntityTransaction is an API to create & destroy entities from a job. The purpose is to enable procedural generation scenarios where instantiation on big scale must happen on jobs. As the name implies it is exclusive to any other access to the EntityManager.
ExclusiveEntityTransaction should be used on manually created world that acts as a staging area to construct & setup entities.
After the job has completed you can end the EntityTransaction and use ```EntityManager.MoveEntitiesFrom(EntityManager srcEntities);``` to move the entities to an active world.
## EntityCommandBuffer
The command buffer class solves two important problems:
1. When you're in a job, you can't access the entity manager
2. When you access the entity manager (to say, create an entity) you invalidate all injected arrays and component groups
The command buffer abstraction allows you to queue up changes to be performed (from either a job or from the main thread) so that they can take effect later on the main thread. There are two ways to use a command buffer:
1. `ComponentSystem` subclasses which update on the main thread have one available automatically called `PostUpdateCommands`. To use it, simply reference the attribute and queue up your changes. They will be automatically applied to the world immediately after you return from your system's `Update` function.
Here's an example from the two stick shooter sample:
```cs
PostUpdateCommands.CreateEntity(TwoStickBootstrap.BasicEnemyArchetype);
PostUpdateCommands.SetComponent(new Position2D { Value = spawnPosition });
PostUpdateCommands.SetComponent(new Heading2D { Value = new float2(0.0f, -1.0f) });
PostUpdateCommands.SetComponent(default(Enemy));
PostUpdateCommands.SetComponent(new Health { Value = TwoStickBootstrap.Settings.enemyInitialHealth });
PostUpdateCommands.SetComponent(new EnemyShootState { Cooldown = 0.5f });
PostUpdateCommands.SetComponent(new MoveSpeed { speed = TwoStickBootstrap.Settings.enemySpeed });
PostUpdateCommands.AddSharedComponent(TwoStickBootstrap.EnemyLook);
```
As you can see, the API is very similar to the entity manager API. In this mode, it is helpful to think of the automatic command buffer as a convenience that allows you to prevent array invalidation inside your system while still making changes to the world.
2. For jobs, you must request command buffers from a `Barrier` on the main thread, and pass them to jobs. The barriers will play back in the created order on the main thread when the barrier system updates. This extra step is required so that memory management can be centralized and determinism of the generated entities and components can be guaranteed.
Again let's look at the two stick shooter sample to see how this works in practice.
First, a barrier system is declared:
```cs
public class ShotSpawnBarrier : BarrierSystem
{}
```
There's no code in a barrier system, it just serves as a synchronization point.
Next, we inject this barrier into the system that will request command buffers from it:
```cs
[Inject] private ShotSpawnBarrier m_ShotSpawnBarrier;
```
Now we can access the barrier when we're scheduling jobs and ask for command
buffers from it via `CreateCommandBuffer()`:
```cs
return new SpawnEnemyShots
{
// ...
CommandBuffer = m_ShotSpawnBarrier.CreateCommandBuffer(),
// ...
}.Schedule(inputDeps);
```
In the job, we can use the command buffer normally:
```cs
CommandBuffer.CreateEntity(ShotArchetype);
CommandBuffer.SetComponent(spawn);
```
When the barrier system updates, it will automatically play back the command buffers. It's worth noting that the barrier system will take a dependency on any jobs spawned by systems that access it (so that it can now that the command buffers have been filled in fully). If you see bubbles in the frame, it may make sense to try moving the barrier later in the frame, if your game logic allows for this.
## GameObjectEntity
ECS ships with the __GameObjectEntity__ component. It is a MonoBehaviour. In __OnEnable__, the GameObjectEntity component creates an Entity with all components on the GameObject. As a result the full GameObject and all its components are now iterable by ComponentSystems.

Просмотреть файл

@ -11,7 +11,7 @@ We measure ourselves against the performance that can be achieved in C++ with ha
We are using a combination of compiler technology (Burst), containers (Unity.Collections), data layout of components (ECS) to make it easy to write efficient code by default.
* Data layout & iteration - The Entity Component System gurantees linear data layout when iterating entities in chunks by default. This is a critical part of the performance gains provided by the Entity Component System.
* The C# job system lets you write multithreaded code in a simple way. It also safe. The C# Job Debugger detects any race conditions.
* The C# job system lets you write multithreaded code in a simple way. It is also safe. The C# Job Debugger detects any race conditions.
* Burst is our compiler specifically for C# jobs. C# job code follows certain patterns that we can use to produce more efficient machine code. Code is compiled & optimized for each target platforms taking advantage of SIMD instructions.
An example of this is the performance of Instantiation. Comparing to the theoretical limit, of instantiating 100.000 entities with 320 bytes of a memcpy takes 9ms. Instantiating those entities via the Entity Component System takes 10ms. So we are very close to the theoretical lmit.

Просмотреть файл

@ -21,6 +21,8 @@ However we need to introduce a new way of thinking and coding to take full advan
MonoBehaviours contain both the data and the behaviour. This component will simply rotate the __Transform__ component every frame.
```C#
using UnityEngine;
class Rotator : MonoBehaviour
{
// The data - editable in the inspector
@ -30,7 +32,7 @@ class Rotator : MonoBehaviour
// and changes the rotation of the Transform component.
void Update()
{
transform.rotation *= Quaternion.AxisAngle(Time.deltaTime * speed, Vector3.up);
transform.rotation *= Quaternion.AngleAxis(Time.deltaTime * speed, Vector3.up);
}
}
```
@ -41,9 +43,12 @@ However MonoBehaviour inherits from a number of other classes; each containing t
In the new model the component only contains the data.
The __ComponentSystem__ contains the behavior. One ComponentSystem is responsible for updating all GameObjects with a matching set of components (that is defined within a struct).
The __ComponentSystem__ contains the behavior. One ComponentSystem is responsible for updating all GameObjects with a matching set of components.
```C#
using Unity.Entities;
using UnityEngine;
class Rotator : MonoBehaviour
{
// The data - editable in the inspector
@ -56,11 +61,11 @@ class RotatorSystem : ComponentSystem
{
// Define what components are required for this
// ComponentSystem to handle them.
Transform Transform;
Rotator Rotator;
public Transform Transform;
public Rotator Rotator;
}
override protected OnUpdate()
override protected void OnUpdate()
{
// We can immediately see a first optimization.
// We know delta time is the same between all rotators,
@ -74,7 +79,7 @@ class RotatorSystem : ComponentSystem
// (as defined above in Group struct).
foreach (var e in GetEntities<Group>())
{
e.Transform.rotation *= Quaternion.AxisAngle(e.Rotator.Speed * deltaTime, Vector3.up);
e.Transform.rotation *= Quaternion.AngleAxis(e.Rotator.Speed * deltaTime, Vector3.up);
}
}
}
@ -94,6 +99,9 @@ ECS ships with the __GameObjectEntity__ component. On __OnEnable__, the GameObje
> Thus for the time being you must add a GameObjectEntity component on each GameObject that you want to be visible / iterable from the ComponentSystem.
### How does the ComponentSystem get created?
Unity automatically creates a default world on startup and populates it with all Component Systems in the project. Thus if you have a game object with the the necessary components and a __GameObjectEntity__, the System will automatically start executing with those components.
### What does this mean for my game?
It means that you can one by one, convert behavior from __MonoBehaviour.Update__ methods into ComponentSystems. You can in fact keep all your data in a MonoBehaviour, and this is in fact a very simple way of starting the transition to ECS style code.
@ -128,6 +136,9 @@ The C# job system does not support managed class types; only structs and __Nativ
The EntityManager makes hard guarantees about [linear memory layout](https://en.wikipedia.org/wiki/Flat_memory_model) of the component data. This is an important part of the great performance you can achieve with C# jobs using IComponentData.
```cs
using System;
using Unity.Entities;
// The rotation speed component simply stores the Speed value
[Serializable]
public struct RotationSpeed : IComponentData
@ -141,6 +152,13 @@ public class RotationSpeedComponent : ComponentDataWrapper<RotationSpeed> { }
```
```cs
using Unity.Collections;
using Unity.Entities;
using Unity.Jobs;
using Unity.Mathematics;
using Unity.Transforms;
using UnityEngine;
// Using IJobProcessComponentData to iterate over all entities matching the required component types.
// Processing of entities happens in parallel. The main thread only schedules jobs.
public class RotationSpeedSystem : JobComponentSystem

Просмотреть файл

@ -1,6 +1,6 @@
# Is the Entity Component System for you?
The Entity Componetn System is in preview. It is not recommended for production.
The Entity Component System is in preview. It is not recommended for production.
At the moment there are two good reasons to use it.

Просмотреть файл

@ -1,66 +1,99 @@
# Job system
# C# Job System
TODO: WHY MULTITHREAD?
## How the C# Job System works
## How the job system works
The Unity C# Job System is designed to allow users to write [multithreaded](https://en.wikipedia.org/wiki/Multithreading_(computer_architecture)) code that interacts well with the rest of the Unity engine, and makes it easier to write correct code.
The job system in Unity is designed to allow users to write multi-threaded code which interacts well with the rest of the engine, while making it easier to write correct code.
Writing multithreaded code can provide great performance benefits, including significant gains in frame rate, and improved battery life for mobile devices.
An important aspect of the C# Job System is that it integrates with what the engine uses internally (Unitys native job system). This means that user written code and the engine will share [worker threads](https://msdn.microsoft.com/en-us/library/69644x60.aspx) to avoid creating more threads than [CPU cores](https://en.wikipedia.org/wiki/Multi-core_processor); which would cause contention for CPU resources.
## What is multithreading?
When most people think of multi-threading they think of creating threads which runs code and then synchronizes its results with the main thread somehow. This works well if you have a few tasks which run for a long time.
Multithreading is a type of programming that takes advantage of the fact that a CPU can process multiple threads at the same time. Instead of coded tasks or instructions executing one after another, they execute simultaneously.
When you are [parallelizing](https://en.wikipedia.org/wiki/Parallel_computing) a game that is rarely the case. Usually you have a huge amount of very small things to do. If you create threads for all of them you will end up with a huge amount of threads with a short lifetime.
A main thread runs at the start of a program by default. Then the main thread creates new threads (often called worker threads) based on the code. The worker threads then run in [parallel](https://en.wikipedia.org/wiki/Parallel_computing) to one another and usually synchronize their results with the main thread once completed.
You can mitigate the issue of thread lifetime by having a [pool of threads](https://en.wikipedia.org/wiki/Thread_pool), but even if you do you will have a large amount of threads alive at the same time. Having more threads than CPU cores leads to the threads contending with each other for CPU resources, with frequent [context switches](https://en.wikipedia.org/wiki/Context_switch) as a result.
This approach to multithreading works well if you have a few tasks that run for a long time. Game development code usually contains multiple small tasks and instructions to execute at once. If you create a thread for each one, you can end up with many threads, each with a short lifetime. This can push the limits of the processing capacity of your CPU and operating system.
When the CPU does a context switch it needs to do a lot of work to make sure the state is correct for the new thread, which can be quite resource intensive and should be avoided if possible.
You can mitigate the issue of thread lifetime by having a [pool of threads](https://en.wikipedia.org/wiki/Thread_pool), but even if you do, you will have a large amount of threads alive at the same time. Having more threads than CPU cores leads to the threads contending with each other for CPU resources, with frequent [context switches](https://en.wikipedia.org/wiki/Context_switch) as a result.
Context switching is the process of saving the state of a thread part way through execution, then working on another thread, and then reconstructing the first thread later on to continue processing it. Context switching is resource-intensive, so its important to avoid the need for it wherever possible.
## What is a job system?
A job system solves the task of parallelizing the code in a slightly different way. Instead of systems creating threads they create something called [jobs](https://en.wikipedia.org/wiki/Job_(computing)). A job is similar to a function call, including the parameters and data it needs, all of which is put into a [job queue](https://en.wikipedia.org/wiki/Job_queue) to execute. Jobs should be kept fairly small and do one specific thing.
A job system manages multithreaded code in a different way. Instead of systems creating threads they create something called [jobs](https://en.wikipedia.org/wiki/Job_(computing)). A job receives parameters and operates on data, similar to how a method call behaves. Jobs should be fairly small, and do one specific task.
The job system has a set of worker threads, usually one thread per logical CPU core to avoid context switching. The worker threads take items from the job queue and executes them.
A job system puts jobs into a queue to execute. Worker threads in a job system take items from the job queue and execute them. A job system usually has one worker thread per logical CPU core, to avoid context switching.
If each job is self contained this is all you need. However in more complex systems the likelyhood of all jobs being completely self contained is usually not the case, since that would result in large jobs doing a lot of things. So what you usually end up with is one job preparing the data for the next job.
If each job is self contained this is all you need. However, this is unlikely in complex systems like those required for game development. So what you usually end up with is one job preparing the data for the next job. To manage this, jobs are aware of and support [dependencies](http://tutorials.jenkov.com/ood/understanding-dependencies.html).
To make this easier, jobs support [dependencies](http://tutorials.jenkov.com/ood/understanding-dependencies.html). If Job A is scheduled with a dependency on Job B the system will guarantee that Job B has completed before Job A starts executing.
If **job A** has a dependency on **job B**, the job system ensures that **job A** does not start executing until **job B** is complete.
An important aspect of the C# job system, and one of the reasons it is a custom API and not one of the existing thread models from C#, is that the job system integrates with what the Unity engine uses internally. This means that user written code and the engine will share worker threads to avoid creating more threads than CPU cores - which would cause contention for CPU resources.
## Race conditions
## Race conditions & safety system
When writing multithreaded code there is always a risk for [race conditions](https://en.wikipedia.org/wiki/Race_condition). A race condition occurs when the output of one operation depends on the timing of another operation outside of its control.
When writing multi threaded code there is always a risk for [race conditions](https://en.wikipedia.org/wiki/Race_condition). A race condition means that the output of some operation depends on the timing of some other operation that it cannot control. Whenever someone is writing data, and someone else is reading that data at the same time, there is a race condition. What value the reader sees depends on if the writer executed before or after the reader, which the reader has no control over.
A race condition is not always a bug, but it is always a source of indeterministic behaviour. When a race condition does cause a bug, it can be difficult to find the source of the problem because it depends on timing. This means you can only recreate the issue on rare occasions, and debugging it can cause the problem to disappear; because breakpoints and logging can change the timing too. To a large extent, this is what produces the largest challenge in writing multithreaded code.
A race condition is not always a bug, but it is always a source of indeterministic behaviour, and when it does lead to bugs such as crashes, deadlocks, or incorrect output it can be difficult to find the source of the problem since it depends on timing. This means the issue can only be recreated on rare occasions and debugging it can cause the problem to disappear; as breakpoints and logging change the timing too.
## Safety system
To a large extent, this is what makes writing multithreaded code difficult, but fear not - we've got your back.
To make it easier to write multithreaded code in the C# Job System there is a safety system build in. The safety system detects all potential race conditions and protects you from the bugs they can cause.
To make it easier to write multithreaded code the job system in Unity aims to detect all potential race condition and protect you from the bugs they can cause.
The main way the C# Job System solves this is to send each job a copy of the data it needs to operate on, rather than a reference to the data in the main thread. This isolates the data, which eliminates the race condition.
The main way this is achieved is by making sure jobs only operate on a copy of all data that is passed to it. If no-one else has access to the data that the job operates on then it cannot possibly cause a race condition. Copying data this way means that a job can only have access to [blittable](https://en.wikipedia.org/wiki/Blittable_types) data, not [managed](https://en.wikipedia.org/wiki/Managed_code) types. This is quite limiting, as you cannot return any result from the job.
The way the C# Job System copies data means that a job can only access [blittable data types](https://en.wikipedia.org/wiki/Blittable_types) (which do not require conversion when passed between [managed](https://en.wikipedia.org/wiki/Managed_code) and native code).
To make it possible to write code to solve real world scenarios there is one exception to the rule of copying data. That exception is __NativeContainers__.
The C# Job System can copy blittable types with [memcpy](http://www.cplusplus.com/reference/cstring/memcpy/) and transfer the data between the managed and native parts of Unity. It uses `memcpy` to put it into native memory on [Schedule](https://docs.unity3d.com/2018.1/Documentation/ScriptReference/Unity.Jobs.IJobExtensions.Schedule.html) and gives the managed side access to that copy on [Execute](https://docs.unity3d.com/2018.1/Documentation/ScriptReference/Unity.Jobs.IJob.Execute.html). This can be limiting, because you cannot return a result from the job.
Unity ships with a set of NativeContainers: [__NativeArray__](https://docs.unity3d.com/2018.1/Documentation/ScriptReference/Unity.Collections.NativeArray_1.html), __NativeList__, __NativeHashMap__, and __NativeQueue__.
## NativeContainers
All native containers are instrumented with the safety system. Unity tracks all containers and who is reading and writing to it.
There is one exception to the rule of copying data. That exception is [NativeContainers](https://docs.unity3d.com/2018.1/Documentation/ScriptReference/Unity.Collections.LowLevel.Unsafe.NativeContainerAttribute.html).
For example, if two jobs writing to the same native array are scheduled, the safety system throws an exception with a clear error message explaining why and how to solve the problem. In this case you can always schedule a job with a dependency, so that the first job can write to the container and once it has executed the next job can read & write to that container safely.
A `NativeContainer` is a managed [value type](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/value-types) that provides a relatively safe C# wrapper for native memory. When used with the C# Job System, it allows a job to access shared data on the main thread rather than working with a copy of it.
Having multiple jobs reading the same data in parallel is allowed of course.
Unity ships with a set of `NativeContainers`: [NativeArray](https://docs.unity3d.com/2018.1/Documentation/ScriptReference/Unity.Collections.NativeArray_1.html), NativeList, NativeHashMap, and NativeQueue.
The same read and write restrictions apply to accessing the data from the main thread.
> Note: Only `NativeArray` is available without the ECS package.
Some containers also have special rules for allowing safe and deterministic write access from __ParallelFor__ jobs. As an example __NativeHashMap.Concurrent__ lets you add items in parallel from __IJobParallelFor__.
You can also manipulate `NativeArrays` with [NativeSlice](https://docs.unity3d.com/2018.1/Documentation/ScriptReference/Unity.Collections.NativeSlice_1.html) to get a subset of the `NativeArray` from a certain position to a certain length.
> Note: At the moment protection against accessing static data from within a job is not in place. This means you can technically get access to anything from within the job. This is something we aim to protect against in the future. If you do access static data inside a job you should expect your code to break in future versions.
All `NativeContainers` have the safety system built in, which tracks all `NativeContainers`, and what is reading and writing to them.
For example, if two scheduled jobs are writing to the same `NativeArray`, the safety system throws an exception with a clear error message that explains why and how to solve the problem. In this case, you can always schedule a job with a dependency so that the first job can write to the `NativeContainer`, and once it has finished executing, the next job can safely read and write to that `NativeContainer` as well.
The same read and write restrictions apply when accessing the data from the main thread. The safety system allows many jobs to read from the same data in parallel.
Some `NativeContainers` also have special rules for allowing safe and deterministic write access from [_ParallelFor jobs_](#parallelfor-jobs). As an example, the method `NativeHashMap.Concurrent` lets you add items in parallel from [IJobParallelFor](https://docs.unity3d.com/2018.1/Documentation/ScriptReference/Unity.Jobs.IJobParallelFor.html).
> Note: There is no protection against accessing static data from within a job. Accessing static data circumvents all safety systems and can crash Unity. For more information, see [_Troubleshooting_](#job-system-tips-and-troubleshooting).
## NativeContainer Allocators
There are three types of [Allocators](https://docs.unity3d.com/2018.1/Documentation/ScriptReference/Unity.Collections.Allocator.html) that handle `NativeContainer` memory allocation and release. You will need to specify one of these when instantiating a `NativeContainer`.
* **Allocator.Temp** has the fastest allocation. It is intended for allocations with a lifespan of 1 frame or fewer and is not thread-safe. `Temp` `NativeContainer` allocations should call the `Dispose` method before you return from the function call.
* **Allocator.TempJob** is a slower allocation than `Temp`, but is faster than `Persistent`. It is intended for allocations with a lifespan of 4 frames or fewer and is thread-safe. Most short jobs use this `NativeContainer` allocation type.
* **Allocator.Persistent** is the slowest allocation, but lasts throughout the application lifetime. It is a wrapper for a direct call to [malloc](http://www.cplusplus.com/reference/cstdlib/malloc/). Longer jobs may use this `NativeContainer` allocation type.
For example:
```c#
NativeArray<float> result = new NativeArray<float>(1, Allocator.Temp);
```
## Scheduling jobs
As mentioned in the previous section, the job system relies on blittable data and NativeContainers. To schedule a job you need to implement the [__IJob__](https://docs.unity3d.com/2018.1/Documentation/ScriptReference/Unity.Jobs.IJob.html) interface, create an instance of your struct, fill it with data and call __Schedule__ on it. When you schedule it you will get back a job handle which can be used as a dependency for other jobs, or you can wait for it when you need to access the NativeContainers passed to the job on the main thread again.
To schedule a job you need to implement the [IJob](https://docs.unity3d.com/2018.1/Documentation/ScriptReference/Unity.Jobs.IJob.html) interface. This allows you to schedule a single job that runs in parallel to other jobs and the main thread. To do this, create an instance of your struct, populate it with data and call the `Schedule` method. Calling `Schedule` will put the job into the job queue to be executed at the appropriate time.
When you schedule a job, you will get back a [JobHandle](https://docs.unity3d.com/2018.1/Documentation/ScriptReference/Unity.Jobs.JobHandle.html) you can use in your code as a dependency for other jobs. Otherwise, you can force your code to wait in the main thread for your job to finish executing by calling the method `Complete` on the `JobHandle`; at which point you know your code can safely access the `NativeContainers` on the main thread again.
> Note: Jobs do not start executing immediately when you schedule them, unless you state that you are waiting for them in the main thread by calling the method `JobHandle.Complete`. This flushes them from the memory cache and starts the process of execution. Without `JobHandle.Complete`, you need to explicitly flush the batch by calling the static `JobHandle.ScheduleBatchedJobs` method.
## Code example: Scheduling a job that adds two floating point numbers together
**Job code**:
Jobs will actually not start executing immediately when you schedule them. We create a batch of jobs to schedule which needs to be flushed. In ECS the batch is implicitly flushed, outside ECS you need to explicitly flush it by calling the static function __JobHandle.ScheduleBatchedJobs()__.
```C#
// Job adding two floating point values together
public struct MyJob : IJob
@ -68,97 +101,142 @@ public struct MyJob : IJob
public float a;
public float b;
NativeArray<float> result;
public void Execute()
{
result[0] = a + b;
}
}
```
**Main thread code**:
```C#
// Create a native array of a single float to store the result in. This example will wait for the job to complete, which means we can use Allocator.Temp
NativeArray<float> result = new NativeArray<float>(1, Allocator.Temp);
// Setup the job data
MyJob jobData = new MyJob();
jobData.a = 10;
jobData.b = 10;
jobData.result = result;
// Schedule the job
JobHandle handle = jobData.Schedule();
// Wait for the job to complete
handle.Complete();
// All copies of the NativeArray point to the same memory, we can access the result in "our" copy of the NativeArray
float aPlusB = result[0];
// Free the memory allocated by the result array
result.Dispose();
```
If we have multiple jobs operating on the same data we need to use dependencies:
## Code example: Many jobs operating on the same data using dependencies
**Job code**:
```C#
public struct AddOneJob : IJob
{
public NativeArray<float> result;
public void Execute()
{
result[0] = result[0] + 1;
}
}
```
**Main thread code**:
```C#
NativeArray<float> result = new NativeArray<float>(1, Allocator.Temp);
// Setup the job data
MyJob jobData = new MyJob();
jobData.a = 10;
jobData.b = 10;
jobData.result = result;
// Schedule the job
JobHandle firstHandle = jobData.Schedule();
AddOneJob incJobData = new AddOneJob();
incJobData.result = result;
JobHandle handle = incJobData.Schedule(firstHandle);
// Wait for the job to complete
handle.Complete();
// All copies of the NativeArray point to the same memory, we can access the result in "our" copy of the NativeArray
float aPlusB = result[0];
// Free the memory allocated by the result array
result.Dispose();
```
## ParallelFor jobs
Scheduling jobs, as in the previous section, means there can only be one job doing one thing. In a game it very common to want to perform the same operation on a large number of things. For this scenario there is a separate job type: [IJobParallelFor](https://docs.unity3d.com/2018.1/Documentation/ScriptReference/Unity.Jobs.IJobParallelFor.html).
IJobParallelFor behaves similarly to IJob, but instead of getting a single __Execute__ callback you get one Execute callback per item in an array. The system will not actually schedule one job per item, it will schedule up to one job per CPU core and redistribute the work load, but that is dealt with internally in the system.
When scheduling ParallelForJobs you must specify the length of the array you are splitting, since the system cannot know which array you want to use as primary if there are several in the struct. You also need to specify a batch count. The batch count controls how many jobs you will get, and how fine grained the redistribution of work between threads is.
Having a low batch count, such as 1, will give you a more even distribution of work between threads. It does however come with some overhead so in some cases it is better to increase the batch count slightly. Starting at 1 and increasing the batch count until there are negligible performance gains is a valid strategy.
When scheduling jobs, there can only be one job doing one task. In a game, it is common to want to perform the same operation on a large number of datapoints. These are called [SIMD](https://en.wikipedia.org/wiki/SIMD) operations. To handle this, there is a separate job type called `IJobParallelFor`.
> Note: A ParallelFor job is a collective term in Unity for any job that implements the `IJobParallelFor` interface.
A ParallelFor job uses a `NativeArray` as its data source and runs across multiple cores. `IJobParallelFor` behaves like `IJob`, but instead of getting a single `Execute` callback, you get one `Execute` callback per item in the `NativeArray`. The system does not actually schedule one job per item, it schedules up to one job per CPU core and redistributes the workload. The system deals with this internally.
When scheduling ParallelForJobs you must specify the length of the `NativeArray` you are splitting, since the system cannot know which `NativeArray` you want to use as primary if there are several in the struct. You also need to specify a batch count. The batch count controls how many jobs you get, and how fine-grained the redistribution of work between threads is.
Having a low batch count, such as 1, gives you a more even distribution of work between threads. It does come with some overhead, so sometimes it is better to increase the batch count. Starting at 1 and increasing the batch count until there are negligible performance gains is a valid strategy.
## Code example: Scheduling a ParallelFor job that adds two floating point numbers together
**Job code**:
```C#
// Job adding two floating point values together
public struct MyParallelJob : IJobParallelFor
{
[ReadOnly]
public NativeArray<float> a;
[Readonly]
[ReadOnly]
public NativeArray<float> b;
public NativeArray<float> result;
public void Execute(int i)
{
result[i] = a[i] + b[i];
}
}
```
**Main thread code**:
```C#
var jobData = new MyParallelJob();
jobData.a = 10;
jobData.b = 10;
jobData.result = result;
// Schedule the job with one Execute per index in the results array and only 1 item per processing batch
JobHandle handle = jobData.Schedule(result.Length, 1);
// Wait for the job to complete
handle.Complete();
```
## Common mistakes
## Job System tips and troubleshooting
This is a collection of common mistakes when using the job system:
When using the C# job system, make sure you adhere to the following:
* **Accessing static data from a job**: By doing this you are circumventing all safety systems. If you access the wrong thing you **will** crash Unity, often in unexpected ways. Accessing __MonoBehaviour__ can for example cause crashes on domain reloads. (Future versions will prevent global variable access from jobs using static analysis.)
* **Not flushing schedule batches**: When you want your jobs to start you need to flush the schedule batch with `JobHandle.ScheduleBatchedJobs()`. Not doing so will delay the scheduling until someone waits for the result.
* **Expecting [ref returns](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/ref-returns)**: Due to the lack of ref returns it is not possible to directly modify the content of a NativeArray. ```nativeArray[0]++;``` is the same as writing ```var temp = nativeArray[0]; temp++;``` which will not update the value in the NativeArray. (We are working on C#7 support which will add ref returns and solve this.)
* **Not calling JobHandle.Complete**: The tracing of ownership of data requires that dependencies are completed before the main thread can use them again. This means that it is not enough to just check __JobHandle.IsDone__, calling __Complete__ is required to get back ownership of the NativeContainers to the main thread. Calling Complete also cleans up state in the jobs debugger. Not doing so introduces a memory leak, this also applies if you schedule new jobs every frame with a dependency on the previous frame's job.
### Do not access static data from a job
Accessing static data from a job circumvents all safety systems. If you access the wrong data, you might crash Unity, often in unexpected ways. (Accessing [MonoBehaviour](https://docs.unity3d.com/ScriptReference/MonoBehaviour.html) can, for example, cause crashes on domain reloads). Because of this risk, future versions of Unity will prevent global variable access from jobs using static analysis, so note that if you do access static data inside a job, you should expect your code to break in future versions of Unity.
### Always flush schedule batches
When you want your jobs to start, you need to flush the scheduled batch with `JobHandle.ScheduleBatchedJobs`. Not doing this delays the scheduling until another job waits for the result.
### Dont try to update NativeArray contents
Due to the lack of [ref returns](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/ref-returns), it is not possible to directly change the content of a `NativeArray`. `nativeArray[0]++;` is the same as writing `var temp = nativeArray[0]; temp++;` which does not update the value in the `nativeArray`. (Unity is working on C# 7.0 support, which will add ref returns and solve this.)
### Always call `JobHandle.Complete`
Tracing data ownership requires dependencies to complete before the main thread can use them again. This means that it is not enough to check `JobHandle.IsDone`. You must call the method `JobHandle.Complete` to regain ownership of the `NativeContainers` to the main thread. Calling `Complete` also cleans up the state in the jobs debugger. Not doing so introduces a memory leak. This also applies if you schedule new jobs every frame that have a dependency on the previous frame's job.

Просмотреть файл

@ -24,15 +24,41 @@
* [RotationExample.unity](content/rotation_example.md): Loop to change component if Entity position is inside a moving sphere.
## Community
* [Performance by Default](http://unity3d.com/performance-by-default)
## Further information
* [*MCV 2018 - Exclusive: Unity takes a principled step into triple-A performance at GDC*](https://www.mcvuk.com/development/exclusive-unity-takes-a-principled-step-into-triple-a-performance-at-gdc)
![Unity at GDC 2018](https://blogs.unity3d.com/wp-content/uploads/2018/03/Unity-GDC-Google-Desktop-Profile-Cover.jpg)
### Unity at GDC 2018
* [Keynote: The future of Unity (Entity Component System & Performance) by Joachim Ante](https://www.youtube.com/watch?v=3Mq9EH8RT_U)
* [Evolving Unity by Joachim Ante [FULL VIDEO]](https://www.youtube.com/watch?v=aFFLEiDr3T0)
* [Unity Job System and Entity Component System by Tim Johansson [FULL VIDEO]](https://www.youtube.com/watch?v=kwnb9Clh2Is)
* [Democratizing Data-Oriented Design: A Data-Oriented Approach to Using Component Systems by Mike Acton [FULL VIDEO]](https://www.youtube.com/watch?v=p65Yt20pw0g)
* [C# Sharp to Machine Code by Andreas Fredriksson [FULL VIDEO]](https://www.youtube.com/watch?v=NF6kcNS6U80)
* [ECS for Small Things by Vladimir Vukicevic [FULL VIDEO]](https://www.youtube.com/watch?v=EWVU6cFdmr0)
* [Exclusive: Unity takes a principled step into triple-A performance at GDC](https://www.mcvuk.com/development/exclusive-unity-takes-a-principled-step-into-triple-a-performance-at-gdc)
![Unity at Unite Austin 2017](https://blogs.unity3d.com/wp-content/uploads/2017/09/Unite_Austin_Blog_Post.jpg)
### Unity at Unite Austin 2017
* [Keynote: Performance demo ft. Nordeus by Joachim Ante](http://www.youtube.com/watch?v=0969LalB7vw)
* [Unity GitHub repository of Nordeus demo](https://github.com/Unity-Technologies/UniteAustinTechnicalPresentation)
* [Writing high performance C# scripts by Joachim Ante [FULL VIDEO]](http://www.youtube.com/watch?v=tGmnZdY5Y-E)
*Unite Austin 2017 keynote - Performance demo ft. Nordeus*
[![Unite Austin 2017 keynote - Performance demo ft. Nordeus](http://img.youtube.com/vi/0969LalB7vw/0.jpg)](http://www.youtube.com/watch?v=0969LalB7vw)
*Unite Austin 2017 - Writing high performance C# scripts*
[![Unite Austin 2017 - Writing high performance C# scripts](http://img.youtube.com/vi/tGmnZdY5Y-E/0.jpg)](http://www.youtube.com/watch?v=tGmnZdY5Y-E)
---

Просмотреть файл

@ -22,6 +22,8 @@ The new C# Job System takes advantage of multiple cores in a safe and easy way.
The C# Job System ships in 2018.1.
[Further sample projects on the C# Job System can be found here](https://github.com/stella3d/job-system-cookbook)
## Burst
Burst is a new LLVM based math-aware backend Compiler Technology makes things easier for you. It takes the C# jobs and produces highly-optimized code taking advantage of the particular capabilities of the platform youre compiling for.
@ -35,9 +37,22 @@ To help you get started, we have provided this repository of examples for learni
### The TwoStickShooter project
This is a set of projects that demonstrates different approaches with the MonoBehaviour, Hybrid Entity Component System and Pure Entity Component System. This is a good starting point to understand how the Entity Component System paradigm works.
[Further sample projects on the C# Job System can be found here](https://github.com/stella3d/job-system-cookbook)
## Installation guide for blank ECS project
> Note: If you want to have multiple versions of Unity on one machine then you need to follow [these instructions](https://docs.unity3d.com/462/Documentation/Manual/InstallingMultipleVersionsofUnity.html). The manual page is a bit old, in terms of which versions of Unity it describes, but the instructions are otherwise correct.
* Make sure you have installed the required beta version of [Unity](#what-is-in-the-build).
* Open the 2018.1.b version of Unity on your computer.
* Create a new Unity project and name it whatever you like.
> Note: In Unity 2018.1 the new Project window is a little different because it offers you more than just 2D and 3D options.
* Once the project is created then navigate in the Editor menu to: __Edit__ > __Project Settings__ > __Player__ > __Other Settings__ then set __Scripting Runtime Version__ to: __4.x equivalent__. This will cause Unity to restart.
* Go to your project location in your computer's file manager.
* Open the file _<project-name>/Packages/manifest.json_ in any text editor.
* Copy and paste the [package manifest](Samples/Packages/manifest.json) into Packages/manifest.json file of your project.
## Documentation
Looking for information on how to get started or have specific questions? Visit our ECS & Job system documentation
[Go to documentation](https://github.com/Unity-Technologies/EntityComponentSystemSamples/blob/master/Documentation/index.md)
[Go to documentation](Documentation/index.md)

Просмотреть файл

@ -1,3 +1,8 @@
# 0.0.5
## Changes
* Throw ArgumentException when creating an entity with component data exceeding chunk size (64kb)
* EntityManager.CreateComponentGroup is no longer public, use ComponentSystem.GetComponentGroup instead
# 0.0.4
## New Features
@ -34,9 +39,7 @@
* UnityPackageManager -> Packages folder. (Unity 2018.1 beta 7 introduces this change and we reflected it in the sample project)
* EntityManager.CreateComponentGroup should be replaced with ComponentSystem.GetComponentGroup.
It automatically associates & caches the ComponentGroup with the system (It is automatically disposed by ComponentSystem) and thus input dependencies will be setup correctly.
Additionally ComponentSystem.GetComponentGroup should not be called in OnUpdate() (Create and cache in OnCreateManager instead). ComponentSystem.GetComponentGroup allocates GC memory because the input is a param ComponentType[]...
It automatically associates & caches the ComponentGroup with the system (It is automatically disposed by ComponentSystem) and thus input dependencies will be setup correctly. Additionally ComponentSystem.GetComponentGroup should not be called in OnUpdate() (It is recommended to create and cache in OnCreateManager instead). ComponentSystem.GetComponentGroup allocates GC memory because the input is a param ComponentType[]...
* Systems are automatically disabled when all ComponentGroups have zero entities.
[AlwaysUpdateSystem] can be used to always force update a system.
@ -56,6 +59,8 @@ Additionally ComponentSystem.GetComponentGroup should not be called in OnUpdate(
SharedComponentDataArray<T> can also be injected similar to ComponentDataArray<T>
Access through SharedComponentDataArray is always read only
* IJobProcessComponentData is significantly simplified. Supports 1, 2, 3 parameters. Supports read only, supports additional required components & subtractive components. https://github.com/Unity-Technologies/ECSJobDemos/blob/stable/ECSJobDemos/Assets/GameCode/SimpleRotation/RotationSpeedSystem.cs
# 0.0.2
## New Features

Просмотреть файл

@ -138,11 +138,15 @@ namespace Samples.Boids
var nearestTargetPosition = targetPositions[nearestTargetPositionIndex].Value;
var obstacleSteering = position - nearestObstaclePosition;
var avoidObstacleHeading = (nearestObstaclePosition + math_experimental.normalizeSafe(obstacleSteering) * settings.obstacleAversionDistance)-position;
var targetHeading = settings.targetWeight * math_experimental.normalizeSafe(nearestTargetPosition - position);
var avoidObstacleHeading = (nearestObstaclePosition + math_experimental.normalizeSafe(obstacleSteering)
* settings.obstacleAversionDistance)-position;
var targetHeading = settings.targetWeight
* math_experimental.normalizeSafe(nearestTargetPosition - position);
var nearestObstacleDistanceFromRadius = nearestObstacleDistance - settings.obstacleAversionDistance;
var alignmentResult = settings.alignmentWeight * math_experimental.normalizeSafe((alignment/neighborCount)-forward);
var separationResult = settings.separationWeight * math_experimental.normalizeSafe((position * neighborCount) - separation);
var alignmentResult = settings.alignmentWeight
* math_experimental.normalizeSafe((alignment/neighborCount)-forward);
var separationResult = settings.separationWeight
* math_experimental.normalizeSafe((position * neighborCount) - separation);
var normalHeading = math_experimental.normalizeSafe(alignmentResult + separationResult + targetHeading);
var targetForward = math.select(normalHeading, avoidObstacleHeading, nearestObstacleDistanceFromRadius < 0);
var nextHeading = math_experimental.normalizeSafe(forward + dt*(targetForward-forward));

Просмотреть файл

@ -6,6 +6,7 @@ using Unity.Transforms;
namespace Samples.Common
{
[UpdateAfter(typeof(TransformSystem))]
public class PositionConstraintSystem : JobComponentSystem
{
struct PositionConstraintsGroup

Просмотреть файл

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: f6747bfda46264de5991ab04d5ad343e
guid: 630b8a9c1487c46f4a70b1c2249cee57
folderAsset: yes
DefaultImporter:
externalObjects: {}

Просмотреть файл

@ -0,0 +1,41 @@
using System;
using Unity.Entities;
using Unity.Mathematics;
namespace Samples.Dungeon.First
{
[Serializable]
public struct Board : IComponentData
{
public int TileSetId;
public float2 GridStep;
public int2 GridCount;
public IntRange NumRooms; // The range of the number of rooms there can be.
public IntRange RoomWidth; // The range of widths rooms can have.
public IntRange RoomHeight; // The range of heights rooms can have.
public IntRange CorridorLength; // The range of lengths corridors between rooms can have.
}
[Serializable]
public struct IntRange
{
public int m_Min; // The minimum value in this range.
public int m_Max; // The maximum value in this range.
// Constructor to set the values.
public IntRange(int min, int max)
{
m_Min = min;
m_Max = max;
}
// Get a random value from the range.
public int Random
{
get { return UnityEngine.Random.Range(m_Min, m_Max); }
}
}
public class BoardComponent : ComponentDataWrapper<Board> { }
}

Просмотреть файл

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: a989a63e85d104df4bd413ced2e4dc1b
guid: ee3706cfe14c24cc1b04cf033fd969ff
MonoImporter:
externalObjects: {}
serializedVersion: 2

Просмотреть файл

@ -0,0 +1,13 @@
using System;
using Unity.Entities;
using UnityEngine;
namespace Samples.Dungeon.First
{
[Serializable]
public struct BoardReference : ISharedComponentData
{
public int TileSetId;
}
public class BoardReferenceComponent : SharedComponentDataWrapper<BoardReference> { }
}

Просмотреть файл

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 58b5204db5154e999357d08c33a0cae6
timeCreated: 1522364652

Просмотреть файл

@ -0,0 +1,551 @@
using Unity.Collections;
using Unity.Entities;
using Unity.Mathematics;
using Unity.Transforms;
using UnityEngine;
// Sample based on: https://unity3d.com/learn/tutorials/topics/scripting/basic-2d-dungeon-generation
// This version is the starting point. It's a direct port to ECS with minimal changes.
namespace Samples.Dungeon.First
{
// Enum to specify the direction is heading.
public enum Direction
{
North, East, South, West
}
public struct Corridor
{
public int startXPos; // The x coordinate for the start of the corridor.
public int startYPos; // The y coordinate for the start of the corridor.
public int corridorLength; // How many units long the corridor is.
public Direction direction; // Which direction the corridor is heading from it's room.
// Get the end position of the corridor based on it's start position and which direction it's heading.
public int EndPositionX
{
get
{
if (direction == Direction.North || direction == Direction.South)
return startXPos;
if (direction == Direction.East)
return startXPos + corridorLength - 1;
return startXPos - corridorLength + 1;
}
}
public int EndPositionY
{
get
{
if (direction == Direction.East || direction == Direction.West)
return startYPos;
if (direction == Direction.North)
return startYPos + corridorLength - 1;
return startYPos - corridorLength + 1;
}
}
public static Corridor Setup(Room room, Board board, bool firstCorridor)
{
// Set a random direction (a random index from 0 to 3, cast to Direction).
var direction = (Direction)Random.Range(0, 4);
// Find the direction opposite to the one entering the room this corridor is leaving from.
// Cast the previous corridor's direction to an int between 0 and 3 and add 2 (a number between 2 and 5).
// Find the remainder when dividing by 4 (if 2 then 2, if 3 then 3, if 4 then 0, if 5 then 1).
// Overall effect is if the direction was South then that is 2, becomes 4, remainder is 0, which is north.
Direction oppositeDirection = (Direction)(((int)room.enteringCorridor + 2) % 4);
// If this is noth the first corridor and the randomly selected direction is opposite to the previous corridor's direction...
if (!firstCorridor && direction == oppositeDirection)
{
// Rotate the direction 90 degrees clockwise (North becomes East, East becomes South, etc).
// This is a more broken down version of the opposite direction operation above but instead of adding 2 we're adding 1.
// This means instead of rotating 180 (the opposite direction) we're rotating 90.
int directionInt = (int)direction;
directionInt++;
directionInt = directionInt % 4;
direction = (Direction)directionInt;
}
// Set a random length.
var corridorLength = board.CorridorLength.Random;
var startXPos = 0;
var startYPos = 0;
// Create a cap for how long the length can be (this will be changed based on the direction and position).
int maxLength = board.CorridorLength.m_Max;
switch (direction)
{
// If the choosen direction is North (up)...
case Direction.North:
// ... the starting position in the x axis can be random but within the width of the room.
startXPos = Random.Range (room.xPos, room.xPos + room.roomWidth - 1);
// The starting position in the y axis must be the top of the room.
startYPos = room.yPos + room.roomHeight;
// The maximum length the corridor can be is the height of the board (rows) but from the top of the room (y pos + height).
maxLength = board.GridCount.y - startYPos - board.RoomHeight.m_Min;
break;
case Direction.East:
startXPos = room.xPos + room.roomWidth;
startYPos = Random.Range(room.yPos, room.yPos + room.roomHeight - 1);
maxLength = board.GridCount.x - startXPos - board.RoomWidth.m_Min;
break;
case Direction.South:
startXPos = Random.Range (room.xPos, room.xPos + room.roomWidth);
startYPos = room.yPos;
maxLength = startYPos - board.RoomHeight.m_Min;
break;
case Direction.West:
startXPos = room.xPos;
startYPos = Random.Range (room.yPos, room.yPos + room.roomHeight);
maxLength = startXPos - board.RoomWidth.m_Min;
break;
}
// We clamp the length of the corridor to make sure it doesn't go off the board.
corridorLength = Mathf.Clamp (corridorLength, 1, maxLength);
return new Corridor
{
corridorLength = corridorLength,
direction = direction,
startXPos = startXPos,
startYPos = startYPos
};
}
}
public struct Room
{
public int xPos; // The x coordinate of the lower left tile of the room.
public int yPos; // The y coordinate of the lower left tile of the room.
public int roomWidth; // How many tiles wide the room is.
public int roomHeight; // How many tiles high the room is.
public Direction enteringCorridor; // The direction of the corridor that is entering this room.
// This is used for the first room. It does not have a Corridor parameter since there are no corridors yet.
public static Room Setup(Board board)
{
// Set a random width and height.
var roomWidth = board.RoomWidth.Random;
var roomHeight = board.RoomHeight.Random;
// Set the x and y coordinates so the room is roughly in the middle of the board.
var xPos = Mathf.RoundToInt(board.GridCount.x / 2f - roomWidth / 2f);
var yPos = Mathf.RoundToInt(board.GridCount.y / 2f - roomHeight / 2f);
return new Room
{
xPos = xPos,
yPos = yPos,
roomHeight = roomHeight,
roomWidth = roomWidth,
enteringCorridor = Direction.North
};
}
// This is an overload of the Setup function and has a corridor parameter that represents the corridor entering the room.
public static Room Setup(Board board, Corridor corridor)
{
// Set the entering corridor direction.
var enteringCorridor = corridor.direction;
// Set random values for width and height.
var roomWidth = board.RoomWidth.Random;
var roomHeight = board.RoomHeight.Random;
var xPos = 0;
var yPos = 0;
switch (corridor.direction)
{
// If the corridor entering this room is going north...
case Direction.North:
// ... the height of the room mustn't go beyond the board so it must be clamped based
// on the height of the board (rows) and the end of corridor that leads to the room.
roomHeight = Mathf.Clamp(roomHeight, 1, board.GridCount.y - corridor.EndPositionY);
// The y coordinate of the room must be at the end of the corridor (since the corridor leads to the bottom of the room).
yPos = corridor.EndPositionY;
// The x coordinate can be random but the left-most possibility is no further than the width
// and the right-most possibility is that the end of the corridor is at the position of the room.
xPos = Random.Range (corridor.EndPositionX - roomWidth + 1, corridor.EndPositionX);
// This must be clamped to ensure that the room doesn't go off the board.
xPos = Mathf.Clamp (xPos, 0, board.GridCount.x - roomWidth);
break;
case Direction.East:
roomWidth = Mathf.Clamp(roomWidth, 1, board.GridCount.x - corridor.EndPositionX);
xPos = corridor.EndPositionX;
yPos = Random.Range (corridor.EndPositionY - roomHeight + 1, corridor.EndPositionY);
yPos = Mathf.Clamp (yPos, 0, board.GridCount.y - roomHeight);
break;
case Direction.South:
roomHeight = Mathf.Clamp (roomHeight, 1, corridor.EndPositionY);
yPos = corridor.EndPositionY - roomHeight + 1;
xPos = Random.Range (corridor.EndPositionX - roomWidth + 1, corridor.EndPositionX);
xPos = Mathf.Clamp (xPos, 0, board.GridCount.x - roomWidth);
break;
case Direction.West:
roomWidth = Mathf.Clamp (roomWidth, 1, corridor.EndPositionX);
xPos = corridor.EndPositionX - roomWidth + 1;
yPos = Random.Range (corridor.EndPositionY - roomHeight + 1, corridor.EndPositionY);
yPos = Mathf.Clamp (yPos, 0, board.GridCount.y - roomHeight);
break;
}
return new Room
{
xPos = xPos,
yPos = yPos,
roomHeight = roomHeight,
roomWidth = roomWidth,
enteringCorridor = enteringCorridor
};
}
}
public class BoardSystem : ComponentSystem
{
// The type of tile that will be laid in a specific position.
public enum TileType
{
Wall, Floor,
}
struct BoardGroupData
{
public ComponentDataArray<Board> Boards;
public EntityArray Entities;
public int Length;
}
[Inject] private BoardGroupData BoardGroup;
private ComponentGroup OuterWallTileGroup;
private ComponentGroup FloorTileGroup;
private ComponentGroup WallTileGroup;
protected override void OnUpdate()
{
if (BoardGroup.Length == 0)
{
return;
}
// Copy data from ComponentGroups
var boards = new NativeArray<Board>(BoardGroup.Length, Allocator.Temp, NativeArrayOptions.UninitializedMemory);
var boardEntities = new NativeArray<Entity>(BoardGroup.Length, Allocator.Temp, NativeArrayOptions.UninitializedMemory);
for (int i = 0; i < BoardGroup.Length; i++)
{
boards[i] = BoardGroup.Boards[i];
boardEntities[i] = BoardGroup.Entities[i];
}
for (int i = 0; i < BoardGroup.Length; i++)
{
var board = boards[i];
var boardEntity = boardEntities[i];
var roomCount = board.NumRooms.Random;
if (roomCount < 1)
{
return;
}
var tiles = new NativeArray<TileType>(board.GridCount.x * board.GridCount.y, Allocator.Temp);
var rooms = new NativeArray<Room>(roomCount, Allocator.Temp);
var corridors = new NativeArray<Corridor>(roomCount - 1, Allocator.Temp);
CreateRoomsAndCorridors(board, rooms, corridors);
SetTilesValuesForRooms(rooms, tiles, board.GridCount.x);
SetTilesValuesForCorridors(corridors, tiles, board.GridCount.x);
InstantiateTiles(board, tiles, board.GridCount.x, boardEntity);
InstantiateOuterWalls(board, boardEntity);
EntityManager.RemoveComponent<Board>(boardEntity);
tiles.Dispose();
rooms.Dispose();
corridors.Dispose();
}
boards.Dispose();
boardEntities.Dispose();
}
protected override void OnCreateManager(int capacity)
{
OuterWallTileGroup = GetComponentGroup(
ComponentType.ReadOnly(typeof(BoardReference)),
ComponentType.ReadOnly(typeof(OuterWallTile)));
FloorTileGroup = GetComponentGroup(
ComponentType.ReadOnly(typeof(BoardReference)),
ComponentType.ReadOnly(typeof(FloorTile)));
WallTileGroup = GetComponentGroup(
ComponentType.ReadOnly(typeof(BoardReference)),
ComponentType.ReadOnly(typeof(WallTile)));
}
void InstantiateOuterWalls(Board board, Entity boardEntity)
{
// The outer walls are one unit left, right, up and down from the board.
float halfWidth = (board.GridStep.x * board.GridCount.x) * 0.5f;
float halfHeight = (board.GridStep.y * board.GridCount.y) * 0.5f;
float halfStepX = board.GridStep.x * 0.5f;
float halfStepY = board.GridStep.y * 0.5f;
float leftEdgeX = (-halfWidth) + halfStepX;
float rightEdgeX = halfWidth - halfStepX;
float bottomEdgeY = (-halfHeight) + halfStepY;
float topEdgeY = halfHeight - halfStepY;
// Shift outer wall outward one step
leftEdgeX -= board.GridStep.x;
rightEdgeX += board.GridStep.x;
topEdgeY += board.GridStep.y;
bottomEdgeY -= board.GridStep.y;
var boardReference = new BoardReference
{
TileSetId = board.TileSetId
};
OuterWallTileGroup.SetFilter(boardReference);
var outerWallTileGroupEntities = OuterWallTileGroup.GetEntityArray();
if (outerWallTileGroupEntities.Length > 0)
{
// copy data from ComponentGroup
var tileEntities = new NativeArray<Entity>(outerWallTileGroupEntities.Length,Allocator.Temp,NativeArrayOptions.UninitializedMemory);
for (int i = 0; i < outerWallTileGroupEntities.Length; i++)
{
tileEntities[i] = outerWallTileGroupEntities[i];
}
// Instantiate both vertical walls (one on each side).
InstantiateVerticalOuterWall(leftEdgeX, bottomEdgeY, topEdgeY, board.GridStep.y, tileEntities, boardEntity);
InstantiateVerticalOuterWall(rightEdgeX, bottomEdgeY, topEdgeY, board.GridStep.y, tileEntities, boardEntity);
// Instantiate both horizontal walls, these are one in left and right from the outer walls.
InstantiateHorizontalOuterWall(leftEdgeX + board.GridStep.x, rightEdgeX - board.GridStep.x, bottomEdgeY, board.GridStep.x, tileEntities, boardEntity);
InstantiateHorizontalOuterWall(leftEdgeX + board.GridStep.x, rightEdgeX - board.GridStep.x, topEdgeY, board.GridStep.x, tileEntities, boardEntity);
tileEntities.Dispose();
}
}
void InstantiateVerticalOuterWall (float xCoord, float startingY, float endingY, float gridStep, NativeArray<Entity> tileEntities, Entity boardEntity)
{
// Start the loop at the starting value for Y.
float currentY = startingY;
// While the value for Y is less than the end value...
while (currentY <= endingY)
{
// ... instantiate an outer wall tile at the x coordinate and the current y coordinate.
InstantiateFromArray(tileEntities, xCoord, currentY, boardEntity);
currentY += gridStep;
}
}
void InstantiateHorizontalOuterWall (float startingX, float endingX, float yCoord, float gridStep, NativeArray<Entity> tileEntities, Entity boardEntity)
{
// Start the loop at the starting value for X.
float currentX = startingX;
// While the value for X is less than the end value...
while (currentX <= endingX)
{
// ... instantiate an outer wall tile at the y coordinate and the current x coordinate.
InstantiateFromArray(tileEntities, currentX, yCoord, boardEntity);
currentX += gridStep;
}
}
void CreateRoomsAndCorridors(Board board, NativeArray<Room> rooms, NativeArray<Corridor> corridors)
{
// Setup the first room, there is no previous corridor so we do not use one.
rooms[0] = Room.Setup(board);
// Setup the first corridor using the first room.
corridors[0] = Corridor.Setup(rooms[0], board, true);
for (int i = 1; i < rooms.Length; i++)
{
// Create a room.
rooms[i] = new Room ();
// Setup the room based on the previous corridor.
rooms[i] = Room.Setup(board, corridors[i - 1]);
// If we haven't reached the end of the corridors array...
if (i < corridors.Length)
{
// ... create a corridor.
corridors[i] = new Corridor ();
// Setup the corridor based on the room that was just created.
corridors[i] = Corridor.Setup(rooms[i], board, false);
}
}
}
void SetTilesValuesForRooms(NativeArray<Room> rooms, NativeArray<TileType> tiles, int tilesStride)
{
// Go through all the rooms...
for (int i = 0; i < rooms.Length; i++)
{
Room currentRoom = rooms[i];
// ... and for each room go through it's width.
for (int j = 0; j < currentRoom.roomWidth; j++)
{
int xCoord = currentRoom.xPos + j;
// For each horizontal tile, go up vertically through the room's height.
for (int k = 0; k < currentRoom.roomHeight; k++)
{
int yCoord = currentRoom.yPos + k;
tiles[(yCoord * tilesStride) + xCoord] = TileType.Floor;
}
}
}
}
void SetTilesValuesForCorridors(NativeArray<Corridor> corridors, NativeArray<TileType> tiles, int tilesStride)
{
// Go through every corridor...
for (int i = 0; i < corridors.Length; i++)
{
var currentCorridor = corridors[i];
// and go through it's length.
for (int j = 0; j < currentCorridor.corridorLength; j++)
{
// Start the coordinates at the start of the corridor.
int xCoord = currentCorridor.startXPos;
int yCoord = currentCorridor.startYPos;
// Depending on the direction, add or subtract from the appropriate
// coordinate based on how far through the length the loop is.
switch (currentCorridor.direction)
{
case Direction.North:
yCoord += j;
break;
case Direction.East:
xCoord += j;
break;
case Direction.South:
yCoord -= j;
break;
case Direction.West:
xCoord -= j;
break;
}
tiles[(yCoord * tilesStride) + xCoord] = TileType.Floor;
}
}
}
void InstantiateTiles(Board board, NativeArray<TileType> tiles, int tilesStride, Entity parent)
{
// The outer walls are one unit left, right, up and down from the board.
float halfWidth = (board.GridStep.x * board.GridCount.x) * 0.5f;
float halfHeight = (board.GridStep.y * board.GridCount.y) * 0.5f;
float halfStepX = board.GridStep.x * 0.5f;
float halfStepY = board.GridStep.y * 0.5f;
float leftEdgeX = (-halfWidth) + halfStepX;
float topEdgeY = halfHeight - halfStepY;
var boardReference = new BoardReference
{
TileSetId = board.TileSetId
};
FloorTileGroup.SetFilter(boardReference);
var floorTileGroupEntities = FloorTileGroup.GetEntityArray();
WallTileGroup.SetFilter(boardReference);
var wallTileGroupEntities = WallTileGroup.GetEntityArray();
// copy data from ComponentGroup
var floorTileEntities = new NativeArray<Entity>(floorTileGroupEntities.Length,Allocator.Temp,NativeArrayOptions.UninitializedMemory);
for (int i = 0; i < floorTileGroupEntities.Length; i++)
{
floorTileEntities[i] = floorTileGroupEntities[i];
}
var wallTileEntities = new NativeArray<Entity>(wallTileGroupEntities.Length,Allocator.Temp,NativeArrayOptions.UninitializedMemory);
for (int i = 0; i < wallTileGroupEntities.Length; i++)
{
wallTileEntities[i] = wallTileGroupEntities[i];
}
// Go through all the tiles...
for (int i = 0; i < board.GridCount.y; i++)
{
for (int j = 0; j < board.GridCount.x; j++)
{
var x = leftEdgeX + (j * board.GridStep.x);
var y = topEdgeY + (-i * board.GridStep.y);
if ( tiles[(i* tilesStride) + j] == TileType.Floor )
{
// ... and instantiate a floor tile for it.
if (floorTileEntities.Length > 0)
{
InstantiateFromArray(floorTileEntities, x, y, parent);
}
}
else
{
if (wallTileEntities.Length > 0)
{
InstantiateFromArray(wallTileEntities, x, y, parent);
}
}
}
}
floorTileEntities.Dispose();
wallTileEntities.Dispose();
}
void InstantiateFromArray (NativeArray<Entity> prefabs, float xCoord, float yCoord, Entity parent)
{
// Create a random index for the array.
int randomIndex = Random.Range(0, prefabs.Length);
var entity = EntityManager.Instantiate(prefabs[randomIndex]);
var position = new LocalPosition
{
Value = new float3(xCoord, 0.0f, yCoord)
};
EntityManager.SetComponentData(entity, position);
var transformParent = new TransformParent
{
Value = parent
};
EntityManager.SetComponentData(entity, transformParent);
}
}
}

Просмотреть файл

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5b94ba9678244277b4450fa85b842f5e
timeCreated: 1522365831

Просмотреть файл

@ -0,0 +1,10 @@
using Unity.Entities;
namespace Samples.Dungeon.First
{
public struct FloorTile : IComponentData
{
}
public class FloorTileComponent : ComponentDataWrapper<FloorTile> { }
}

Просмотреть файл

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 45142627a853493f80a47adfe8fa4583
timeCreated: 1522432297

Просмотреть файл

@ -0,0 +1,10 @@
using Unity.Entities;
namespace Samples.Dungeon.First
{
public struct OuterWallTile : IComponentData
{
}
public class OuterWallTileComponent : ComponentDataWrapper<OuterWallTile> { }
}

Просмотреть файл

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: c7a38524da8d44c3a6cfe8c32f649930
timeCreated: 1522366397

Просмотреть файл

@ -0,0 +1,16 @@
{
"name": "Samples.Dungeon.First",
"references": [
"Unity.Entities",
"Unity.Entities.Hybrid",
"Unity.Transforms",
"Unity.Collections",
"Unity.Burst",
"Unity.Jobs",
"Unity.Mathematics",
"Samples.Common"
],
"optionalUnityReferences": [],
"includePlatforms": [],
"excludePlatforms": []
}

Просмотреть файл

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 939880c88597a419f8f9c1f228f8244f
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,10 @@
using Unity.Entities;
namespace Samples.Dungeon.First
{
public struct WallTile : IComponentData
{
}
public class WallTileComponent : ComponentDataWrapper<WallTile> { }
}

Просмотреть файл

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b6d9e8f5b4584200bdc7be3a847de9e6
timeCreated: 1522445632

Просмотреть файл

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 288aaf75433e74ed4b321181899ef0b1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,41 @@
using System;
using Unity.Entities;
using Unity.Mathematics;
namespace Samples.Dungeon
{
[Serializable]
public struct Board : IComponentData
{
public int TileSetId;
public float2 GridStep;
public int2 GridCount;
public IntRange NumRooms; // The range of the number of rooms there can be.
public IntRange RoomWidth; // The range of widths rooms can have.
public IntRange RoomHeight; // The range of heights rooms can have.
public IntRange CorridorLength; // The range of lengths corridors between rooms can have.
}
[Serializable]
public struct IntRange
{
public int m_Min; // The minimum value in this range.
public int m_Max; // The maximum value in this range.
// Constructor to set the values.
public IntRange(int min, int max)
{
m_Min = min;
m_Max = max;
}
// Get a random value from the range.
public int Random
{
get { return UnityEngine.Random.Range(m_Min, m_Max); }
}
}
public class BoardComponent : ComponentDataWrapper<Board> { }
}

Просмотреть файл

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9ce7cb465ac534940a9a94af80d4db89
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,13 @@
using System;
using Unity.Entities;
using UnityEngine;
namespace Samples.Dungeon
{
[Serializable]
public struct BoardReference : ISharedComponentData
{
public int TileSetId;
}
public class BoardReferenceComponent : SharedComponentDataWrapper<BoardReference> { }
}

Просмотреть файл

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e323df2d69f0d421ca5216d5f3a47ff1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,547 @@
using Unity.Collections;
using Unity.Entities;
using Unity.Mathematics;
using Unity.Transforms;
using UnityEngine;
// Sample based on: https://unity3d.com/learn/tutorials/topics/scripting/basic-2d-dungeon-generation
// This version represents iterations and improvements on Samples.Dungeon.First
namespace Samples.Dungeon
{
// Enum to specify the direction is heading.
public enum Direction
{
North, East, South, West
}
public struct Corridor
{
public int startXPos; // The x coordinate for the start of the corridor.
public int startYPos; // The y coordinate for the start of the corridor.
public int corridorLength; // How many units long the corridor is.
public Direction direction; // Which direction the corridor is heading from it's room.
// Get the end position of the corridor based on it's start position and which direction it's heading.
public int EndPositionX
{
get
{
if (direction == Direction.North || direction == Direction.South)
return startXPos;
if (direction == Direction.East)
return startXPos + corridorLength - 1;
return startXPos - corridorLength + 1;
}
}
public int EndPositionY
{
get
{
if (direction == Direction.East || direction == Direction.West)
return startYPos;
if (direction == Direction.North)
return startYPos + corridorLength - 1;
return startYPos - corridorLength + 1;
}
}
public static Corridor Setup(Room room, Board board, bool firstCorridor)
{
// Set a random direction (a random index from 0 to 3, cast to Direction).
var direction = (Direction)Random.Range(0, 4);
// Find the direction opposite to the one entering the room this corridor is leaving from.
// Cast the previous corridor's direction to an int between 0 and 3 and add 2 (a number between 2 and 5).
// Find the remainder when dividing by 4 (if 2 then 2, if 3 then 3, if 4 then 0, if 5 then 1).
// Overall effect is if the direction was South then that is 2, becomes 4, remainder is 0, which is north.
Direction oppositeDirection = (Direction)(((int)room.enteringCorridor + 2) % 4);
// If this is noth the first corridor and the randomly selected direction is opposite to the previous corridor's direction...
if (!firstCorridor && direction == oppositeDirection)
{
// Rotate the direction 90 degrees clockwise (North becomes East, East becomes South, etc).
// This is a more broken down version of the opposite direction operation above but instead of adding 2 we're adding 1.
// This means instead of rotating 180 (the opposite direction) we're rotating 90.
int directionInt = (int)direction;
directionInt++;
directionInt = directionInt % 4;
direction = (Direction)directionInt;
}
// Set a random length.
var corridorLength = board.CorridorLength.Random;
var startXPos = 0;
var startYPos = 0;
// Create a cap for how long the length can be (this will be changed based on the direction and position).
int maxLength = board.CorridorLength.m_Max;
switch (direction)
{
// If the choosen direction is North (up)...
case Direction.North:
// ... the starting position in the x axis can be random but within the width of the room.
startXPos = Random.Range (room.xPos, room.xPos + room.roomWidth - 1);
// The starting position in the y axis must be the top of the room.
startYPos = room.yPos + room.roomHeight;
// The maximum length the corridor can be is the height of the board (rows) but from the top of the room (y pos + height).
maxLength = board.GridCount.y - startYPos - board.RoomHeight.m_Min;
break;
case Direction.East:
startXPos = room.xPos + room.roomWidth;
startYPos = Random.Range(room.yPos, room.yPos + room.roomHeight - 1);
maxLength = board.GridCount.x - startXPos - board.RoomWidth.m_Min;
break;
case Direction.South:
startXPos = Random.Range (room.xPos, room.xPos + room.roomWidth);
startYPos = room.yPos;
maxLength = startYPos - board.RoomHeight.m_Min;
break;
case Direction.West:
startXPos = room.xPos;
startYPos = Random.Range (room.yPos, room.yPos + room.roomHeight);
maxLength = startXPos - board.RoomWidth.m_Min;
break;
}
// We clamp the length of the corridor to make sure it doesn't go off the board.
corridorLength = Mathf.Clamp (corridorLength, 1, maxLength);
return new Corridor
{
corridorLength = corridorLength,
direction = direction,
startXPos = startXPos,
startYPos = startYPos
};
}
}
public struct Room
{
public int xPos; // The x coordinate of the lower left tile of the room.
public int yPos; // The y coordinate of the lower left tile of the room.
public int roomWidth; // How many tiles wide the room is.
public int roomHeight; // How many tiles high the room is.
public Direction enteringCorridor; // The direction of the corridor that is entering this room.
// This is used for the first room. It does not have a Corridor parameter since there are no corridors yet.
public static Room Setup(Board board)
{
// Set a random width and height.
var roomWidth = board.RoomWidth.Random;
var roomHeight = board.RoomHeight.Random;
// Set the x and y coordinates so the room is roughly in the middle of the board.
var xPos = Mathf.RoundToInt(board.GridCount.x / 2f - roomWidth / 2f);
var yPos = Mathf.RoundToInt(board.GridCount.y / 2f - roomHeight / 2f);
return new Room
{
xPos = xPos,
yPos = yPos,
roomHeight = roomHeight,
roomWidth = roomWidth,
enteringCorridor = Direction.North
};
}
// This is an overload of the Setup function and has a corridor parameter that represents the corridor entering the room.
public static Room Setup(Board board, Corridor corridor)
{
// Set the entering corridor direction.
var enteringCorridor = corridor.direction;
// Set random values for width and height.
var roomWidth = board.RoomWidth.Random;
var roomHeight = board.RoomHeight.Random;
var xPos = 0;
var yPos = 0;
switch (corridor.direction)
{
// If the corridor entering this room is going north...
case Direction.North:
// ... the height of the room mustn't go beyond the board so it must be clamped based
// on the height of the board (rows) and the end of corridor that leads to the room.
roomHeight = Mathf.Clamp(roomHeight, 1, board.GridCount.y - corridor.EndPositionY);
// The y coordinate of the room must be at the end of the corridor (since the corridor leads to the bottom of the room).
yPos = corridor.EndPositionY;
// The x coordinate can be random but the left-most possibility is no further than the width
// and the right-most possibility is that the end of the corridor is at the position of the room.
xPos = Random.Range (corridor.EndPositionX - roomWidth + 1, corridor.EndPositionX);
// This must be clamped to ensure that the room doesn't go off the board.
xPos = Mathf.Clamp (xPos, 0, board.GridCount.x - roomWidth);
break;
case Direction.East:
roomWidth = Mathf.Clamp(roomWidth, 1, board.GridCount.x - corridor.EndPositionX);
xPos = corridor.EndPositionX;
yPos = Random.Range (corridor.EndPositionY - roomHeight + 1, corridor.EndPositionY);
yPos = Mathf.Clamp (yPos, 0, board.GridCount.y - roomHeight);
break;
case Direction.South:
roomHeight = Mathf.Clamp (roomHeight, 1, corridor.EndPositionY);
yPos = corridor.EndPositionY - roomHeight + 1;
xPos = Random.Range (corridor.EndPositionX - roomWidth + 1, corridor.EndPositionX);
xPos = Mathf.Clamp (xPos, 0, board.GridCount.x - roomWidth);
break;
case Direction.West:
roomWidth = Mathf.Clamp (roomWidth, 1, corridor.EndPositionX);
xPos = corridor.EndPositionX - roomWidth + 1;
yPos = Random.Range (corridor.EndPositionY - roomHeight + 1, corridor.EndPositionY);
yPos = Mathf.Clamp (yPos, 0, board.GridCount.y - roomHeight);
break;
}
return new Room
{
xPos = xPos,
yPos = yPos,
roomHeight = roomHeight,
roomWidth = roomWidth,
enteringCorridor = enteringCorridor
};
}
}
public class BoardSystem : ComponentSystem
{
// The type of tile that will be laid in a specific position.
public enum TileType
{
Wall, Floor,
}
struct BoardGroupData
{
public ComponentDataArray<Board> Boards;
public ComponentDataArray<Position> Positions;
public EntityArray Entities;
public int Length;
}
[Inject] private BoardGroupData BoardGroup;
private ComponentGroup OuterWallTileGroup;
private ComponentGroup FloorTileGroup;
private ComponentGroup WallTileGroup;
protected override void OnUpdate()
{
if (BoardGroup.Length == 0)
{
return;
}
// Copy data from ComponentGroups
var boards = new NativeArray<Board>(BoardGroup.Length, Allocator.Temp, NativeArrayOptions.UninitializedMemory);
var boardPositions = new NativeArray<Position>(BoardGroup.Length, Allocator.Temp, NativeArrayOptions.UninitializedMemory);
var boardEntities = new NativeArray<Entity>(BoardGroup.Length, Allocator.Temp, NativeArrayOptions.UninitializedMemory);
for (int i = 0; i < BoardGroup.Length; i++)
{
boards[i] = BoardGroup.Boards[i];
boardPositions[i] = BoardGroup.Positions[i];
boardEntities[i] = BoardGroup.Entities[i];
}
for (int i = 0; i < BoardGroup.Length; i++)
{
var board = boards[i];
var boardPosition = boardPositions[i];
var boardEntity = boardEntities[i];
var roomCount = board.NumRooms.Random;
if (roomCount < 1)
{
return;
}
var tiles = new NativeArray<TileType>(board.GridCount.x * board.GridCount.y, Allocator.Temp);
var rooms = new NativeArray<Room>(roomCount, Allocator.Temp);
var corridors = new NativeArray<Corridor>(roomCount - 1, Allocator.Temp);
CreateRoomsAndCorridors(board, rooms, corridors);
SetTilesValuesForRooms(rooms, tiles, board.GridCount.x);
SetTilesValuesForCorridors(corridors, tiles, board.GridCount.x);
InstantiateTiles(board, tiles, board.GridCount.x, boardPosition);
InstantiateOuterWalls(board, boardPosition);
EntityManager.RemoveComponent<Board>(boardEntity);
tiles.Dispose();
rooms.Dispose();
corridors.Dispose();
}
boards.Dispose();
boardPositions.Dispose();
boardEntities.Dispose();
}
protected override void OnCreateManager(int capacity)
{
OuterWallTileGroup = GetComponentGroup(
ComponentType.ReadOnly(typeof(BoardReference)),
ComponentType.ReadOnly(typeof(OuterWallTile)));
FloorTileGroup = GetComponentGroup(
ComponentType.ReadOnly(typeof(BoardReference)),
ComponentType.ReadOnly(typeof(FloorTile)));
WallTileGroup = GetComponentGroup(
ComponentType.ReadOnly(typeof(BoardReference)),
ComponentType.ReadOnly(typeof(WallTile)));
}
void InstantiateOuterWalls(Board board, Position boardPosition)
{
// The outer walls are one unit left, right, up and down from the board.
float halfWidth = (board.GridStep.x * board.GridCount.x) * 0.5f;
float halfHeight = (board.GridStep.y * board.GridCount.y) * 0.5f;
float halfStepX = board.GridStep.x * 0.5f;
float halfStepY = board.GridStep.y * 0.5f;
float leftEdgeX = (-halfWidth) + halfStepX;
float rightEdgeX = halfWidth - halfStepX;
float bottomEdgeY = (-halfHeight) + halfStepY;
float topEdgeY = halfHeight - halfStepY;
// Shift outer wall outward one step
leftEdgeX -= board.GridStep.x;
rightEdgeX += board.GridStep.x;
topEdgeY += board.GridStep.y;
bottomEdgeY -= board.GridStep.y;
var boardReference = new BoardReference
{
TileSetId = board.TileSetId
};
OuterWallTileGroup.SetFilter(boardReference);
var outerWallTileGroupEntities = OuterWallTileGroup.GetEntityArray();
if (outerWallTileGroupEntities.Length > 0)
{
// copy data from ComponentGroup
var tileEntities = new NativeArray<Entity>(outerWallTileGroupEntities.Length,Allocator.Temp,NativeArrayOptions.UninitializedMemory);
for (int i = 0; i < outerWallTileGroupEntities.Length; i++)
{
tileEntities[i] = outerWallTileGroupEntities[i];
}
// Instantiate both vertical walls (one on each side).
InstantiateVerticalOuterWall(leftEdgeX, bottomEdgeY, topEdgeY, board.GridStep.y, tileEntities, boardPosition);
InstantiateVerticalOuterWall(rightEdgeX, bottomEdgeY, topEdgeY, board.GridStep.y, tileEntities, boardPosition);
// Instantiate both horizontal walls, these are one in left and right from the outer walls.
InstantiateHorizontalOuterWall(leftEdgeX + board.GridStep.x, rightEdgeX - board.GridStep.x, bottomEdgeY, board.GridStep.x, tileEntities, boardPosition);
InstantiateHorizontalOuterWall(leftEdgeX + board.GridStep.x, rightEdgeX - board.GridStep.x, topEdgeY, board.GridStep.x, tileEntities, boardPosition);
tileEntities.Dispose();
}
}
void InstantiateVerticalOuterWall (float xCoord, float startingY, float endingY, float gridStep, NativeArray<Entity> tileEntities, Position boardPosition)
{
// Start the loop at the starting value for Y.
float currentY = startingY;
// While the value for Y is less than the end value...
while (currentY <= endingY)
{
// ... instantiate an outer wall tile at the x coordinate and the current y coordinate.
InstantiateFromArray(tileEntities, xCoord, currentY, boardPosition);
currentY += gridStep;
}
}
void InstantiateHorizontalOuterWall (float startingX, float endingX, float yCoord, float gridStep, NativeArray<Entity> tileEntities, Position boardPosition)
{
// Start the loop at the starting value for X.
float currentX = startingX;
// While the value for X is less than the end value...
while (currentX <= endingX)
{
// ... instantiate an outer wall tile at the y coordinate and the current x coordinate.
InstantiateFromArray(tileEntities, currentX, yCoord, boardPosition);
currentX += gridStep;
}
}
void CreateRoomsAndCorridors(Board board, NativeArray<Room> rooms, NativeArray<Corridor> corridors)
{
// Setup the first room, there is no previous corridor so we do not use one.
rooms[0] = Room.Setup(board);
// Setup the first corridor using the first room.
corridors[0] = Corridor.Setup(rooms[0], board, true);
for (int i = 1; i < rooms.Length; i++)
{
// Create a room.
rooms[i] = new Room ();
// Setup the room based on the previous corridor.
rooms[i] = Room.Setup(board, corridors[i - 1]);
// If we haven't reached the end of the corridors array...
if (i < corridors.Length)
{
// ... create a corridor.
corridors[i] = new Corridor ();
// Setup the corridor based on the room that was just created.
corridors[i] = Corridor.Setup(rooms[i], board, false);
}
}
}
void SetTilesValuesForRooms(NativeArray<Room> rooms, NativeArray<TileType> tiles, int tilesStride)
{
// Go through all the rooms...
for (int i = 0; i < rooms.Length; i++)
{
Room currentRoom = rooms[i];
// ... and for each room go through it's width.
for (int j = 0; j < currentRoom.roomWidth; j++)
{
int xCoord = currentRoom.xPos + j;
// For each horizontal tile, go up vertically through the room's height.
for (int k = 0; k < currentRoom.roomHeight; k++)
{
int yCoord = currentRoom.yPos + k;
tiles[(yCoord * tilesStride) + xCoord] = TileType.Floor;
}
}
}
}
void SetTilesValuesForCorridors(NativeArray<Corridor> corridors, NativeArray<TileType> tiles, int tilesStride)
{
// Go through every corridor...
for (int i = 0; i < corridors.Length; i++)
{
var currentCorridor = corridors[i];
// and go through it's length.
for (int j = 0; j < currentCorridor.corridorLength; j++)
{
// Start the coordinates at the start of the corridor.
int xCoord = currentCorridor.startXPos;
int yCoord = currentCorridor.startYPos;
// Depending on the direction, add or subtract from the appropriate
// coordinate based on how far through the length the loop is.
switch (currentCorridor.direction)
{
case Direction.North:
yCoord += j;
break;
case Direction.East:
xCoord += j;
break;
case Direction.South:
yCoord -= j;
break;
case Direction.West:
xCoord -= j;
break;
}
tiles[(yCoord * tilesStride) + xCoord] = TileType.Floor;
}
}
}
void InstantiateTiles(Board board, NativeArray<TileType> tiles, int tilesStride, Position parent)
{
// The outer walls are one unit left, right, up and down from the board.
float halfWidth = (board.GridStep.x * board.GridCount.x) * 0.5f;
float halfHeight = (board.GridStep.y * board.GridCount.y) * 0.5f;
float halfStepX = board.GridStep.x * 0.5f;
float halfStepY = board.GridStep.y * 0.5f;
float leftEdgeX = (-halfWidth) + halfStepX;
float topEdgeY = halfHeight - halfStepY;
var boardReference = new BoardReference
{
TileSetId = board.TileSetId
};
FloorTileGroup.SetFilter(boardReference);
var floorTileGroupEntities = FloorTileGroup.GetEntityArray();
WallTileGroup.SetFilter(boardReference);
var wallTileGroupEntities = WallTileGroup.GetEntityArray();
// copy data from ComponentGroup
var floorTileEntities = new NativeArray<Entity>(floorTileGroupEntities.Length,Allocator.Temp,NativeArrayOptions.UninitializedMemory);
for (int i = 0; i < floorTileGroupEntities.Length; i++)
{
floorTileEntities[i] = floorTileGroupEntities[i];
}
var wallTileEntities = new NativeArray<Entity>(wallTileGroupEntities.Length,Allocator.Temp,NativeArrayOptions.UninitializedMemory);
for (int i = 0; i < wallTileGroupEntities.Length; i++)
{
wallTileEntities[i] = wallTileGroupEntities[i];
}
// Go through all the tiles...
for (int i = 0; i < board.GridCount.y; i++)
{
for (int j = 0; j < board.GridCount.x; j++)
{
var x = leftEdgeX + (j * board.GridStep.x);
var y = topEdgeY + (-i * board.GridStep.y);
if ( tiles[(i* tilesStride) + j] == TileType.Floor )
{
// ... and instantiate a floor tile for it.
if (floorTileEntities.Length > 0)
{
InstantiateFromArray(floorTileEntities, x, y, parent);
}
}
else
{
if (wallTileEntities.Length > 0)
{
InstantiateFromArray(wallTileEntities, x, y, parent);
}
}
}
}
floorTileEntities.Dispose();
wallTileEntities.Dispose();
}
void InstantiateFromArray (NativeArray<Entity> prefabs, float xCoord, float yCoord, Position parentPosition)
{
// Create a random index for the array.
int randomIndex = Random.Range(0, prefabs.Length);
var entity = EntityManager.Instantiate(prefabs[randomIndex]);
var matrix = new TransformMatrix
{
Value = math.translate(parentPosition.Value + new float3(xCoord,0.0f,yCoord))
};
EntityManager.SetComponentData(entity, matrix);
}
}
}

Просмотреть файл

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 942b59a786c5f4f1ea8e82ec8fed11f3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,10 @@
using Unity.Entities;
namespace Samples.Dungeon
{
public struct FloorTile : IComponentData
{
}
public class FloorTileComponent : ComponentDataWrapper<FloorTile> { }
}

Просмотреть файл

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 666c2e70d14be4568a01d11cfad8ff39
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,10 @@
using Unity.Entities;
namespace Samples.Dungeon
{
public struct OuterWallTile : IComponentData
{
}
public class OuterWallTileComponent : ComponentDataWrapper<OuterWallTile> { }
}

Просмотреть файл

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 58920fca647314ffaae052626ba44a6a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,16 @@
{
"name": "Samples.Dungeon",
"references": [
"Unity.Entities",
"Unity.Entities.Hybrid",
"Unity.Transforms",
"Unity.Collections",
"Unity.Burst",
"Unity.Jobs",
"Unity.Mathematics",
"Samples.Common"
],
"optionalUnityReferences": [],
"includePlatforms": [],
"excludePlatforms": []
}

Просмотреть файл

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: ed8969bba710f494b8ee03eb62e84d86
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,10 @@
using Unity.Entities;
namespace Samples.Dungeon
{
public struct WallTile : IComponentData
{
}
public class WallTileComponent : ComponentDataWrapper<WallTile> { }
}

Просмотреть файл

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 05438df858f294b35b7ad80bec60bb84
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,66 @@
using System;
using Unity.Entities;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneSwitcher : MonoBehaviour
{
public float SceneSwitchInterval = 5.0f;
public float TimeUntilNextSwitch = 0.0f;
public int CurrentSceneIndex = 0;
// Use this for initialization
void Start ()
{
DontDestroyOnLoad(this);
LoadNextScene();
}
private void LoadNextScene()
{
var sceneCount = SceneManager.sceneCountInBuildSettings;
var nextIndex = CurrentSceneIndex + 1;
if (nextIndex >= sceneCount)
{
Quit();
return;
}
bool firstTime = CurrentSceneIndex == -1;
TimeUntilNextSwitch = SceneSwitchInterval;
CurrentSceneIndex = nextIndex;
if (!firstTime)
{
var entityManager = World.Active.GetExistingManager<EntityManager>();
var entities = entityManager.GetAllEntities();
entityManager.DestroyEntity(entities);
entities.Dispose();
}
SceneManager.LoadScene(nextIndex);
}
private void Quit()
{
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#else
Application.Quit();
#endif
}
// Update is called once per frame
void Update ()
{
TimeUntilNextSwitch -= Time.deltaTime;
if (TimeUntilNextSwitch > 0.0f)
return;
LoadNextScene();
}
}

Просмотреть файл

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5db787c63c8124a7291c505ceeb02ceb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,10 @@
{
"name": "NativeCounter",
"references": [],
"optionalUnityReferences": [
"TestAssemblies"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": true
}

Просмотреть файл

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: eb93af77c352540de993c7d549419953
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,76 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Floor1
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.24313724, g: 1, b: 0.24313724, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

Просмотреть файл

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: dac883fced751482f8e270bade47f891
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,76 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: OuterWall1
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _NORMALMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 2800000, guid: b1617f985cba47f4ab53ff3c92ca7c17, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: f91f345fa33028e48b31e64fc52a77f3, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 0, b: 0.034242153, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

Просмотреть файл

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e970940527c5c49748840ccc8b04a881
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,76 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: OuterWall2
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _NORMALMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 2800000, guid: b1617f985cba47f4ab53ff3c92ca7c17, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: f91f345fa33028e48b31e64fc52a77f3, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.9150943, g: 0.5222944, b: 0.5222944, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

Просмотреть файл

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e0cdd8e480b124de0903a08245f96788
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,76 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Wall1
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 1
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.20754719, g: 0, b: 0, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

Просмотреть файл

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ad42969049d004d679389f4afe451f4e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -21,13 +21,13 @@ GameObject:
- component: {fileID: 4069661776806122}
- component: {fileID: 114569172725802478}
- component: {fileID: 114080190520665040}
- component: {fileID: 114846138717908042}
- component: {fileID: 114268253541214898}
- component: {fileID: 114640073232692476}
- component: {fileID: 114878148870236606}
- component: {fileID: 114071165412582634}
- component: {fileID: 114846138717908042}
- component: {fileID: 114017445485928864}
- component: {fileID: 114800422694471510}
- component: {fileID: 114577371648038814}
- component: {fileID: 114151331784951154}
- component: {fileID: 114640073232692476}
m_Layer: 0
m_Name: TestBoidFish
m_TagString: Untagged
@ -48,22 +48,6 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &114017445485928864
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1501737747371270}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 206d9b88d9fd4c4c9e5a1a976224e421, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
Value:
x: 0
y: 0
z: 0
--- !u!114 &114071165412582634
MonoBehaviour:
m_ObjectHideFlags: 1
@ -91,7 +75,7 @@ MonoBehaviour:
material: {fileID: 2100000, guid: a775bbb190ee2594d99a10542e99e940, type: 2}
castShadows: 0
receiveShadows: 0
--- !u!114 &114151331784951154
--- !u!114 &114268253541214898
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
@ -99,15 +83,14 @@ MonoBehaviour:
m_GameObject: {fileID: 1501737747371270}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bff616740c8144f7b1e8ebad7fe8ed58, type: 3}
m_Script: {fileID: 11500000, guid: 206d9b88d9fd4c4c9e5a1a976224e421, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
cellRadius: 4
separationWeight: 2
alignmentWeight: 1
targetWeight: 2
obstacleAversionDistance: 20
Value:
x: 0
y: 0
z: 0
--- !u!114 &114569172725802478
MonoBehaviour:
m_ObjectHideFlags: 1
@ -141,6 +124,23 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 2caacf465eeae43f39a6a13e442d1dc0, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &114800422694471510
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1501737747371270}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bff616740c8144f7b1e8ebad7fe8ed58, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
cellRadius: 8
separationWeight: 1
alignmentWeight: 1
targetWeight: 2
obstacleAversionDistance: 20
--- !u!114 &114846138717908042
MonoBehaviour:
m_ObjectHideFlags: 1

Просмотреть файл

@ -0,0 +1,977 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.1802837, g: 0.22571404, b: 0.30692273, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 10
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 0
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringMode: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &278664722
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 278664723}
m_Layer: 0
m_Name: Floor Tiles
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &278664723
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 278664722}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 772595772}
m_Father: {fileID: 813316897}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &380269721
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 380269725}
- component: {fileID: 380269724}
- component: {fileID: 380269723}
- component: {fileID: 380269726}
- component: {fileID: 380269722}
m_Layer: 0
m_Name: Board
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &380269722
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 380269721}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ee3706cfe14c24cc1b04cf033fd969ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
TileSetId: 0
GridStep:
x: 1.1
y: 1.1
GridCount:
x: 256
y: 256
NumRooms:
m_Min: 256
m_Max: 512
RoomWidth:
m_Min: 4
m_Max: 16
RoomHeight:
m_Min: 4
m_Max: 16
CorridorLength:
m_Min: 8
m_Max: 64
--- !u!114 &380269723
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 380269721}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 168b0e3756704251859c57ee75912ca1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
Value:
x: 0
y: 0
z: 0
--- !u!114 &380269724
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 380269721}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5bf10cdea1344482e91a4f2b58506b77, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &380269725
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 380269721}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &380269726
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 380269721}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1d8133af023214ae993fc28d2fd97a1e, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &433578049
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 433578051}
- component: {fileID: 433578050}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &433578050
Light:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 433578049}
m_Enabled: 1
serializedVersion: 8
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 4
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &433578051
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 433578049}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &487275118
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 487275119}
m_Layer: 0
m_Name: Outer Wall Tiles
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &487275119
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 487275118}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1099344160}
- {fileID: 1855909181}
m_Father: {fileID: 813316897}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &772595764
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 772595772}
- component: {fileID: 772595771}
- component: {fileID: 772595770}
- component: {fileID: 772595769}
- component: {fileID: 772595768}
- component: {fileID: 772595767}
- component: {fileID: 772595766}
- component: {fileID: 772595765}
m_Layer: 0
m_Name: FloorTile1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &772595765
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 772595764}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 45142627a853493f80a47adfe8fa4583, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &772595766
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 772595764}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 58b5204db5154e999357d08c33a0cae6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
TileSetId: 0
--- !u!114 &772595767
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 772595764}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9b0fd4427893a4a16ba0c267dfd00217, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
material: {fileID: 2100000, guid: dac883fced751482f8e270bade47f891, type: 2}
castShadows: 0
receiveShadows: 0
--- !u!114 &772595768
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 772595764}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 18fdf4d20b7547b58faaa473d24d9206, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &772595769
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 772595764}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2caacf465eeae43f39a6a13e442d1dc0, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &772595770
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 772595764}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e13a4d4e64324cc4b24fbea71211b5e0, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
Value:
x: 0
y: 0
z: 0
--- !u!114 &772595771
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 772595764}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5bf10cdea1344482e91a4f2b58506b77, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &772595772
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 772595764}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 278664723}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &785288300
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 785288301}
m_Layer: 0
m_Name: Wall Tiles
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &785288301
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 785288300}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1806414666}
m_Father: {fileID: 813316897}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &813316896
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 813316897}
m_Layer: 0
m_Name: Tiles
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &813316897
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 813316896}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 785288301}
- {fileID: 278664723}
- {fileID: 487275119}
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1099344152
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1099344160}
- component: {fileID: 1099344159}
- component: {fileID: 1099344158}
- component: {fileID: 1099344157}
- component: {fileID: 1099344156}
- component: {fileID: 1099344155}
- component: {fileID: 1099344154}
- component: {fileID: 1099344153}
m_Layer: 0
m_Name: OuterWallTile1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1099344153
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1099344152}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c7a38524da8d44c3a6cfe8c32f649930, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1099344154
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1099344152}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 58b5204db5154e999357d08c33a0cae6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
TileSetId: 0
--- !u!114 &1099344155
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1099344152}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9b0fd4427893a4a16ba0c267dfd00217, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
material: {fileID: 2100000, guid: e970940527c5c49748840ccc8b04a881, type: 2}
castShadows: 0
receiveShadows: 0
--- !u!114 &1099344156
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1099344152}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 18fdf4d20b7547b58faaa473d24d9206, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1099344157
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1099344152}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2caacf465eeae43f39a6a13e442d1dc0, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1099344158
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1099344152}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e13a4d4e64324cc4b24fbea71211b5e0, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
Value:
x: 0
y: 0
z: 0
--- !u!114 &1099344159
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1099344152}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5bf10cdea1344482e91a4f2b58506b77, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &1099344160
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1099344152}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 487275119}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1676953281
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1676953285}
- component: {fileID: 1676953284}
- component: {fileID: 1676953283}
- component: {fileID: 1676953282}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &1676953282
AudioListener:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1676953281}
m_Enabled: 1
--- !u!124 &1676953283
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1676953281}
m_Enabled: 1
--- !u!20 &1676953284
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1676953281}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1676953285
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1676953281}
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 300, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!1 &1806414658
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1806414666}
- component: {fileID: 1806414665}
- component: {fileID: 1806414664}
- component: {fileID: 1806414663}
- component: {fileID: 1806414662}
- component: {fileID: 1806414661}
- component: {fileID: 1806414660}
- component: {fileID: 1806414659}
m_Layer: 0
m_Name: WallTile1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1806414659
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1806414658}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b6d9e8f5b4584200bdc7be3a847de9e6, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1806414660
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1806414658}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 58b5204db5154e999357d08c33a0cae6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
TileSetId: 0
--- !u!114 &1806414661
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1806414658}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9b0fd4427893a4a16ba0c267dfd00217, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
mesh: {fileID: 4300010, guid: 8682bfa138a5b4a01b641a8283caab41, type: 3}
material: {fileID: 2100000, guid: ad42969049d004d679389f4afe451f4e, type: 2}
castShadows: 0
receiveShadows: 0
--- !u!114 &1806414662
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1806414658}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 18fdf4d20b7547b58faaa473d24d9206, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1806414663
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1806414658}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2caacf465eeae43f39a6a13e442d1dc0, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1806414664
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1806414658}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e13a4d4e64324cc4b24fbea71211b5e0, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
Value:
x: 0
y: 0
z: 0
--- !u!114 &1806414665
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1806414658}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5bf10cdea1344482e91a4f2b58506b77, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &1806414666
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1806414658}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 785288301}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1855909180
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1855909181}
- component: {fileID: 1855909188}
- component: {fileID: 1855909187}
- component: {fileID: 1855909186}
- component: {fileID: 1855909185}
- component: {fileID: 1855909184}
- component: {fileID: 1855909183}
- component: {fileID: 1855909182}
m_Layer: 0
m_Name: OuterWallTile2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1855909181
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1855909180}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 487275119}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1855909182
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1855909180}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c7a38524da8d44c3a6cfe8c32f649930, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1855909183
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1855909180}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 58b5204db5154e999357d08c33a0cae6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
TileSetId: 0
--- !u!114 &1855909184
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1855909180}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9b0fd4427893a4a16ba0c267dfd00217, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
material: {fileID: 2100000, guid: e0cdd8e480b124de0903a08245f96788, type: 2}
castShadows: 0
receiveShadows: 0
--- !u!114 &1855909185
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1855909180}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 18fdf4d20b7547b58faaa473d24d9206, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1855909186
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1855909180}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2caacf465eeae43f39a6a13e442d1dc0, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1855909187
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1855909180}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e13a4d4e64324cc4b24fbea71211b5e0, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
Value:
x: 0
y: 0
z: 0
--- !u!114 &1855909188
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1855909180}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5bf10cdea1344482e91a4f2b58506b77, type: 3}
m_Name:
m_EditorClassIdentifier:

Просмотреть файл

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 184b12b2506854fbaa322b8f7e4c6f29
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,861 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.1802837, g: 0.22571404, b: 0.30692273, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 10
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 0
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringMode: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &278664722
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 278664723}
m_Layer: 0
m_Name: Floor Tiles
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &278664723
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 278664722}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 772595772}
m_Father: {fileID: 813316897}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &380269721
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 380269725}
- component: {fileID: 380269724}
- component: {fileID: 380269723}
- component: {fileID: 380269726}
- component: {fileID: 380269722}
m_Layer: 0
m_Name: Board
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &380269722
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 380269721}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9ce7cb465ac534940a9a94af80d4db89, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
TileSetId: 0
GridStep:
x: 1.1
y: 1.1
GridCount:
x: 256
y: 256
NumRooms:
m_Min: 256
m_Max: 512
RoomWidth:
m_Min: 4
m_Max: 16
RoomHeight:
m_Min: 4
m_Max: 16
CorridorLength:
m_Min: 8
m_Max: 64
--- !u!114 &380269723
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 380269721}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 168b0e3756704251859c57ee75912ca1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
Value:
x: 0
y: 0
z: 0
--- !u!114 &380269724
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 380269721}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5bf10cdea1344482e91a4f2b58506b77, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &380269725
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 380269721}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &380269726
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 380269721}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1d8133af023214ae993fc28d2fd97a1e, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &433578049
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 433578051}
- component: {fileID: 433578050}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &433578050
Light:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 433578049}
m_Enabled: 1
serializedVersion: 8
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 4
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &433578051
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 433578049}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &487275118
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 487275119}
m_Layer: 0
m_Name: Outer Wall Tiles
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &487275119
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 487275118}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1099344160}
- {fileID: 1855909181}
m_Father: {fileID: 813316897}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &772595764
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 772595772}
- component: {fileID: 772595771}
- component: {fileID: 772595769}
- component: {fileID: 772595767}
- component: {fileID: 772595766}
- component: {fileID: 772595765}
m_Layer: 0
m_Name: FloorTile1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &772595765
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 772595764}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e323df2d69f0d421ca5216d5f3a47ff1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
TileSetId: 0
--- !u!114 &772595766
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 772595764}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 666c2e70d14be4568a01d11cfad8ff39, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &772595767
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 772595764}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9b0fd4427893a4a16ba0c267dfd00217, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
material: {fileID: 2100000, guid: dac883fced751482f8e270bade47f891, type: 2}
castShadows: 0
receiveShadows: 0
--- !u!114 &772595769
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 772595764}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2caacf465eeae43f39a6a13e442d1dc0, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &772595771
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 772595764}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5bf10cdea1344482e91a4f2b58506b77, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &772595772
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 772595764}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 278664723}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &785288300
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 785288301}
m_Layer: 0
m_Name: Wall Tiles
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &785288301
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 785288300}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1806414666}
m_Father: {fileID: 813316897}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &813316896
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 813316897}
m_Layer: 0
m_Name: Tiles
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &813316897
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 813316896}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 785288301}
- {fileID: 278664723}
- {fileID: 487275119}
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1099344152
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1099344160}
- component: {fileID: 1099344159}
- component: {fileID: 1099344157}
- component: {fileID: 1099344155}
- component: {fileID: 1099344154}
- component: {fileID: 1099344153}
m_Layer: 0
m_Name: OuterWallTile1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1099344153
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1099344152}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e323df2d69f0d421ca5216d5f3a47ff1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
TileSetId: 0
--- !u!114 &1099344154
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1099344152}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 58920fca647314ffaae052626ba44a6a, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1099344155
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1099344152}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9b0fd4427893a4a16ba0c267dfd00217, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
material: {fileID: 2100000, guid: e970940527c5c49748840ccc8b04a881, type: 2}
castShadows: 0
receiveShadows: 0
--- !u!114 &1099344157
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1099344152}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2caacf465eeae43f39a6a13e442d1dc0, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1099344159
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1099344152}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5bf10cdea1344482e91a4f2b58506b77, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &1099344160
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1099344152}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 487275119}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1676953281
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1676953285}
- component: {fileID: 1676953284}
- component: {fileID: 1676953283}
- component: {fileID: 1676953282}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &1676953282
AudioListener:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1676953281}
m_Enabled: 1
--- !u!124 &1676953283
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1676953281}
m_Enabled: 1
--- !u!20 &1676953284
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1676953281}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1676953285
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1676953281}
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 300, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!1 &1806414658
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1806414666}
- component: {fileID: 1806414665}
- component: {fileID: 1806414663}
- component: {fileID: 1806414661}
- component: {fileID: 1806414659}
- component: {fileID: 1806414660}
m_Layer: 0
m_Name: WallTile1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1806414659
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1806414658}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 05438df858f294b35b7ad80bec60bb84, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1806414660
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1806414658}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e323df2d69f0d421ca5216d5f3a47ff1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
TileSetId: 0
--- !u!114 &1806414661
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1806414658}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9b0fd4427893a4a16ba0c267dfd00217, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
mesh: {fileID: 4300010, guid: 8682bfa138a5b4a01b641a8283caab41, type: 3}
material: {fileID: 2100000, guid: ad42969049d004d679389f4afe451f4e, type: 2}
castShadows: 0
receiveShadows: 0
--- !u!114 &1806414663
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1806414658}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2caacf465eeae43f39a6a13e442d1dc0, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1806414665
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1806414658}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5bf10cdea1344482e91a4f2b58506b77, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &1806414666
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1806414658}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 785288301}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1855909180
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1855909181}
- component: {fileID: 1855909188}
- component: {fileID: 1855909186}
- component: {fileID: 1855909184}
- component: {fileID: 1855909183}
- component: {fileID: 1855909182}
m_Layer: 0
m_Name: OuterWallTile2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1855909181
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1855909180}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 487275119}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1855909182
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1855909180}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e323df2d69f0d421ca5216d5f3a47ff1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
TileSetId: 0
--- !u!114 &1855909183
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1855909180}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 58920fca647314ffaae052626ba44a6a, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1855909184
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1855909180}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9b0fd4427893a4a16ba0c267dfd00217, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SerializedData:
mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
material: {fileID: 2100000, guid: e0cdd8e480b124de0903a08245f96788, type: 2}
castShadows: 0
receiveShadows: 0
--- !u!114 &1855909186
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1855909180}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2caacf465eeae43f39a6a13e442d1dc0, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1855909188
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1855909180}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5bf10cdea1344482e91a4f2b58506b77, type: 3}
m_Name:
m_EditorClassIdentifier:

Просмотреть файл

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4f472d749bf1049d7a4e5fc31b5dc774
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,158 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.1273173, g: 0.13414751, b: 0.121078596, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 10
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringMode: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &1841332243
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1841332245}
- component: {fileID: 1841332244}
m_Layer: 0
m_Name: SceneSwitcher
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1841332244
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1841332243}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5db787c63c8124a7291c505ceeb02ceb, type: 3}
m_Name:
m_EditorClassIdentifier:
SceneSwitchInterval: 60
TimeUntilNextSwitch: 5
CurrentSceneIndex: 0
--- !u!4 &1841332245
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1841332243}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 48.69622, y: 34.48973, z: 85.32182}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

Просмотреть файл

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3810f2b08cf9c404faaa029c7dfaf39e
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -7,10 +7,12 @@ namespace Unity.Jobs.Tests
public struct AliasTest1 : IJob
{
private int field1;
#pragma warning disable 0169 // "never used" warning
private int pad0;
private int pad1;
private int pad2;
private int pad3;
#pragma warning restore 0169
private int field2;
public void DoTheThing(ref int x)

3
Samples/Assets/link.xml Normal file
Просмотреть файл

@ -0,0 +1,3 @@
<linker>
<assembly fullname="Unity.Entities" preserve="all"/>
</linker>

Просмотреть файл

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e1ffe033fad4844c4ae6ab134d1d8344
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -1,11 +1,12 @@
{
"dependencies": {
"com.unity.entities":"0.0.11"
"com.unity.incrementalcompiler": "0.0.38",
"com.unity.entities": "0.0.2-preview.1"
},
"registry": "https://staging-packages.unity.com",
"testables": [
"com.unity.collections",
"com.unity.entities",
"com.unity.jobs"
],
"registry": "https://staging-packages.unity.com"
]
}

Просмотреть файл

@ -6,6 +6,24 @@ EditorBuildSettings:
serializedVersion: 2
m_Scenes:
- enabled: 1
path: Assets/BoidExample.unity
path: Assets/Scenes/SceneSwitcher.unity
guid: 3810f2b08cf9c404faaa029c7dfaf39e
- enabled: 1
path: Assets/Scenes/BoidExample.unity
guid: d5f3505c0b377452db53363d84547627
- enabled: 1
path: Assets/Scenes/ChainExample.unity
guid: f00b849dc42c8428a9f044fecb3d01d4
- enabled: 1
path: Assets/Scenes/DungeonFirstExample.unity
guid: 184b12b2506854fbaa322b8f7e4c6f29
- enabled: 1
path: Assets/Scenes/DungeonNextExample.unity
guid: 4f472d749bf1049d7a4e5fc31b5dc774
- enabled: 1
path: Assets/Scenes/HierarchyExample.unity
guid: e18528e293b6f4faf9fc1e8c97f28632
- enabled: 1
path: Assets/Scenes/RotationExample.unity
guid: 4037acc9779404f51bafb28065f1861f
m_configObjects: {}

Просмотреть файл

@ -550,7 +550,7 @@ PlayerSettings:
scriptingBackend: {}
il2cppCompilerConfiguration: {}
incrementalIl2cppBuild: {}
allowUnsafeCode: 1
allowUnsafeCode: 0
additionalIl2CppArgs:
scriptingRuntimeVersion: 1
apiCompatibilityLevelPerPlatform:

Просмотреть файл

@ -6,10 +6,12 @@ namespace TwoStickClassicExample
public class Enemy : MonoBehaviour
{
float Cooldown;
private void Update()
{
var player = FindObjectOfType<Player>();
var player = Player.Current;
if (!player)
{
Destroy(gameObject);
@ -30,13 +32,11 @@ namespace TwoStickClassicExample
// Shooting
var playerPos = player.GetComponent<Transform2D>().Position;
var state = GetComponent<EnemyShootState>();
Cooldown -= Time.deltaTime;
state.Cooldown -= Time.deltaTime;
if (state.Cooldown <= 0.0)
if (Cooldown <= 0.0)
{
state.Cooldown = TwoStickBootstrap.Settings.enemyShootRate;
Cooldown = TwoStickBootstrap.Settings.enemyShootRate;
var position = GetComponent<Transform2D>().Position;
ShotSpawnData spawn = new ShotSpawnData()

Просмотреть файл

@ -1,11 +0,0 @@
using UnityEngine;
namespace TwoStickClassicExample
{
public class EnemyShootState : MonoBehaviour
{
public float Cooldown;
}
}

Просмотреть файл

@ -1,9 +1,22 @@
using UnityEngine;
using System.Collections.Generic;
using UnityEngine;
namespace TwoStickClassicExample
{
public class Health : MonoBehaviour
{
public static ICollection<Health> All => allHealths;
private static readonly HashSet<Health> allHealths = new HashSet<Health>();
private void Awake()
{
allHealths.Add(this);
}
private void OnDestroy()
{
allHealths.Remove(this);
}
public float Value
{

Просмотреть файл

@ -6,12 +6,19 @@ namespace TwoStickClassicExample
public class Player : MonoBehaviour
{
public static Player Current { get; private set; }
[HideInInspector] public float2 Move;
[HideInInspector] public float2 Shoot;
[HideInInspector] public float FireCooldown;
public bool Fire => FireCooldown <= 0.0 && math.length(Shoot) > 0.5f;
private void Start()
{
Current = this;
}
private void Update()
{

Просмотреть файл

@ -18,8 +18,8 @@ namespace TwoStickClassicExample
// Collision
var settings = TwoStickBootstrap.Settings;
var receivers = FindObjectsOfType(typeof(Health));
if (receivers.Length == 0)
var receivers = Health.All;
if (receivers.Count == 0)
{
Destroy(gameObject);
return;
@ -27,26 +27,25 @@ namespace TwoStickClassicExample
var faction = GetComponent<Faction>().Value;
foreach (Health health in receivers)
foreach (var health in receivers)
{
var receiverFaction = health.GetComponent<Faction>().Value;
float collisionRadius = GetCollisionRadius(settings, receiverFaction);
float collisionRadiusSquared = collisionRadius * collisionRadius;
var collisionRadius = GetCollisionRadius(settings, receiverFaction);
var collisionRadiusSquared = collisionRadius * collisionRadius;
var xform = health.GetComponent<Transform2D>();
float2 receiverPos = xform.Position;
var receiverPos = xform.Position;
if (faction != receiverFaction)
{
float2 shotPos = transform2D.Position;
float2 delta = shotPos - receiverPos;
float distSquared = math.dot(delta, delta);
var shotPos = transform2D.Position;
var delta = shotPos - receiverPos;
var distSquared = math.dot(delta, delta);
if (distSquared <= collisionRadiusSquared)
{
health.Value = health.Value - Energy;
// Set the shot's time to live to zero, so it will be collected by the shot destroy system
Destroy(gameObject);
break;
}

Просмотреть файл

@ -3,16 +3,15 @@ using UnityEngine;
namespace TwoStickClassicExample
{
public sealed class TwoStickBootstrap
public sealed class TwoStickBootstrap : MonoBehaviour
{
public static TwoStickExampleSettings Settings;
public static TwoStickExampleSettings Settings { get; private set; }
[SerializeField] private TwoStickExampleSettings settings;
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
public static void InitializeWithScene()
public void Awake()
{
var settingsGO = GameObject.Find("Settings");
Settings = settingsGO?.GetComponent<TwoStickExampleSettings>();
Settings = settings;
}
public static void NewGame()

Просмотреть файл

@ -17,10 +17,9 @@ namespace TwoStickClassicExample
private void Update()
{
var player = FindObjectOfType<Player>();
if (player != null)
if (Player.Current != null)
{
UpdateAlive(player);
UpdateAlive(Player.Current);
}
else
{
@ -29,34 +28,21 @@ namespace TwoStickClassicExample
}
private void UpdateDead()
{
if (HealthText != null)
{
HealthText.gameObject.SetActive(false);
}
if (NewGameButton != null)
{
NewGameButton.gameObject.SetActive(true);
}
}
private void UpdateAlive(Player player)
{
HealthText.gameObject.SetActive(true);
NewGameButton.gameObject.SetActive(false);
var displayedHealth = 0;
if (player != null)
{
displayedHealth = (int) player.GetComponent<Health>().Value;
}
var displayedHealth = (int) player.GetComponent<Health>().Value;
if (m_CachedHealth != displayedHealth)
{
if (displayedHealth > 0)
HealthText.text = $"HEALTH: {displayedHealth}";
else
HealthText.text = "GAME OVER";
HealthText.text = displayedHealth > 0 ? $"HEALTH: {displayedHealth}" : "GAME OVER";
m_CachedHealth = displayedHealth;
}
}

Просмотреть файл

@ -24,7 +24,6 @@ GameObject:
- component: {fileID: 114330160031471208}
- component: {fileID: 114284485740017452}
- component: {fileID: 114662734451023206}
- component: {fileID: 114202085428084756}
- component: {fileID: 114372508922480548}
- component: {fileID: 114590379831907396}
m_Layer: 0
@ -89,18 +88,6 @@ MeshFilter:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1664275865403276}
m_Mesh: {fileID: 4300004, guid: 9ddab293e2a8af3499dac05f5fd6169c, type: 3}
--- !u!114 &114202085428084756
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1664275865403276}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a989a63e85d104df4bd413ced2e4dc1b, type: 3}
m_Name:
m_EditorClassIdentifier:
Cooldown: 0
--- !u!114 &114284485740017452
MonoBehaviour:
m_ObjectHideFlags: 1

Просмотреть файл

@ -256,6 +256,47 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!1 &363597222
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 363597224}
- component: {fileID: 363597223}
m_Layer: 0
m_Name: Bootstrap
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &363597223
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 363597222}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 26c0806b904fc4c1bb5c460e0d8b9771, type: 3}
m_Name:
m_EditorClassIdentifier:
settings: {fileID: 307864027}
--- !u!4 &363597224
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 363597222}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &441858732
GameObject:
m_ObjectHideFlags: 0

Просмотреть файл

@ -1,11 +1,12 @@
{
"dependencies": {
"com.unity.entities":"0.0.11"
"com.unity.incrementalcompiler": "0.0.38",
"com.unity.entities": "0.0.2-preview.1"
},
"registry": "https://staging-packages.unity.com",
"testables": [
"com.unity.collections",
"com.unity.entities",
"com.unity.jobs"
],
"registry": "https://staging-packages.unity.com"
]
}

Просмотреть файл

@ -0,0 +1,3 @@
<linker>
<assembly fullname="Unity.Transforms2D" preserve="all"/>
</linker>

Просмотреть файл

@ -1,11 +1,12 @@
{
"dependencies": {
"com.unity.entities":"0.0.11"
"com.unity.incrementalcompiler": "0.0.38",
"com.unity.entities": "0.0.2-preview.1"
},
"registry": "https://staging-packages.unity.com",
"testables": [
"com.unity.collections",
"com.unity.entities",
"com.unity.jobs"
],
"registry": "https://staging-packages.unity.com"
]
}

Просмотреть файл

@ -1,11 +1,12 @@
{
"dependencies": {
"com.unity.entities":"0.0.11"
"com.unity.incrementalcompiler": "0.0.38",
"com.unity.entities": "0.0.2-preview.1"
},
"registry": "https://staging-packages.unity.com",
"testables": [
"com.unity.collections",
"com.unity.entities",
"com.unity.jobs"
],
"registry": "https://staging-packages.unity.com"
]
}