diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..62e27da2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,27 @@ +language: csharp +dotnet: 2.0.0 +mono: none +script: +# build + - cd ./src + - dotnet restore + - dotnet build -c TravisCI +# test + - cd ../tests + - dotnet test +# docker build + - cd ../src/MineCase.Gateway + - dotnet publish -c TravisCI -o obj/Docker/publish + - docker build -t minecase.gateway . + - cd ../MineCase.Server + - dotnet publish -c TravisCI -o obj/Docker/publish + - docker build -t minecase.server . +# docker push + - docker tag minecase.gateway sunnycase/minecase.gateway:ci-latest + - docker tag minecase.server sunnycase/minecase.server:ci-latest + - > + if [ "$TRAVIS_BRANCH" == "master" ]; then + docker login -u="$DOCKER_USER" -p="$DOCKER_PASS" + docker push sunnycase/minecase.gateway + docker push sunnycase/minecase.server + fi diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..80ce6195 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 MineCase + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Readme-zh.md b/Readme-zh.md new file mode 100644 index 00000000..9abb6046 --- /dev/null +++ b/Readme-zh.md @@ -0,0 +1,60 @@ +# MineCase [![Build Status](https://travis-ci.org/dotnetGame/MineCase.svg?branch=master)](https://travis-ci.org/dotnetGame/MineCase) [![Build status](https://ci.appveyor.com/api/projects/status/w9h243k1lqee2ke5/branch/master?svg=true)](https://ci.appveyor.com/project/sunnycase/minecase/branch/master) + +![Screenshots](screenshots/1.jpg) + +[English](https://github.com/dotnetGame/MineCase/blob/master/Readme.md) | [中文文档](https://github.com/dotnetGame/MineCase/blob/master/Readme-zh.md) + +## 介绍 + +`MineCase` 是使用 `.NET Core` 开发的一个跨平台、分布式的 `Minecraft` 服务端应用,使用了 `Orleans` 框架。
+ +目前仅支持 `Minecraft` [1.12](https://minecraft.net/en-us/article/minecraft-112-pre-release-6) 的版本。 + +## 安装 + +### 从 docker 中运行(仅支持 Linux 环境) + +#### 安装 docker + +可以根据 [这个指南](https://yeasy.gitbooks.io/docker_practice/content/install/) 来安装好 docker。 + +#### 从 docker 中运行应用 + +```bash +curl -o docker-compose.yml https://raw.githubusercontent.com/dotnetGame/MineCase/master/build/docker/linux/docker-compose.yml +docker-compose up +``` +你可以使用 `docker-compose stop` 来终止应用。 + +### 构建源码运行 + +#### 前置要求 + +你需要先安装 `.NET Core` sdk2.0,可以在 [这里](https://www.microsoft.com/net/download) 找到你需要的版本。 + +#### 获取源码 + +```bash +git clone git@github.com:dotnetGame/MineCase.git +cd MineCase +``` +或者 [下载ZIP](https://github.com/dotnetGame/MineCase/archive/master.zip) 并进入 `MineCase` 目录。 + +#### 构建并运行 + +* Windows + +双击 `build_and_run.bat`。 + +* Linux 和 Mac + +运行 `build_and_run.sh`。 + +## 贡献 + +本项目仍在开发阶段,我们非常欢迎并感谢你为这个项目来做贡献。 + +如果你是开发者,我们欢迎你 Fork 这个项目并提交你的修改,有什么问题我们可以在 [Issues](https://github.com/dotnetGame/MineCase/issues) 中一起讨论。 + +如果你是用户,在使用这个服务器的过程中遇到的任何问题,或者有什么好的建议,都可以在 [Issues](https://github.com/dotnetGame/MineCase/issues) 中向我们提出。 + diff --git a/Readme.md b/Readme.md index be38335c..ad2d5cf1 100644 --- a/Readme.md +++ b/Readme.md @@ -1,104 +1,59 @@ -MineCase -[![Build status](https://ci.appveyor.com/api/projects/status/w9h243k1lqee2ke5/branch/master?svg=true)](https://ci.appveyor.com/project/sunnycase/minecase/branch/master) -=== +# MineCase [![Build Status](https://travis-ci.org/dotnetGame/MineCase.svg?branch=master)](https://travis-ci.org/dotnetGame/MineCase) [![Build status](https://ci.appveyor.com/api/projects/status/w9h243k1lqee2ke5/branch/master?svg=true)](https://ci.appveyor.com/project/sunnycase/minecase/branch/master) -![Screenshots](screenshots/mc5.png) +![Screenshots](screenshots/1.jpg) -## 介绍 -`MineCase` 是一个分布式的 `minecraft` 服务端应用。`MineCase` 采用 `.net core` 编写,使用 `Orleans` 框架。
-`MineCase` 具有以下特性: +[English](https://github.com/dotnetGame/MineCase/blob/master/Readme.md) | [中文文档](https://github.com/dotnetGame/MineCase/blob/master/Readme-zh.md) -* 跨平台 -* 分布式 - -## 要求 -运行这个服务器之前,请保证你的环境满足: +## Introduction -* `.net core` sdk 2.0 +`MineCase` is a cross-platform, distributed `Minecraft` server application developed using `.NET Core` that uses the `Orleans` framework. -目前支持的 `minecraft` 版本: +We currently support [Release 1.12](https://minecraft.net/en-us/article/minecraft-112-pre-release-6) Minecraft protocol versions. -* 1.12 +## Setup -## 开始 +### From docker(Only support Linux) ->注:本项目还在施工阶段,还没有完成所有的功能。 +#### Install docker -1. 获取源码 -```bash -git clone git@github.com:dotnetGame/MineCase.git -``` -或者 [下载ZIP](https://github.com/dotnetGame/MineCase/archive/master.zip)。 +You can install docker according to [this guide](https://docs.docker.com/engine/installation/). -2. 构建并运行 +#### Run the application -进入 `MineCase` 目录下,运行 `run_server.bat`,看到下面这一行提示的时候: -``` -Press Ctrl+C to terminate... +```bash +curl -o docker-compose.yml https://raw.githubusercontent.com/dotnetGame/MineCase/master/build/docker/linux/docker-compose.yml +docker-compose up ``` -再运行 `run_gateway.bat` 。 - -## 进度 - -| 模块 | 完成情况 | -|:---:|:---:| -|握手协议|:white_check_mark:| -|登陆游戏|:white_check_mark:| -|进入世界|:white_check_mark:| -|地图生成|:x:| -|怪物生成|:x:| -|AI|:x:| +You can use `docker-compose stop` to stop the application。 -## 反馈 +### From source -如果你在使用 `MineCase` 的过程中遇到任何问题,请在 [Issues](https://github.com/dotnetGame/MineCase/issues) 中提出。 +#### Pre-requirement -*** - -## Introduction -`MineCase` is a distributed `minecraft` server application. It is written in `.net core`, and using the `Orleans` framework.
-`MineCase` has the following features: +You need to install `.NET Core` sdk 2.0 first, you can find the version you need from [here](https://www.microsoft.com/net/download). -* cross-platform -* distributed +#### Get source -## Required -Before running this server, please make sure your environment meet: - -* `.net core` sdk 2.0 - -Currently supported version of `minecraft`: +```bash +git clone git@github.com:dotnetGame/MineCase.git +cd MineCase +``` +or [Download ZIP](https://github.com/dotnetGame/MineCase/archive/master.zip) and entry the `MineCase` directory. -* 1.12 +#### Build and run -## Getting Start +* Windows ->Note: This project is still in the construction phase, has not completed all the feature. +Double click the `build_and_run.bat`. -1. Get source -```bash -git clone git@github.com:dotnetGame/MineCase.git -``` -or [Download ZIP](https://github.com/dotnetGame/MineCase/archive/master.zip). +* Linux or Mac -2. Build and run +Run the `build_and_run.sh`. -Entry the `MineCase` directory, run `run_server.bat`, and when you see the following line: -``` -Press Ctrl+C to terminate... -``` -run `run_gateway.bat` . +## Contributing -## Schedule +This project is still under development. We welcome and thank you for your contribution to this project. -|Module|Finished| -|:----:|:----:| -|handshake|:white_check_mark:| -|log in|:white_check_mark:| -|entry the world|:white_check_mark:| -|map generation|:x:| -|monster generation|:x:| -|AI|:x:| +If you are a developer, we welcome you to fork this project and submit a `Pull Request` with your changes, and if you have any questions we can discuss together in the [Issues](https://github.com/dotnetGame/MineCase/issues). -## Feedback -If you encounter any problems with the use of `MineCase`, please point out that in [Issues](https://github.com/dotnetGame/MineCase/issues). +If you are a user, any questions you may have while using this server, or any good suggestions, can be addressed to us in [Issues](https://github.com/dotnetGame/MineCase/issues). diff --git a/appveyor.yml b/appveyor.yml index 8dd2f3f2..a5b77c6c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,13 @@ version: 1.0.0-alpha1-{build} +pull_requests: + do_not_increment_build_number: true image: Visual Studio 2017 +configuration: Appveyor +environment: + DOCKER_USER: + secure: goDG0WJjQvZlOe655QTbdA== + DOCKER_PASS: + secure: ONZZJySikYvgDWkBai0mZw== before_build: - ps: >- cd src @@ -11,6 +19,7 @@ before_build: choco install codecov build: project: ./src/ + parallel: false verbosity: minimal test_script: - ps: >- @@ -18,4 +27,18 @@ test_script: OpenCover.Console.exe -oldstyle -register:user -target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:"test" -output:".\test_coverage.xml" - codecov -f "test_coverage.xml" \ No newline at end of file + codecov -f "test_coverage.xml" +deploy_script: +- ps: >- + docker tag minecase.gateway sunnycase/minecase.gateway:ci-latest-nanoserver + + docker tag minecase.server sunnycase/minecase.server:ci-latest-nanoserver + + IF ($env:APPVEYOR_REPO_BRANCH -eq "master") + { + docker login -u="$env:DOCKER_USER" -p="$env:DOCKER_PASS" + + docker push sunnycase/minecase.gateway + + docker push sunnycase/minecase.server + } \ No newline at end of file diff --git a/build/docker/linux/docker-compose.yml b/build/docker/linux/docker-compose.yml new file mode 100644 index 00000000..39e79948 --- /dev/null +++ b/build/docker/linux/docker-compose.yml @@ -0,0 +1,12 @@ +version: '3' + +services: + minecase.server: + image: "sunnycase/minecase.server:ci-latest" + + minecase.gateway: + image: "sunnycase/minecase.gateway:ci-latest" + ports: + - "25565:25565" + depends_on: + - minecase.server \ No newline at end of file diff --git a/build/docker/win/docker-compose.yml b/build/docker/win/docker-compose.yml new file mode 100644 index 00000000..8a08a4eb --- /dev/null +++ b/build/docker/win/docker-compose.yml @@ -0,0 +1,12 @@ +version: '3' + +services: + minecase.server: + image: "sunnycase/minecase.server:ci-latest-nanoserver" + + minecase.gateway: + image: "sunnycase/minecase.gateway:ci-latest-nanoserver" + ports: + - "25565:25565" + depends_on: + - minecase.server \ No newline at end of file diff --git a/run_server.bat b/build_and_run.bat similarity index 67% rename from run_server.bat rename to build_and_run.bat index 870b906c..ff5c335f 100644 --- a/run_server.bat +++ b/build_and_run.bat @@ -9,5 +9,9 @@ popd echo start MineCase.Server... pushd src\MineCase.Server start dotnet run -echo run "run_gateway.bat" when server is ready. +popd + +echo start MineCase.Gateway... +pushd src\MineCase.Gateway +start dotnet run popd diff --git a/build_and_run.sh b/build_and_run.sh new file mode 100644 index 00000000..27d4ace5 --- /dev/null +++ b/build_and_run.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +echo building MineCase... +cd src +dotnet restore +dotnet build -c debug + +echo start MineCase.Server... +cd ../src/MineCase.Server +dotnet run + +echo start MineCase.Gateway... +cd ../src/MineCase.Gateway +dotnet run diff --git a/doc/terrain/TerrainGeneration.md b/doc/terrain/TerrainGeneration.md new file mode 100644 index 00000000..d36bd101 --- /dev/null +++ b/doc/terrain/TerrainGeneration.md @@ -0,0 +1,146 @@ +# minecase地形生成分析 + +地形 + +--- + +## Concept 基本概念 +地形生成的代码主要在net/Minecraft/world文件夹下,地形的生成主要分为两个阶段,generate和populate。generate主要进行基本地形生成,生物群落特有方块覆盖,以及skylight计算。populate主要负责建筑生成,植物生成,动物生成等地形附加结构。 + + +## minecraft数据基本存储结构 +minecraft的地图数据存储的基本元素称为block,16x16x16个block组成一个section,16个section垂直排列组成一个chunk,chunk也就是我们常说的区块,区块的大小是16x16x256。chunk数据以nbt格式存储在文件中(nbt以后有空讲) + +## block数据 + +每个block数据主要包括block id和meta数据,当然在传输过程中还会有skylight数据。 +blockid用来区分区分不同种类的方块,metavalue用来区分每一大类方块具体数值,例如燃烧着的熔炉和普通熔炉。例如方块的朝向。 + + +## chunk数据 + +每个chunk的数据包含了16x16x256的block,它也是地图传输与存储的基本单位。用户登入服务器后,服务器会将user所在点周围chunk传给客户端。 + +## minecraft坐标系统 + +对于minecraft中坐标,玩家们应该都很熟悉,xyz中y轴是高度,x,z轴与地面水平。 +接下来我来介绍一下mc中几个常用的坐标 +1. Entity在世界中的坐标,共三个分量,xyz,类型float +2. Block在世界中的坐标,共三个分量,xyz,类型int +3. Block在chunk中的坐标,三个分量,xyz,类型int +4. Chunk在世界中坐标,共两个分量,xz,类型int + +## 坐标转换 + +Block世界坐标转chunk内坐标 +```cs + public BlockChunkPos ToBlockChunkPos() + { + int blockPosX = X % ChunkConstants.BlockEdgeWidthInSection; + int blockPosZ = Z % ChunkConstants.BlockEdgeWidthInSection; + if (blockPosX < 0) blockPosX += ChunkConstants.BlockEdgeWidthInSection; + if (blockPosZ < 0) blockPosZ += ChunkConstants.BlockEdgeWidthInSection; + return new BlockChunkPos(blockPosX, Y, blockPosZ); + } +``` + +Block世界坐标转chunk坐标 +```cs + public ChunkWorldPos ToChunkWorldPos() + { + int chunkPosX = X / ChunkConstants.BlockEdgeWidthInSection; + int chunkPosZ = Z / ChunkConstants.BlockEdgeWidthInSection; + if (chunkPosX < 0) chunkPosX -= 1; + if (chunkPosZ < 0) chunkPosZ -= 1; + return new ChunkWorldPos(chunkPosX, chunkPosZ); + } +``` + +Chunk坐标转block在世界中坐标 +```cs +public BlockWorldPos ToBlockWorldPos() +{ + return new BlockWorldPos(X * 16, 0, Z * 16); +} +``` + + +Entity在世界中坐标转block在世界中坐标 + +```cs +public BlockWorldPos ToBlockWorldPos() +{ + int x = (int)Math.Floor(X); + int y = (int)Math.Floor(Y); + int z = (int)Math.Floor(Z); + return new BlockWorldPos(x, y, z); +} + +``` + +## ChunkGenerator 地形生成器 +mc的地形生成器内主要有两个方法,一个是generate,一个是populate,分别对应着生成过程中的两个阶段,在IChunkGenerator中可以很清楚得看到 + +```cs +public interface IChunkGenerator +{ + Task Generate(IWorld world, int x, int z, GeneratorSettings settings); +} +``` + +所有的ChunkGeneratorGrain都会实现此接口 + +我们主要会对ChunkGeneratorOverWorld进行讲解 + +## Biome 生物群落 + +生物群落是MC中的一个很重要的概念,生物群落贯穿着MC地形生成的整个过程。在generate阶段它会影响地形,影响表层覆盖的方块。在populate阶段,biome影响着地表植物的分布,动物的生成。一个chunk有16x16的biome数据,垂直方向的方块共享一个biome。Biome由一个biome ID表示,具体的ID值可以在wiki上查到。 + + +## GenLayer 层次生成器 +对于Biome的生成,MC采用了Genlayer的方式,以decorator模式,把生物群落得生成过程串在一起,从上向下逐层采样,生成Biome。 +我们可以看到在Genlayer.java中将各个Genlayer串在一起 +每一个new出来的layer都把上一行的layer设置为parent + +在调用getInts时,每一个layer都会递归的先将parent的ints取得,进行修改后返回。 + +下面是几个主要的genlayer子类。 + +首先是GenLayerIsland,这个layer主要用来生成基本的海洋和陆地的biome分布,1是plains biome,0是ocean biome + + + +仅靠上面的getInts获得的biome范围会很小,几乎就是每个biome块只有一格大小,我们还需要对这个数据xz放大后使用,这个工作在GenLayerZoom中完成。 + + +GenLayerBiome用来在已有的biome中添加一些不同的Biome + +先讲以上这三个主要的biome genlayer,因为genlayer实在太多了,全讲的话,一下子也理解不了。所以先讲这三个,对后面的理解有帮助。 + + +## Terrain 基本地形 +进入generate方法,下面就是generateChunk方法的前一部分。 + + + +首先我们进入setBlocksInChunk函数一探究竟。这个函数用来通过柏林噪声函数,生成一个只有石头和水的地表不平坦的世界。 + + +先看第一行,第一行的作用是获取周围32x32的biome值, +也许有人有疑问了,在mc中一个chunk是16x16,为什么要获取32x32的biome呢? +其实获取32x32范围的biome是用来做插值的,之前我们说过了,biome会影响地形的高度,我们知道plain是比较低的,而hill是比较高的,如果正好两个biome相邻,不做特殊的处理的话,biome和biome间会有陡崖。所以我们需要周围的biome的信息以便进行插值保证地形的平滑。 + +不做插值的后果: + + + +如果有人认真地复现了算法,就会有人提问了,为什么我看到返回的biome数组是10x10的呢? +这就涉及到了,mc在地形生成的一个优化,一个chunk虽然是16x16的,但是在生成高度图的时候,mc生成的是5x5x33的数组,然后对数组进行三个方向的线性插值,获得16x16x256的chunk数组。因此我们biome也只要10x10的大小(16->32, 5->10),这大大减少了运算量。 + +接下来我们来看generateHeightMap函数, + + + + +## Perlin Noise柏林噪声 + diff --git a/run_gateway.bat b/run_gateway.bat deleted file mode 100644 index 8e5d80a9..00000000 --- a/run_gateway.bat +++ /dev/null @@ -1,6 +0,0 @@ -@echo off - -echo start MineCase.Gateway... -pushd src\MineCase.Gateway -start dotnet run -popd diff --git a/screenshots/1.jpg b/screenshots/1.jpg new file mode 100644 index 00000000..777ea37f Binary files /dev/null and b/screenshots/1.jpg differ diff --git a/screenshots/2.jpg b/screenshots/2.jpg new file mode 100644 index 00000000..11d81b9a Binary files /dev/null and b/screenshots/2.jpg differ diff --git a/screenshots/3.jpg b/screenshots/3.jpg new file mode 100644 index 00000000..60854757 Binary files /dev/null and b/screenshots/3.jpg differ diff --git a/screenshots/mc1.png b/screenshots/mc1.png deleted file mode 100644 index e430626f..00000000 Binary files a/screenshots/mc1.png and /dev/null differ diff --git a/screenshots/mc2.png b/screenshots/mc2.png deleted file mode 100644 index 407f9c0e..00000000 Binary files a/screenshots/mc2.png and /dev/null differ diff --git a/screenshots/mc3.png b/screenshots/mc3.png deleted file mode 100644 index c9818f64..00000000 Binary files a/screenshots/mc3.png and /dev/null differ diff --git a/screenshots/mc4.png b/screenshots/mc4.png deleted file mode 100644 index 74765b55..00000000 Binary files a/screenshots/mc4.png and /dev/null differ diff --git a/screenshots/mc5.png b/screenshots/mc5.png deleted file mode 100644 index 37259a1b..00000000 Binary files a/screenshots/mc5.png and /dev/null differ diff --git a/src/MineCase.Engine/AsyncEventHandler.cs b/src/Common/Engine/AsyncEventHandler.cs similarity index 100% rename from src/MineCase.Engine/AsyncEventHandler.cs rename to src/Common/Engine/AsyncEventHandler.cs diff --git a/src/Common/Engine/Component.cs b/src/Common/Engine/Component.cs new file mode 100644 index 00000000..b7efd868 --- /dev/null +++ b/src/Common/Engine/Component.cs @@ -0,0 +1,150 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +#if ECS_SERVER +using ServiceProviderType = System.IServiceProvider; +#else +using ServiceProviderType = Autofac.ILifetimeScope; +#endif + +namespace MineCase.Engine +{ + internal interface IComponentIntern + { +#if ECS_SERVER + Task +#else + void +#endif + Attach(DependencyObject dependencyObject, ServiceProviderType serviceProvider); + +#if ECS_SERVER + Task +#else + void +#endif + Detach(); + + int GetMessageOrder(object message); + } + + /// + /// 组件基类 + /// + public abstract partial class Component : IComponentIntern + { + /// + /// 获取名称 + /// + public string Name { get; } + + /// + /// 获取附加到的实体 + /// + protected DependencyObject AttachedObject { get; private set; } + + /// + /// 获取服务提供程序 + /// + protected ServiceProviderType ServiceProvider { get; private set; } + + /// + /// Initializes a new instance of the class. + /// + /// 名称 + public Component(string name) + { + Name = name; + } + +#if ECS_SERVER + Task +#else + void +#endif + IComponentIntern.Attach(DependencyObject dependencyObject, ServiceProviderType serviceProvider) + { + AttachedObject = dependencyObject; + ServiceProvider = serviceProvider; + AttatchPartial(dependencyObject, serviceProvider); +#if ECS_SERVER + return +#endif + OnAttached(); + } + + partial void AttatchPartial(DependencyObject dependencyObject, ServiceProviderType serviceProvider); + +#if ECS_SERVER + Task +#else + void +#endif + IComponentIntern.Detach() + { + AttachedObject = null; +#if ECS_SERVER + return +#endif + OnDetached(); + } + + /// + /// 组件被附加到实体时 + /// + protected virtual + +#if ECS_SERVER + Task +#else + void +#endif + OnAttached() + { +#if ECS_SERVER + return Task.CompletedTask; +#endif + } + + /// + /// 组件从实体卸载时 + /// + protected virtual Task OnDetached() + { + return Task.CompletedTask; + } + + /// + /// 获取消息处理顺序 + /// + /// 消息 + /// 处理顺序(数字越小越靠前) + public virtual int GetMessageOrder(object message) + { + return 0; + } + } + + /// + /// 组件基类 + /// + /// 实体类型 + public abstract class Component : Component + where T : DependencyObject + { + /// + /// 获取附加到的实体 + /// + public new T AttachedObject => (T)base.AttachedObject; + + /// + /// Initializes a new instance of the class. + /// + /// 名称 + public Component(string name) + : base(name) + { + } + } +} diff --git a/src/MineCase.Engine/Data/DependencyValueStorage.cs b/src/Common/Engine/Data/DependencyValueStorage.cs similarity index 62% rename from src/MineCase.Engine/Data/DependencyValueStorage.cs rename to src/Common/Engine/Data/DependencyValueStorage.cs index 44e4cbf1..a0694f8e 100644 --- a/src/MineCase.Engine/Data/DependencyValueStorage.cs +++ b/src/Common/Engine/Data/DependencyValueStorage.cs @@ -22,13 +22,24 @@ public IEnumerable Keys } } - public event AsyncEventHandler CurrentValueChanged; + public event +#if ECS_SERVER + AsyncEventHandler +#else + EventHandler +#endif + CurrentValueChanged; public DependencyValueStorage() { } - public async Task AddOrUpdate(IDependencyValueProvider provider, DependencyProperty key, Func> addValueFactory, Func, Task>> updateValueFactory) + public +#if ECS_SERVER + async Task AddOrUpdate(IDependencyValueProvider provider, DependencyProperty key, Func> addValueFactory, Func, Task>> updateValueFactory) +#else + IEffectiveValue AddOrUpdate(IDependencyValueProvider provider, DependencyProperty key, Func> addValueFactory, Func, IEffectiveValue> updateValueFactory) +#endif { var storage = GetStorage(provider, key); var priority = provider.Priority; @@ -42,12 +53,21 @@ public async Task AddOrUpdate(IDependencyValueProvider provi result = value; var raiseChanged = storage.IndexOfKey(priority) == 0; if (raiseChanged) - await OnCurrentValueChanged(key, false, null, true, value.Value); + { +#if ECS_SERVER + await +#endif + OnCurrentValueChanged(key, false, null, true, value.Value); + } } else { var oldValue = (IEffectiveValue)storage.Values[oldIdx]; - var newValue = await updateValueFactory(key, oldValue); + var newValue = +#if ECS_SERVER + await +#endif + updateValueFactory(key, oldValue); if (oldValue != newValue) { oldValue.ValueChanged = null; @@ -55,7 +75,12 @@ public async Task AddOrUpdate(IDependencyValueProvider provi storage[priority] = newValue; var raiseChanged = oldIdx == 0; if (raiseChanged) - await OnCurrentValueChanged(key, true, oldValue.Value, true, newValue.Value); + { +#if ECS_SERVER + await +#endif + OnCurrentValueChanged(key, true, oldValue.Value, true, newValue.Value); + } } result = newValue; @@ -103,12 +128,27 @@ public bool TryGetCurrentEffectiveValue(DependencyProperty key, out IEffectiveVa return false; } - private Task OnCurrentValueChanged(DependencyProperty key, bool hasOldValue, object oldValue, bool hasNewValue, object newValue) + private +#if ECS_SERVER + Task +#else + void +#endif + OnCurrentValueChanged(DependencyProperty key, bool hasOldValue, object oldValue, bool hasNewValue, object newValue) { - return CurrentValueChanged.InvokeSerial(this, new CurrentValueChangedEventArgs(key, hasOldValue, oldValue, hasNewValue, newValue)); +#if ECS_SERVER + return +#endif + CurrentValueChanged.InvokeSerial(this, new CurrentValueChangedEventArgs(key, hasOldValue, oldValue, hasNewValue, newValue)); } - private Task OnEffectiveValueCleared(int index, DependencyProperty key, object oldValue) + private +#if ECS_SERVER + Task +#else + void +#endif + OnEffectiveValueCleared(int index, DependencyProperty key, object oldValue) { if (index == 0) { @@ -121,17 +161,36 @@ private Task OnEffectiveValueCleared(int index, DependencyProperty key, object o newValue = ((dynamic)list.Values[0]).Value; } - return OnCurrentValueChanged(key, true, oldValue, hasNewValue, newValue); +#if ECS_SERVER + return +#endif + OnCurrentValueChanged(key, true, oldValue, hasNewValue, newValue); } +#if ECS_SERVER return Task.CompletedTask; +#endif } - private async Task OnEffectiveValueChanged(float priority, DependencyProperty key, object oldValue, object newValue) + private +#if ECS_SERVER + Task +#else + void +#endif + OnEffectiveValueChanged(float priority, DependencyProperty key, object oldValue, object newValue) { SortedList list; if (_dict.TryGetValue(key, out list) && list.IndexOfKey(priority) == 0) - await OnCurrentValueChanged(key, true, oldValue, true, newValue); + { +#if ECS_SERVER + return +#endif + OnCurrentValueChanged(key, true, oldValue, true, newValue); + } +#if ECS_SERVER + return Task.CompletedTask; +#endif } public bool TryGetValue(IDependencyValueProvider provider, DependencyProperty key, out IEffectiveValue value) @@ -148,7 +207,13 @@ public bool TryGetValue(IDependencyValueProvider provider, DependencyProperty return false; } - public Task TryRemove(IDependencyValueProvider provider, DependencyProperty key, out IEffectiveValue value) + public +#if ECS_SERVER + Task +#else + bool +#endif + TryRemove(IDependencyValueProvider provider, DependencyProperty key, out IEffectiveValue value) { var storage = GetStorage(provider, key); var priority = provider.Priority; @@ -158,12 +223,21 @@ public Task TryRemove(IDependencyValueProvider provider, DependencyProp value = (IEffectiveValue)eValue; var index = storage.IndexOfKey(priority); storage.RemoveAt(index); +#if ECS_SERVER return OnEffectiveValueCleared(index, key, value.Value) .ContinueWith(t => true); +#else + OnEffectiveValueCleared(index, key, value.Value); + return true; +#endif } value = null; +#if ECS_SERVER return Task.FromResult(false); +#else + return false; +#endif } private SortedList GetStorage(IDependencyValueProvider provider, DependencyProperty key) @@ -175,18 +249,44 @@ private SortedList GetStorage(IDependencyValueProvider p } } + /// + /// 当前值变更 + /// public class CurrentValueChangedEventArgs : EventArgs { + /// + /// 获取依赖属性 + /// public DependencyProperty Property { get; } + /// + /// 获取原始值 + /// public object OldValue { get; } + /// + /// 获取新值 + /// public object NewValue { get; } + /// + /// 获取是否有原始值 + /// public bool HasOldValue { get; } + /// + /// 获取是否有新值 + /// public bool HasNewValue { get; } + /// + /// Initializes a new instance of the class. + /// + /// 依赖属性 + /// 是否有原始值 + /// 原始值 + /// 是否有新值 + /// 新值 public CurrentValueChangedEventArgs(DependencyProperty property, bool hasOldValue, object oldValue, bool hasNewValue, object newValue) { Property = property; diff --git a/src/Common/Engine/Data/IDependencyValueProvider.cs b/src/Common/Engine/Data/IDependencyValueProvider.cs new file mode 100644 index 00000000..a4003c4d --- /dev/null +++ b/src/Common/Engine/Data/IDependencyValueProvider.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace MineCase.Engine.Data +{ + /// + /// 依赖值提供程序接口 + /// + public interface IDependencyValueProvider + { + /// + /// 获取优先级 + /// + float Priority { get; } + } + + /// + /// EffectiveValue 提供程序接口 + /// + public interface IEffectiveValueProvider + { + /// + /// 提供值 + /// + /// 依赖对象 + /// EffectiveValue + IEffectiveValue ProviderValue(DependencyObject d); + } + + /// + /// EffectiveValue 提供程序接口 + /// + /// 值类型 + public interface IEffectiveValueProvider : IEffectiveValueProvider + { + } +} diff --git a/src/Common/Engine/Data/IDependencyValueStorage.cs b/src/Common/Engine/Data/IDependencyValueStorage.cs new file mode 100644 index 00000000..d2246221 --- /dev/null +++ b/src/Common/Engine/Data/IDependencyValueStorage.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace MineCase.Engine.Data +{ + /// + /// 依赖值存储接口 + /// + public interface IDependencyValueStorage + { + /// + /// 当前值变更事件 + /// + event +#if ECS_SERVER + AsyncEventHandler +#else + EventHandler +#endif + CurrentValueChanged; + + /// + /// 添加或更新 + /// + /// 值类型 + /// 依赖值提供程序 + /// 依赖属性 + /// 添加工厂 + /// 更新工厂 + /// 新的值 +#if ECS_SERVER + Task AddOrUpdate(IDependencyValueProvider provider, DependencyProperty key, Func> addValueFactory, Func, Task>> updateValueFactory); +#else + IEffectiveValue AddOrUpdate(IDependencyValueProvider provider, DependencyProperty key, Func> addValueFactory, Func, IEffectiveValue> updateValueFactory); +#endif + + /// + /// 尝试获取值 + /// + /// 值类型 + /// 依赖值提供程序 + /// 依赖属性 + /// 值 + /// 是否成功获取 + bool TryGetValue(IDependencyValueProvider provider, DependencyProperty key, out IEffectiveValue value); + + /// + /// 尝试删除值 + /// + /// 值类型 + /// 依赖值提供程序 + /// 依赖属性 + /// 值 + /// 是否成功删除 +#if ECS_SERVER + Task +#else + bool +#endif + TryRemove(IDependencyValueProvider provider, DependencyProperty key, out IEffectiveValue value); + + /// + /// 尝试获取当前值 + /// + /// 值类型 + /// 依赖属性 + /// 值 + /// 是否成功获取 + bool TryGetCurrentValue(DependencyProperty key, out T value); + + /// + /// 尝试获取当前 EffectiveValue + /// + /// 值类型 + /// 依赖属性 + /// EffectiveValue + /// 是否成功获取 + bool TryGetCurrentEffectiveValue(DependencyProperty key, out IEffectiveValue value); + + /// + /// 尝试获取当前 EffectiveValue + /// + /// 依赖属性 + /// EffectiveValue + /// 是否成功获取 + bool TryGetCurrentEffectiveValue(DependencyProperty key, out IEffectiveValue value); + + /// + /// 获取包含的依赖属性 + /// + IEnumerable Keys { get; } + } +} diff --git a/src/Common/Engine/Data/IEffectiveValue.cs b/src/Common/Engine/Data/IEffectiveValue.cs new file mode 100644 index 00000000..57a5886f --- /dev/null +++ b/src/Common/Engine/Data/IEffectiveValue.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace MineCase.Engine.Data +{ + /// + /// EffectiveValue 接口 + /// + public interface IEffectiveValue + { + /// + /// 获取值改变处理器 + /// +#if ECS_SERVER + AsyncEventHandler +#else + EventHandler +#endif + ValueChanged { set; } + } + + /// + /// EffectiveValue 接口 + /// + /// 值类型 + public interface IEffectiveValue : IEffectiveValue + { + /// + /// 获取可否设置值 + /// + bool CanSetValue { get; } + + /// + /// 获取值 + /// + T Value { get; } + + /// + /// 设置值 + /// + /// 值 +#if ECS_SERVER + Task +#else + void +#endif + SetValue(T value); + } + + /// + /// 接口 + /// + public interface IEffectiveValueChangedEventArgs + { + /// + /// 获取原始值 + /// + object OldValue { get; } + + /// + /// 获取新值 + /// + object NewValue { get; } + } + + /// + /// EffectiveValue 变更事件参数 + /// + /// 值类型 + public class EffectiveValueChangedEventArgs : EventArgs, IEffectiveValueChangedEventArgs + { + /// + /// 获取原始值 + /// + public T OldValue { get; } + + /// + /// 获取新值 + /// + public T NewValue { get; } + + object IEffectiveValueChangedEventArgs.OldValue => OldValue; + + object IEffectiveValueChangedEventArgs.NewValue => NewValue; + + /// + /// Initializes a new instance of the class. + /// + /// 原始值 + /// 新值 + public EffectiveValueChangedEventArgs(T oldValue, T newValue) + { + OldValue = oldValue; + NewValue = newValue; + } + } +} diff --git a/src/Common/Engine/Data/LocalDependencyValueExtensions.cs b/src/Common/Engine/Data/LocalDependencyValueExtensions.cs new file mode 100644 index 00000000..995bd5c7 --- /dev/null +++ b/src/Common/Engine/Data/LocalDependencyValueExtensions.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using MineCase.Engine.Data; + +namespace MineCase.Engine +{ + /// + /// 本地依赖值扩展 + /// + public static class LocalDependencyValueExtensions + { + /// + /// 尝试获取本地值 + /// + /// 值类型 + /// 依赖对象 + /// 依赖属性 + /// 值 + /// 是否获取成功 + public static bool TryGetLocalValue(this DependencyObject d, DependencyProperty property, out T value) + { + return LocalDependencyValueProvider.Current.TryGetValue(property, d.ValueStorage, out value); + } + + /// + /// 设置本地值 + /// + /// 值类型 + /// 依赖对象 + /// 依赖属性 + /// 值 + public static +#if ECS_SERVER + Task +#else + void +#endif + SetLocalValue(this DependencyObject d, DependencyProperty property, T value) + { +#if ECS_SERVER + return +#endif + LocalDependencyValueProvider.Current.SetValue(property, d.ValueStorage, value); + } + + /// + /// 清除本地值 + /// + /// 值类型 + /// 依赖对象 + /// 依赖属性 + public static +#if ECS_SERVER + Task +#else + void +#endif + ClearLocalValue(this DependencyObject d, DependencyProperty property) + { +#if ECS_SERVER + return +#endif + LocalDependencyValueProvider.Current.ClearValue(property, d.ValueStorage); + } + } +} diff --git a/src/Common/Engine/Data/LocalDependencyValueProvider.cs b/src/Common/Engine/Data/LocalDependencyValueProvider.cs new file mode 100644 index 00000000..f433b897 --- /dev/null +++ b/src/Common/Engine/Data/LocalDependencyValueProvider.cs @@ -0,0 +1,133 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace MineCase.Engine.Data +{ + /// + /// 本地依赖值提供程序 + /// + public class LocalDependencyValueProvider : IDependencyValueProvider + { + /// + /// 获取当前提供程序 + /// + public static LocalDependencyValueProvider Current { get; } = new LocalDependencyValueProvider(); + + /// + public float Priority => 1.0f; + + /// + /// 设置值 + /// + /// 值类型 + /// 依赖属性 + /// 值存储 + /// 值 +#if ECS_SERVER + public Task SetValue(DependencyProperty property, IDependencyValueStorage storage, T value) + { + return storage.AddOrUpdate(this, property, o => new LocalEffectiveValue(value), async (k, o) => + { + await ((LocalEffectiveValue)o).SetValue(value); + return o; + }); + } +#else + public void SetValue(DependencyProperty property, IDependencyValueStorage storage, T value) + { + storage.AddOrUpdate(this, property, o => new LocalEffectiveValue(value), (k, o) => + { + ((LocalEffectiveValue)o).SetValue(value); + return o; + }); + } +#endif + + /// + /// 尝试获取值 + /// + /// 值类型 + /// 依赖属性 + /// 值存储 + /// 值 + /// 是否获取成功 + public bool TryGetValue(DependencyProperty property, IDependencyValueStorage storage, out T value) + { + IEffectiveValue eValue; + if (storage.TryGetValue(this, property, out eValue)) + { + value = eValue.Value; + return true; + } + + value = default(T); + return false; + } + + /// + /// 清除值 + /// + /// 值类型 + /// 依赖属性 + /// 值存储 + public +#if ECS_SERVER + Task +#else + void +#endif + ClearValue(DependencyProperty property, IDependencyValueStorage storage) + { + IEffectiveValue eValue; +#if ECS_SERVER + return +#endif + storage.TryRemove(this, property, out eValue); + } + + internal class LocalEffectiveValue : IEffectiveValue + { + /// + public +#if ECS_SERVER + AsyncEventHandler +#else + EventHandler +#endif + ValueChanged { get; set; } + + /// + public bool CanSetValue => true; + + private T _value; + + /// + public T Value => _value; + + public LocalEffectiveValue(T value) + { + _value = value; + } + + /// +#if ECS_SERVER + public async Task SetValue(T value) +#else + public void SetValue(T value) +#endif + { + if (!EqualityComparer.Default.Equals(_value, value)) + { + var oldValue = _value; + _value = value; +#if ECS_SERVER + await +#endif + ValueChanged.InvokeSerial(this, new EffectiveValueChangedEventArgs(oldValue, value)); + } + } + } + } +} \ No newline at end of file diff --git a/src/MineCase.Engine/DependencyObject.cs b/src/Common/Engine/DependencyObject.cs similarity index 53% rename from src/MineCase.Engine/DependencyObject.cs rename to src/Common/Engine/DependencyObject.cs index 0392fe6e..b996bc8c 100644 --- a/src/MineCase.Engine/DependencyObject.cs +++ b/src/Common/Engine/DependencyObject.cs @@ -7,27 +7,48 @@ using System.Text; using System.Threading.Tasks; using MineCase.Engine.Data; +#if ECS_SERVER using Orleans; +#endif namespace MineCase.Engine { - public abstract class DependencyObject : Grain, IDependencyObject + /// + /// 依赖对象 + /// + public abstract partial class DependencyObject + : +#if ECS_SERVER + Grain, +#else + SmartBehaviour, +#endif + IDependencyObject { private Dictionary _components; private Dictionary _indexes; private int _index = 0; + /// + /// Initializes a new instance of the class. + /// public DependencyObject() { _realType = this.GetType(); _valueStorage.CurrentValueChanged += ValueStorage_CurrentValueChanged; } - public override async Task OnActivateAsync() + private void LoadState() { _components = new Dictionary(); _indexes = new Dictionary(); _messageHandlers = new MultiValueDictionary(); + } + +#if ECS_SERVER + public override async Task OnActivateAsync() + { + LoadState(); await InitializeComponents(); } @@ -35,8 +56,34 @@ protected virtual Task InitializeComponents() { return Task.CompletedTask; } +#else + /// + protected override void Awake() + { + base.Awake(); + LoadState(); + InitializeComponents(); + } - public T GetComponent() + /// + /// 初始化组件 + /// + protected virtual void InitializeComponents() + { + } +#endif + + /// + /// 获取组件 + /// + /// 组件类型 + /// 组件 +#if ECS_SERVER + public +#else + public new +#endif + T GetComponent() where T : Component { foreach (var component in _components) @@ -48,32 +95,72 @@ public T GetComponent() return null; } - public async Task SetComponent(Component component) +#if !ECS_SERVER + /// + /// 获取 Unity 组件 + /// + /// 组件类型 + /// 组件 + public T GetUnityComponent() + where T : UnityEngine.Component => + base.GetComponent(); +#endif + + /// + /// 设置组件 + /// + /// 组件 + public +#if ECS_SERVER + async Task +#else + void +#endif + SetComponent(Component component) { var name = component.Name; if (_components.TryGetValue(name, out var old)) { if (old == component) return; Unsubscribe(old); - await old.Detach(); +#if ECS_SERVER + await +#endif + old.Detach(); _indexes.Remove(old); _components.Remove(name); } _components.Add(name, component); _indexes.Add(component, _index++); - await ((IComponentIntern)component).Attach(this, ServiceProvider); +#if ECS_SERVER + await +#endif + ((IComponentIntern)component).Attach(this, ServiceProvider); Subscribe(component); } - public async Task ClearComponent() + /// + /// 清除组件 + /// + /// 组件类型 + public +#if ECS_SERVER + async Task +#else + void +#endif + ClearComponent() where T : Component { var components = _components.Where(o => o.Value is T); foreach (var component in components) { Unsubscribe(component.Value); - await component.Value.Detach(); +#if ECS_SERVER + await +#endif + component.Value.Detach(); _indexes.Remove(component.Value); _components.Remove(component.Key); } @@ -89,6 +176,12 @@ public async Task ClearComponent() private readonly ConcurrentDictionary _propertyChangedHandlersGen = new ConcurrentDictionary(); private Delegate _anyPropertyChangedHandler; + /// + /// 获取值 + /// + /// 值类型 + /// 依赖属性 + /// public T GetValue(DependencyProperty property) { T value; @@ -98,28 +191,86 @@ public T GetValue(DependencyProperty property) return value; } - public Task SetCurrentValue(DependencyProperty property, T value) + /// + /// 设置当前值 + /// + /// 值类型 + /// 依赖属性 + /// 值 + public +#if ECS_SERVER + Task +#else + void +#endif + SetCurrentValue(DependencyProperty property, T value) { IEffectiveValue eValue; if (_valueStorage.TryGetCurrentEffectiveValue(property, out eValue) && eValue.CanSetValue) - return eValue.SetValue(value); + { +#if ECS_SERVER + return +#endif + eValue.SetValue(value); + } else - return this.SetLocalValue(property, value); + { +#if ECS_SERVER + return +#endif + this.SetLocalValue(property, value); + } } private static readonly MethodInfo _raisePropertyChangedHelper = typeof(DependencyObject).GetRuntimeMethods().Single(o => o.Name == nameof(RaisePropertyChangedHelper)); - private Task ValueStorage_CurrentValueChanged(object sender, CurrentValueChangedEventArgs e) + private +#if ECS_SERVER + Task +#else + void +#endif + ValueStorage_CurrentValueChanged(object sender, CurrentValueChangedEventArgs e) { +#if ECS_SERVER return (Task)_raisePropertyChangedHelper.MakeGenericMethod(e.Property.PropertyType).Invoke(this, new object[] { e.Property, e }); +#else + _raisePropertyChangedHelper.MakeGenericMethod(e.Property.PropertyType).Invoke(this, new object[] { e.Property, e }); +#endif } - public void RegisterPropertyChangedHandler(DependencyProperty property, AsyncEventHandler> handler) + /// + /// 注册属性变更处理器 + /// + /// 值类型 + /// 依赖属性 + /// 处理器 + public void RegisterPropertyChangedHandler( + DependencyProperty property, +#if ECS_SERVER + AsyncEventHandler> +#else + EventHandler> +#endif + handler) { _propertyChangedHandlers.AddOrUpdate(property, handler, (k, old) => Delegate.Combine(old, handler)); } - public void RemovePropertyChangedHandler(DependencyProperty property, AsyncEventHandler> handler) + /// + /// 删除属性变更处理器 + /// + /// 值类型 + /// 依赖属性 + /// 处理器 + public void RemovePropertyChangedHandler( + DependencyProperty property, +#if ECS_SERVER + AsyncEventHandler> +#else + EventHandler> +#endif + handler) { Delegate d = null; _propertyChangedHandlers.TryRemove(property, out d); @@ -127,12 +278,36 @@ public void RemovePropertyChangedHandler(DependencyProperty property, Asyn _propertyChangedHandlers.AddOrUpdate(property, k => Delegate.Remove(d, handler), (k, old) => Delegate.Combine(old, Delegate.Remove(d, handler))); } - public void RegisterPropertyChangedHandler(DependencyProperty property, AsyncEventHandler handler) + /// + /// 注册属性变更处理器 + /// + /// 依赖属性 + /// 处理器 + public void RegisterPropertyChangedHandler( + DependencyProperty property, +#if ECS_SERVER + AsyncEventHandler +#else + EventHandler +#endif + handler) { _propertyChangedHandlersGen.AddOrUpdate(property, handler, (k, old) => Delegate.Combine(old, handler)); } - public void RemovePropertyChangedHandler(DependencyProperty property, AsyncEventHandler handler) + /// + /// 删除属性变更处理器 + /// + /// 依赖属性 + /// 处理器 + public void RemovePropertyChangedHandler( + DependencyProperty property, +#if ECS_SERVER + AsyncEventHandler +#else + EventHandler +#endif + handler) { Delegate d = null; _propertyChangedHandlersGen.TryRemove(property, out d); @@ -140,17 +315,43 @@ public void RemovePropertyChangedHandler(DependencyProperty property, AsyncEvent _propertyChangedHandlersGen.AddOrUpdate(property, k => Delegate.Remove(d, handler), (k, old) => Delegate.Combine(old, Delegate.Remove(d, handler))); } - public void RegisterAnyPropertyChangedHandler(AsyncEventHandler handler) + /// + /// 注册任意属性变更处理器 + /// + /// 处理器 + public void RegisterAnyPropertyChangedHandler( +#if ECS_SERVER + AsyncEventHandler +#else + EventHandler +#endif + handler) { _anyPropertyChangedHandler = Delegate.Combine(_anyPropertyChangedHandler, handler); } - public void RemoveAnyPropertyChangedHandler(AsyncEventHandler handler) + /// + /// 删除任意属性变更处理器 + /// + /// 处理器 + public void RemoveAnyPropertyChangedHandler( +#if ECS_SERVER + AsyncEventHandler +#else + EventHandler +#endif + handler) { _anyPropertyChangedHandler = Delegate.Remove(_anyPropertyChangedHandler, handler); } - internal async Task RaisePropertyChangedHelper(DependencyProperty property, CurrentValueChangedEventArgs e) + internal +#if ECS_SERVER + async Task +#else + void +#endif + RaisePropertyChangedHelper(DependencyProperty property, CurrentValueChangedEventArgs e) { var oldValue = e.HasOldValue ? (T)e.OldValue : GetDefaultValue(property); var newValue = e.HasNewValue ? (T)e.NewValue : GetDefaultValue(property); @@ -158,16 +359,38 @@ internal async Task RaisePropertyChangedHelper(DependencyProperty property if (e.HasOldValue && e.HasNewValue && EqualityComparer.Default.Equals((T)e.OldValue, (T)e.NewValue)) return; var args = new PropertyChangedEventArgs(property, oldValue, newValue); - await property.RaisePropertyChanged(_realType, this, args); - await InvokeLocalPropertyChangedHandlers(args); - await OnDependencyPropertyChanged(args); + +#if ECS_SERVER + await +#endif + property.RaisePropertyChanged(_realType, this, args); +#if ECS_SERVER + await +#endif + InvokeLocalPropertyChangedHandlers(args); +#if ECS_SERVER + await +#endif + OnDependencyPropertyChanged(args); } + /// + /// 依赖属性发生变更时 + /// + /// 值类型 + /// 参数 +#if ECS_SERVER public virtual Task OnDependencyPropertyChanged(PropertyChangedEventArgs args) { return Task.CompletedTask; } +#else + public virtual void OnDependencyPropertyChanged(PropertyChangedEventArgs args) + { + } +#endif +#if ECS_SERVER private async Task InvokeLocalPropertyChangedHandlers(PropertyChangedEventArgs e) { Delegate d; @@ -178,6 +401,18 @@ private async Task InvokeLocalPropertyChangedHandlers(PropertyChangedEventArg await ((AsyncEventHandler)d).InvokeSerial(this, e); await ((AsyncEventHandler)_anyPropertyChangedHandler).InvokeSerial(this, e); } +#else + private void InvokeLocalPropertyChangedHandlers(PropertyChangedEventArgs e) + { + Delegate d; + if (_propertyChangedHandlers.TryGetValue(e.Property, out d)) + ((EventHandler>)d).InvokeSerial(this, e); + + if (_propertyChangedHandlersGen.TryGetValue(e.Property, out d)) + ((EventHandler)d).InvokeSerial(this, e); + ((EventHandler)_anyPropertyChangedHandler).InvokeSerial(this, e); + } +#endif private T GetDefaultValue(DependencyProperty property) { @@ -256,55 +491,129 @@ private void Unsubscribe(IComponentIntern component) _messageHandlers.Remove(type, component); } - public Task Tell(IEntityMessage message) + /// + public +#if ECS_SERVER + Task +#else + void +#endif + Tell(IEntityMessage message) { - return Tell(message, message.GetType()); +#if ECS_SERVER + return +#endif + Tell(message, message.GetType()); } - public Task Tell(T message) + /// + /// 告知 + /// + /// 消息类型 + /// 消息 + public +#if ECS_SERVER + Task +#else + void +#endif + Tell(T message) where T : IEntityMessage { - return Tell(message, typeof(T)); +#if ECS_SERVER + return +#endif + Tell(message, typeof(T)); } - private async Task Tell(IEntityMessage message, Type messageType) + private +#if ECS_SERVER + async Task +#else + void +#endif + Tell(IEntityMessage message, Type messageType) { - var invoker = (Func)GetOrAddMessageCaller(messageType); + var invoker = +#if ECS_SERVER + (Func +#else + (Action +#endif +)GetOrAddMessageCaller(messageType); if (_messageHandlers.TryGetValue(messageType, out var handlers)) { foreach (var handler in from h in handlers orderby h.GetMessageOrder(message), _indexes[h] select h) - await invoker(handler, message); + { +#if ECS_SERVER + await +#endif + invoker(handler, message); + } } } - public async Task Ask(IEntityMessage message) + /// + public +#if ECS_SERVER + async Task +#else + TResponse +#endif + Ask(IEntityMessage message) { - var response = await TryAsk(message); + var response = +#if ECS_SERVER + await +#endif + TryAsk(message); if (!response.Succeeded) throw new ReceiverNotFoundException(); return response.Response; } - public async Task> TryAsk(IEntityMessage message) + /// + public +#if ECS_SERVER + async Task> +#else + AskResult +#endif + TryAsk(IEntityMessage message) { var messageType = message.GetType(); - var invoker = (Func, Task>)GetOrAddMessageCaller(messageType); + var invoker = +#if ECS_SERVER + (Func, Task> +#else + (Func, TResponse> +#endif +)GetOrAddMessageCaller(messageType); if (_messageHandlers.TryGetValue(messageType, out var handlers)) { foreach (var handler in from h in handlers orderby h.GetMessageOrder(message), _indexes[h] select h) - return new AskResult { Succeeded = true, Response = await invoker(handler, message) }; + { + var response = +#if ECS_SERVER + await +#endif + invoker(handler, message); + return new AskResult { Succeeded = true, Response = response }; + } } return AskResult.Failed; } +#if ECS_SERVER public virtual void Destroy() { DeactivateOnIdle(); } +#endif } } diff --git a/src/MineCase.Engine/DependencyProperty.cs b/src/Common/Engine/DependencyProperty.cs similarity index 71% rename from src/MineCase.Engine/DependencyProperty.cs rename to src/Common/Engine/DependencyProperty.cs index 279f637d..ead8bd55 100644 --- a/src/MineCase.Engine/DependencyProperty.cs +++ b/src/Common/Engine/DependencyProperty.cs @@ -11,24 +11,53 @@ namespace MineCase.Engine [Flags] internal enum DependencyPropertyFlags { + /// + /// 无 + /// None = 0, + + /// + /// 附加属性 + /// Attached = 1, + + /// + /// 只读属性 + /// ReadOnly = 2 } + /// + /// 依赖属性 + /// public abstract class DependencyProperty : IEquatable { private static int _nextAvailableGlobalId = 0; private static readonly ConcurrentDictionary _fromNameMaps = new ConcurrentDictionary(); + /// + /// 获取名称 + /// public string Name { get; } + /// + /// 获取所有者类型 + /// public Type OwnerType { get; } + /// + /// 获取属性类型 + /// public abstract Type PropertyType { get; } + /// + /// 获取是否附加属性 + /// public bool IsAttached => Flags.HasFlag(DependencyPropertyFlags.Attached); + /// + /// 获取是否只读属性 + /// public bool IsReadOnly => Flags.HasFlag(DependencyPropertyFlags.ReadOnly); internal DependencyPropertyFlags Flags { get; } @@ -44,6 +73,7 @@ internal DependencyProperty(string name, Type ownerType, DependencyPropertyFlags _globalId = Interlocked.Increment(ref _nextAvailableGlobalId); } + /// public override bool Equals(object obj) { if (obj is DependencyProperty) @@ -51,22 +81,40 @@ public override bool Equals(object obj) return false; } + /// public bool Equals(DependencyProperty other) { if (other != null) return _globalId == other._globalId; return false; } + /// public override int GetHashCode() { return _globalId.GetHashCode(); } + /// + /// 注册 + /// + /// 属性类型 + /// 名称 + /// 所有者类型 + /// 元数据 + /// 依赖属性 public static DependencyProperty Register(string name, Type ownerType, PropertyMetadata metadata = null) { return RegisterIntern(name, ownerType, DependencyPropertyFlags.None, metadata ?? new PropertyMetadata(UnsetValue)); } + /// + /// 注册附加属性 + /// + /// 属性类型 + /// 名称 + /// 所有者类型 + /// 元数据 + /// 依赖属性 public static DependencyProperty RegisterAttached(string name, Type ownerType, PropertyMetadata metadata = null) { return RegisterIntern(name, ownerType, DependencyPropertyFlags.Attached, metadata ?? new PropertyMetadata(UnsetValue)); @@ -82,6 +130,12 @@ private static DependencyProperty RegisterIntern(string name, Type ownerTy return new DependencyProperty(name, ownerType, flag, metadata ?? new PropertyMetadata(UnsetValue)); } + /// + /// 从名称获取依赖属性 + /// + /// 名称 + /// 所有者类型 + /// 依赖属性 public static DependencyProperty FromName(string name, Type ownerType) { if (name == null) @@ -99,14 +153,25 @@ public static DependencyProperty FromName(string name, Type ownerType) return property != null ? property : throw new InvalidOperationException($"Property {ownerType.Name}.{name} not found."); } + /// + /// 添加从名称获取 + /// + /// 名称 + /// 所有者类型 protected void AddFromeNameKey(string name, Type ownerType) { if (!_fromNameMaps.TryAdd(new FromNameKey(name, ownerType), this)) throw new ArgumentException($"Property {ownerType.Name}.{name} is already registered."); } + /// + /// 未设置值 + /// public static readonly UnsetValueType UnsetValue = default(UnsetValueType); + /// + /// 未设置值类型 + /// public struct UnsetValueType { } @@ -145,11 +210,16 @@ public override bool Equals(object obj) } } + /// + /// 依赖属性 + /// + /// 属性类型 public sealed class DependencyProperty : DependencyProperty { private PropertyMetadata _baseMetadata; private readonly ConcurrentDictionary> _metadatas = new ConcurrentDictionary>(); + /// public override Type PropertyType => typeof(T); internal DependencyProperty(string name, Type ownerType, DependencyPropertyFlags flags, PropertyMetadata metadata) @@ -160,6 +230,11 @@ internal DependencyProperty(string name, Type ownerType, DependencyPropertyFlags _baseMetadata = metadata; } + /// + /// 重写元数据 + /// + /// 要重写的目标类型 + /// 元数据 public void OverrideMetadata(Type type, PropertyMetadata metadata) { if (type == null) @@ -184,6 +259,12 @@ public void OverrideMetadata(Type type, PropertyMetadata metadata) } } + /// + /// 添加所有者 + /// + /// 所有者类型 + /// 元数据 + /// 依赖属性 public DependencyProperty AddOwner(Type ownerType, PropertyMetadata metadata = null) { if (ownerType == null) @@ -196,16 +277,37 @@ public DependencyProperty AddOwner(Type ownerType, PropertyMetadata metada return this; } + /// + /// 尝试获取默认值 + /// + /// 依赖对象 + /// 类型 + /// 值 + /// 是否获取成功 public bool TryGetDefaultValue(DependencyObject d, Type type, out T value) { return GetMetadata(type).TryGetDefaultValue(d, this, out value); } - internal Task RaisePropertyChanged(Type type, object sender, PropertyChangedEventArgs e) + internal +#if ECS_SERVER + Task +#else + void +#endif + RaisePropertyChanged(Type type, object sender, PropertyChangedEventArgs e) { - return GetMetadata(type).RaisePropertyChanged(sender, e); +#if ECS_SERVER + return +#endif + GetMetadata(type).RaisePropertyChanged(sender, e); } + /// + /// 获取元数据 + /// + /// 类型 + /// 元数据 public PropertyMetadata GetMetadata(Type type) { bool metadataIsDervied; @@ -245,6 +347,13 @@ private PropertyMetadata MergeMetadata(bool ownerIsDerived, PropertyMetadata< return newMetadata; } + /// + /// 尝试获取非默认值 + /// + /// 依赖对象 + /// 类型 + /// 值 + /// 是否具有非默认值 public bool TryGetNonDefaultValue(DependencyObject d, Type type, out T value) { return GetMetadata(type).TryGetNonDefaultValue(d, this, out value); diff --git a/src/MineCase.Engine/EngineAssemblyExtensions.cs b/src/Common/Engine/EngineAssemblyExtensions.cs similarity index 61% rename from src/MineCase.Engine/EngineAssemblyExtensions.cs rename to src/Common/Engine/EngineAssemblyExtensions.cs index ac7a5d9b..6fe2d5f0 100644 --- a/src/MineCase.Engine/EngineAssemblyExtensions.cs +++ b/src/Common/Engine/EngineAssemblyExtensions.cs @@ -5,8 +5,16 @@ namespace MineCase { + /// + /// Engine 程序集扩展 + /// public static class EngineAssemblyExtensions { + /// + /// 添加 Engine + /// + /// 程序集集合 + /// 程序集集合 public static ICollection AddEngine(this ICollection assemblies) { assemblies.Add(typeof(EngineAssemblyExtensions).Assembly); diff --git a/src/Common/Engine/IDependencyObject.cs b/src/Common/Engine/IDependencyObject.cs new file mode 100644 index 00000000..8a1f4ac5 --- /dev/null +++ b/src/Common/Engine/IDependencyObject.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +#if ECS_SERVER +using Orleans; +using Orleans.Concurrency; +#endif + +namespace MineCase.Engine +{ + /// + /// 询问结果 + /// + /// 回复类型 +#if ECS_SERVER + [Immutable] +#endif + public sealed class AskResult + { + /// + /// 询问失败 + /// + public static readonly AskResult Failed = new AskResult { Succeeded = false }; + + /// + /// 是否成功 + /// + public bool Succeeded; + + /// + /// 回复 + /// + public TResponse Response; + } + + /// + /// 依赖对象接口 + /// + public interface IDependencyObject +#if ECS_SERVER + : IGrain +#endif + { + /// + /// 通知 + /// + /// 消息 +#if ECS_SERVER + Task +#else + void +#endif + Tell(IEntityMessage message); + + /// + /// 询问 + /// + /// 消息 + /// 回复 +#if ECS_SERVER + Task +#else + TResponse +#endif + Ask(IEntityMessage message); + + /// + /// 尝试询问 + /// + /// 消息 + /// 询问结果 +#if ECS_SERVER + Task> +#else + AskResult +#endif + TryAsk(IEntityMessage message); + } +} diff --git a/src/MineCase.Engine/IEntityMessage.cs b/src/Common/Engine/IEntityMessage.cs similarity index 51% rename from src/MineCase.Engine/IEntityMessage.cs rename to src/Common/Engine/IEntityMessage.cs index 1b5d1e51..5b104431 100644 --- a/src/MineCase.Engine/IEntityMessage.cs +++ b/src/Common/Engine/IEntityMessage.cs @@ -4,14 +4,24 @@ namespace MineCase.Engine { + /// + /// 是实体消息 + /// public interface IEntityMessage { } + /// + /// 具有回复的实体消息 + /// + /// 回复类型 public interface IEntityMessage { } + /// + /// 找不到接收者异常 + /// public class ReceiverNotFoundException : Exception { } diff --git a/src/Common/Engine/IHandle.cs b/src/Common/Engine/IHandle.cs new file mode 100644 index 00000000..a484a098 --- /dev/null +++ b/src/Common/Engine/IHandle.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace MineCase.Engine +{ + /// + /// 实体消息处理接口 + /// + /// 消息类型 + public interface IHandle + where TMessage : IEntityMessage + { + /// + /// 处理消息 + /// + /// 消息 +#if ECS_SERVER + Task +#else + void +#endif + Handle(TMessage message); + } + + /// + /// 实体消息处理接口 + /// + /// 消息类型 + /// 返回类型 + public interface IHandle + where TMessage : IEntityMessage + { + /// + /// 处理消息 + /// + /// 消息 + /// 回复 +#if ECS_SERVER + Task +#else + TResponse +#endif + Handle(TMessage message); + } +} diff --git a/src/Common/Engine/PropertyChangedEventArgs.cs b/src/Common/Engine/PropertyChangedEventArgs.cs new file mode 100644 index 00000000..842d634b --- /dev/null +++ b/src/Common/Engine/PropertyChangedEventArgs.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace MineCase.Engine +{ + /// + /// 属性变更事件参数 + /// + public class PropertyChangedEventArgs : EventArgs + { + /// + /// 依赖属性 + /// + public DependencyProperty Property { get; } + + /// + /// Initializes a new instance of the class. + /// + /// 依赖属性 + public PropertyChangedEventArgs(DependencyProperty property) + { + Property = property; + } + } + + /// + /// 属性变更事件参数 + /// + /// 值类型 + public class PropertyChangedEventArgs : PropertyChangedEventArgs + { + /// + /// 依赖属性 + /// + public new DependencyProperty Property => (DependencyProperty)base.Property; + + /// + /// 获取原始值 + /// + public T OldValue { get; } + + /// + /// 获取新值 + /// + public T NewValue { get; } + + /// + /// Initializes a new instance of the class. + /// + /// 依赖属性 + /// 原始值 + /// 新值 + public PropertyChangedEventArgs(DependencyProperty property, T oldValue, T newValue) + : base(property) + { + OldValue = oldValue; + NewValue = newValue; + } + } +} diff --git a/src/Common/Engine/PropertyMetadata.cs b/src/Common/Engine/PropertyMetadata.cs new file mode 100644 index 00000000..af198c94 --- /dev/null +++ b/src/Common/Engine/PropertyMetadata.cs @@ -0,0 +1,191 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; + +namespace MineCase.Engine +{ + /// + /// 依赖属性元数据 + /// + /// 值类型 + public class PropertyMetadata + { + private bool _defaultValueSet; + private T _defaultValue; + + /// + /// 获取是否具有默认值 + /// + public bool HasDefaultValue => _defaultValueSet; + + /// + /// 获取默认值 + /// + public T DefaultValue => _defaultValue; + + /// + /// 属性更改事件 + /// + public event +#if ECS_SERVER + AsyncEventHandler> +#else + EventHandler> +#endif + PropertyChanged; + + /// + /// Initializes a new instance of the class. + /// + /// 默认值 + /// 属性更改处理器 + public PropertyMetadata( + T defaultValue, +#if ECS_SERVER + AsyncEventHandler> +#else + EventHandler> +#endif + propertyChangedHandler = null) + { + _defaultValue = defaultValue; + _defaultValueSet = true; + if (propertyChangedHandler != null) + PropertyChanged += propertyChangedHandler; + } + + /// + /// Initializes a new instance of the class. + /// + /// 未设置默认值 + /// 属性更改处理器 + public PropertyMetadata( + DependencyProperty.UnsetValueType unsetValue, +#if ECS_SERVER + AsyncEventHandler> +#else + EventHandler> +#endif + propertyChangedHandler = null) + { + _defaultValueSet = false; + if (propertyChangedHandler != null) + PropertyChanged += propertyChangedHandler; + } + + /// + /// 尝试获取默认值 + /// + /// 依赖对象 + /// 依赖属性 + /// 值 + /// 是否具有默认值 + public bool TryGetDefaultValue(DependencyObject d, DependencyProperty property, out T value) + { + if (TryGetDefaultValueOverride(d, property, out value)) + return true; + if (_defaultValueSet) + { + value = _defaultValue; + return true; + } + + return false; + } + + /// + /// 尝试获取默认值 + /// + /// 依赖对象 + /// 依赖属性 + /// 值 + /// 是否具有默认值 + protected virtual bool TryGetDefaultValueOverride(DependencyObject d, DependencyProperty property, out T value) + { + value = default(T); + return false; + } + +#if ECS_SERVER + internal async Task RaisePropertyChanged(object sender, PropertyChangedEventArgs e) + { + await OnPropertyChanged(sender, e); + await PropertyChanged.InvokeSerial(sender, e); + } +#else + internal void RaisePropertyChanged(object sender, PropertyChangedEventArgs e) + { + OnPropertyChanged(sender, e); + PropertyChanged.InvokeSerial(sender, e); + } +#endif + + /// + /// 当属性修改时 + /// + /// 发送方 + /// 参数 +#if ECS_SERVER + protected virtual Task OnPropertyChanged(object sender, PropertyChangedEventArgs e) + { + return Task.CompletedTask; + } +#else + protected virtual void OnPropertyChanged(object sender, PropertyChangedEventArgs e) + { + } +#endif + + /// + /// 合并属性元数据 + /// + /// 原有元数据 + protected virtual void MergeOverride(PropertyMetadata old) + { + } + + internal void Merge(PropertyMetadata old, bool ownerIsDerived) + { + if (!_defaultValueSet && old._defaultValueSet) + { + _defaultValue = old._defaultValue; + _defaultValueSet = true; + } + + if (ownerIsDerived) + { + PropertyChanged = +#if ECS_SERVER + (AsyncEventHandler> +#else + (EventHandler> +#endif +)Delegate.Combine(old.PropertyChanged, PropertyChanged); + } + + MergeOverride(old); + } + + /// + /// 尝试获取非默认值 + /// + /// 依赖对象 + /// 依赖属性 + /// 值 + /// 是否具有非默认值 + public virtual bool TryGetNonDefaultValue(DependencyObject d, DependencyProperty property, out T value) + { + value = default(T); + return false; + } + } + + internal static class EventHandlerExtensions + { + public static void InvokeSerial(this EventHandler handler, object sender, TEventArgs e) + { + handler?.Invoke(sender, e); + } + } +} diff --git a/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiChicken.cs b/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiChicken.cs index c65c436a..244d2f7e 100644 --- a/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiChicken.cs +++ b/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiChicken.cs @@ -8,7 +8,8 @@ namespace MineCase.Server.World.EntitySpawner.Ai.MobAi { public class AiChicken : AiPassive { - static AiChicken() + public AiChicken(Func getter, Action setter) + : base(getter, setter) { } } diff --git a/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiCow.cs b/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiCow.cs index 567989d3..34669370 100644 --- a/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiCow.cs +++ b/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiCow.cs @@ -8,7 +8,8 @@ namespace MineCase.Server.World.EntitySpawner.Ai.MobAi { public class AiCow : AiPassive { - static AiCow() + public AiCow(Func getter, Action setter) + : base(getter, setter) { } } diff --git a/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiCreeper.cs b/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiCreeper.cs index 5e28893c..5dfc18e0 100644 --- a/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiCreeper.cs +++ b/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiCreeper.cs @@ -8,7 +8,8 @@ namespace MineCase.Server.World.EntitySpawner.Ai.MobAi { public class AiCreeper : AiMonster { - static AiCreeper() + public AiCreeper(Func getter, Action setter) + : base(getter, setter) { } } diff --git a/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiMonster.cs b/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiMonster.cs index bed257c9..d92533e0 100644 --- a/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiMonster.cs +++ b/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiMonster.cs @@ -3,39 +3,36 @@ using System.Text; using MineCase.Server.World.EntitySpawner; using MineCase.Server.World.EntitySpawner.Ai; +using Stateless; namespace MineCase.Algorithm.Game.Entity.Ai.MobAi { public abstract class AiMonster : CreatureAi { - public static CreatureState[,] Automation { get; set; } - - static AiMonster() + public AiMonster(Func getter, Action setter) + : base(getter, setter) { - int creatureStateMax = Enum.GetValues(typeof(CreatureState)).Length; - int creatureEventMax = Enum.GetValues(typeof(CreatureEvent)).Length; - Automation = new CreatureState[creatureStateMax, creatureEventMax]; - Automation[(int)CreatureState.Stop, (int)CreatureEvent.Nothing] = CreatureState.Stop; - Automation[(int)CreatureState.Stop, (int)CreatureEvent.RandomWalk] = CreatureState.Walk; - Automation[(int)CreatureState.Stop, (int)CreatureEvent.Attacked] = CreatureState.Escaping; - Automation[(int)CreatureState.Stop, (int)CreatureEvent.PlayerApproaching] = CreatureState.Look; - - Automation[(int)CreatureState.Walk, (int)CreatureEvent.Nothing] = CreatureState.Walk; - Automation[(int)CreatureState.Walk, (int)CreatureEvent.Stop] = CreatureState.Stop; - Automation[(int)CreatureState.Walk, (int)CreatureEvent.Attacked] = CreatureState.Escaping; - Automation[(int)CreatureState.Walk, (int)CreatureEvent.PlayerApproaching] = CreatureState.Look; - - Automation[(int)CreatureState.Look, (int)CreatureEvent.Nothing] = CreatureState.Look; - Automation[(int)CreatureState.Look, (int)CreatureEvent.Stop] = CreatureState.Stop; - Automation[(int)CreatureState.Look, (int)CreatureEvent.Attacked] = CreatureState.Escaping; - Automation[(int)CreatureState.Look, (int)CreatureEvent.PlayerApproaching] = CreatureState.Look; - - Automation[(int)CreatureState.Escaping, (int)CreatureEvent.Attacked] = CreatureState.Escaping; } - public override CreatureState GetState(CreatureState creatureState, CreatureEvent creatureEvent) + protected override void Configure(StateMachine stateMachine) { - return Automation[(int)creatureState, (int)creatureEvent]; + stateMachine.Configure(CreatureState.Stop) + .PermitReentry(CreatureEvent.Nothing) + .Permit(CreatureEvent.RandomWalk, CreatureState.Walk) + .Permit(CreatureEvent.Attacked, CreatureState.Escaping) + .Permit(CreatureEvent.PlayerApproaching, CreatureState.Look); + stateMachine.Configure(CreatureState.Walk) + .PermitReentry(CreatureEvent.Nothing) + .Permit(CreatureEvent.Stop, CreatureState.Stop) + .Permit(CreatureEvent.Attacked, CreatureState.Escaping) + .Permit(CreatureEvent.PlayerApproaching, CreatureState.Look); + stateMachine.Configure(CreatureState.Look) + .PermitReentry(CreatureEvent.Nothing) + .Permit(CreatureEvent.Stop, CreatureState.Stop) + .Permit(CreatureEvent.Attacked, CreatureState.Escaping) + .PermitReentry(CreatureEvent.PlayerApproaching); + stateMachine.Configure(CreatureState.Escaping) + .PermitReentry(CreatureEvent.Attacked); } } } diff --git a/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiPassive.cs b/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiPassive.cs index 8980eee5..34810304 100644 --- a/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiPassive.cs +++ b/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiPassive.cs @@ -3,39 +3,36 @@ using System.Text; using MineCase.Server.World.EntitySpawner; using MineCase.Server.World.EntitySpawner.Ai; +using Stateless; namespace MineCase.Algorithm.Game.Entity.Ai.MobAi { public abstract class AiPassive : CreatureAi { - public static CreatureState[,] Automation { get; set; } - - static AiPassive() + public AiPassive(Func getter, Action setter) + : base(getter, setter) { - int creatureStateMax = Enum.GetValues(typeof(CreatureState)).Length; - int creatureEventMax = Enum.GetValues(typeof(CreatureEvent)).Length; - Automation = new CreatureState[creatureStateMax, creatureEventMax]; - Automation[(int)CreatureState.Stop, (int)CreatureEvent.Nothing] = CreatureState.Stop; - Automation[(int)CreatureState.Stop, (int)CreatureEvent.RandomWalk] = CreatureState.Walk; - Automation[(int)CreatureState.Stop, (int)CreatureEvent.Attacked] = CreatureState.Escaping; - Automation[(int)CreatureState.Stop, (int)CreatureEvent.PlayerApproaching] = CreatureState.Look; - - Automation[(int)CreatureState.Walk, (int)CreatureEvent.Nothing] = CreatureState.Walk; - Automation[(int)CreatureState.Walk, (int)CreatureEvent.Stop] = CreatureState.Stop; - Automation[(int)CreatureState.Walk, (int)CreatureEvent.Attacked] = CreatureState.Escaping; - Automation[(int)CreatureState.Walk, (int)CreatureEvent.PlayerApproaching] = CreatureState.Look; - - Automation[(int)CreatureState.Look, (int)CreatureEvent.Nothing] = CreatureState.Look; - Automation[(int)CreatureState.Look, (int)CreatureEvent.Stop] = CreatureState.Stop; - Automation[(int)CreatureState.Look, (int)CreatureEvent.Attacked] = CreatureState.Escaping; - Automation[(int)CreatureState.Look, (int)CreatureEvent.PlayerApproaching] = CreatureState.Look; - - Automation[(int)CreatureState.Escaping, (int)CreatureEvent.Attacked] = CreatureState.Escaping; } - public override CreatureState GetState(CreatureState creatureState, CreatureEvent creatureEvent) + protected override void Configure(StateMachine stateMachine) { - return Automation[(int)creatureState, (int)creatureEvent]; + stateMachine.Configure(CreatureState.Stop) + .PermitReentry(CreatureEvent.Nothing) + .Permit(CreatureEvent.RandomWalk, CreatureState.Walk) + .Permit(CreatureEvent.Attacked, CreatureState.Escaping) + .Permit(CreatureEvent.PlayerApproaching, CreatureState.Look); + stateMachine.Configure(CreatureState.Walk) + .PermitReentry(CreatureEvent.Nothing) + .Permit(CreatureEvent.Stop, CreatureState.Stop) + .Permit(CreatureEvent.Attacked, CreatureState.Escaping) + .Permit(CreatureEvent.PlayerApproaching, CreatureState.Look); + stateMachine.Configure(CreatureState.Look) + .PermitReentry(CreatureEvent.Nothing) + .Permit(CreatureEvent.Stop, CreatureState.Stop) + .Permit(CreatureEvent.Attacked, CreatureState.Escaping) + .PermitReentry(CreatureEvent.PlayerApproaching); + stateMachine.Configure(CreatureState.Escaping) + .PermitReentry(CreatureEvent.Attacked); } } } diff --git a/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiPig.cs b/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiPig.cs index 807869fb..c7d91c1f 100644 --- a/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiPig.cs +++ b/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiPig.cs @@ -8,7 +8,8 @@ namespace MineCase.Server.World.EntitySpawner.Ai.MobAi { public class AiPig : AiPassive { - static AiPig() + public AiPig(Func getter, Action setter) + : base(getter, setter) { } } diff --git a/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiSheep.cs b/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiSheep.cs index 57b70a64..be58184a 100644 --- a/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiSheep.cs +++ b/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiSheep.cs @@ -8,7 +8,8 @@ namespace MineCase.Server.World.EntitySpawner.Ai.MobAi { public class AiSheep : AiPassive { - static AiSheep() + public AiSheep(Func getter, Action setter) + : base(getter, setter) { } } diff --git a/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiSkeleton.cs b/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiSkeleton.cs index 55ced7f7..19164564 100644 --- a/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiSkeleton.cs +++ b/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiSkeleton.cs @@ -8,7 +8,8 @@ namespace MineCase.Server.World.EntitySpawner.Ai.MobAi { public class AiSkeleton : AiMonster { - static AiSkeleton() + public AiSkeleton(Func getter, Action setter) + : base(getter, setter) { } } diff --git a/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiZombie.cs b/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiZombie.cs index 18d924ee..7f69454e 100644 --- a/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiZombie.cs +++ b/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/AiZombie.cs @@ -8,7 +8,8 @@ namespace MineCase.Server.World.EntitySpawner.Ai.MobAi { public class AiZombie : AiMonster { - static AiZombie() + public AiZombie(Func getter, Action setter) + : base(getter, setter) { } } diff --git a/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/CreatureAi.cs b/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/CreatureAi.cs index 12b9321c..b8b342ae 100644 --- a/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/CreatureAi.cs +++ b/src/MineCase.Algorithm/Game/Entity/Ai/MobAi/CreatureAi.cs @@ -1,14 +1,30 @@ using System; using System.Collections.Generic; using System.Text; +using System.Threading.Tasks; using MineCase.Server.World.EntitySpawner; using MineCase.Server.World.EntitySpawner.Ai; using MineCase.Server.World.EntitySpawner.Ai.Action; +using Stateless; namespace MineCase.Algorithm.Game.Entity.Ai.MobAi { public abstract class CreatureAi { - public abstract CreatureState GetState(CreatureState creatureState, CreatureEvent creatureEvent); + private readonly StateMachine _stateMachine; + + public CreatureState State => _stateMachine.State; + + public CreatureAi(Func getter, Action setter) + { + var stateMachine = new StateMachine(getter, setter); + Configure(stateMachine); + _stateMachine = stateMachine; + } + + public Task FireAsync(CreatureEvent @event) => + _stateMachine.FireAsync(@event); + + protected abstract void Configure(StateMachine stateMachine); } } diff --git a/src/MineCase.Algorithm/MineCase.Algorithm.csproj b/src/MineCase.Algorithm/MineCase.Algorithm.csproj index f3cf74d6..7dc9e888 100644 --- a/src/MineCase.Algorithm/MineCase.Algorithm.csproj +++ b/src/MineCase.Algorithm/MineCase.Algorithm.csproj @@ -4,11 +4,13 @@ netstandard2.0 true ../../build/Analyzers.ruleset + Debug;Release;Appveyor;TravisCI + diff --git a/src/MineCase.Client.Engine/Builder/BootstrapperBase.cs b/src/MineCase.Client.Engine/Builder/BootstrapperBase.cs index cfa11a71..bbae363d 100644 --- a/src/MineCase.Client.Engine/Builder/BootstrapperBase.cs +++ b/src/MineCase.Client.Engine/Builder/BootstrapperBase.cs @@ -48,10 +48,7 @@ protected void Initialize() { _mainThreadSyncContext = SynchronizationContext.Current; - var assemblies = new List - { - typeof(BootstrapperBase).Assembly - }; + var assemblies = new List(); ConfigureApplicationParts(assemblies); var containerBuilder = new ContainerBuilder(); @@ -99,12 +96,24 @@ private static BootstrapperBase OnGetCurrent() internal void OnMainThread(Action action) { - _mainThreadSyncContext.Send(s => ((Action)s)(), action); + _mainThreadSyncContext.Send( + s => + { + if (!Application.isPlaying) + throw new InvalidOperationException(); + ((Action)s)(); + }, action); } internal void OnMainThreadAsync(Action action) { - _mainThreadSyncContext.Post(s => ((Action)s)(), action); + _mainThreadSyncContext.Post( + s => + { + if (!Application.isPlaying) + throw new InvalidOperationException(); + ((Action)s)(); + }, action); } [RuntimeInitializeOnLoadMethod] diff --git a/src/MineCase.Client.Engine/DependencyObject.Client.cs b/src/MineCase.Client.Engine/DependencyObject.Client.cs new file mode 100644 index 00000000..a021e51e --- /dev/null +++ b/src/MineCase.Client.Engine/DependencyObject.Client.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MineCase.Engine +{ + public partial class DependencyObject + { + private void Update() + { + Tell(Messages.Update.Default); + } + + private void OnAnimatorIK(int layerIndex) + { + Tell(new Messages.OnAnimatorIK { LayerIndex = layerIndex }); + } + } +} diff --git a/src/MineCase.Client.Engine/EventAggregator.cs b/src/MineCase.Client.Engine/EventAggregator.cs index fde95a09..9c82c6e9 100644 --- a/src/MineCase.Client.Engine/EventAggregator.cs +++ b/src/MineCase.Client.Engine/EventAggregator.cs @@ -124,8 +124,8 @@ private static Delegate GetOrAddMessageCaller(Type messageType) { var paramExp = Expression.Parameter(typeof(object), "c"); var messageParamExp = Expression.Parameter(typeof(object), "m"); - var handlerType = typeof(IHandle<>).MakeGenericType(messageType); - var handleMethod = handlerType.GetMethod(nameof(IHandle.Handle)); + var handlerType = typeof(IHandleEvent<>).MakeGenericType(messageType); + var handleMethod = handlerType.GetMethod(nameof(IHandleEvent.Handle)); return Expression.Lambda( Expression.Call( Expression.Convert(paramExp, handlerType), @@ -143,7 +143,7 @@ private IEnumerable GetComponentHandledMessageTypes(Type componentType) if (iface.IsConstructedGenericType) { var genface = iface.GetGenericTypeDefinition(); - if (genface == typeof(IHandle<>)) + if (genface == typeof(IHandleEvent<>)) { yield return iface.GetGenericArguments()[0]; } diff --git a/src/MineCase.Client.Engine/IHandle.cs b/src/MineCase.Client.Engine/IHandleEvent.cs similarity index 90% rename from src/MineCase.Client.Engine/IHandle.cs rename to src/MineCase.Client.Engine/IHandleEvent.cs index 58ce45a2..e3b77819 100644 --- a/src/MineCase.Client.Engine/IHandle.cs +++ b/src/MineCase.Client.Engine/IHandleEvent.cs @@ -9,7 +9,7 @@ namespace MineCase.Engine /// 处理消息接口 /// /// 消息类型 - public interface IHandle + public interface IHandleEvent { /// /// 处理消息 diff --git a/src/MineCase.Client.Engine/KeepAliveLazy.cs b/src/MineCase.Client.Engine/KeepAliveLazy.cs index b3fbe7ad..f43f2756 100644 --- a/src/MineCase.Client.Engine/KeepAliveLazy.cs +++ b/src/MineCase.Client.Engine/KeepAliveLazy.cs @@ -11,7 +11,7 @@ namespace MineCase.Engine /// 防止对象被回收的延迟初始化器 /// /// 对象类型 - public sealed class KeepAliveLazy : MonoBehaviour + public sealed class KeepAliveLazy where T : MonoBehaviour { /// @@ -39,7 +39,7 @@ public KeepAliveLazy(bool isThreadSafe) () => { var containerObject = new GameObject(typeof(T).Name, typeof(T)); - DontDestroyOnLoad(containerObject); + UnityEngine.Object.DontDestroyOnLoad(containerObject); return new ValuePair { Container = containerObject, Value = containerObject.GetComponent() }; }, isThreadSafe); } @@ -47,10 +47,10 @@ public KeepAliveLazy(bool isThreadSafe) private void OnApplicationQuit() { if (_containerObject.IsValueCreated && _containerObject.Value.Container) - Destroy(_containerObject.Value.Container); + UnityEngine.Object.Destroy(_containerObject.Value.Container); } - private struct ValuePair + private class ValuePair { public GameObject Container; diff --git a/src/MineCase.Client.Engine/Messages/OnAnimatorIK.cs b/src/MineCase.Client.Engine/Messages/OnAnimatorIK.cs new file mode 100644 index 00000000..de1be7d0 --- /dev/null +++ b/src/MineCase.Client.Engine/Messages/OnAnimatorIK.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MineCase.Engine.Messages +{ + /// + /// IK + /// + public sealed class OnAnimatorIK : IEntityMessage + { + /// + /// LyaerIndex + /// + public int LayerIndex { get; set; } + } +} diff --git a/src/MineCase.Client.Engine/Messages/Update.cs b/src/MineCase.Client.Engine/Messages/Update.cs new file mode 100644 index 00000000..857d94e7 --- /dev/null +++ b/src/MineCase.Client.Engine/Messages/Update.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MineCase.Engine.Messages +{ + /// + /// 每帧调用 + /// + public sealed class Update : IEntityMessage + { + /// + /// 默认 + /// + public static readonly Update Default = new Update(); + } +} diff --git a/src/MineCase.Client.Engine/MineCase.Client.Engine.csproj b/src/MineCase.Client.Engine/MineCase.Client.Engine.csproj index 0fb6e4ba..064e104a 100644 --- a/src/MineCase.Client.Engine/MineCase.Client.Engine.csproj +++ b/src/MineCase.Client.Engine/MineCase.Client.Engine.csproj @@ -5,18 +5,29 @@ MineCase.Engine true ../../build/Analyzers.ruleset + latest + Debug;Release;Appveyor;TravisCI bin\Debug\net46\MineCase.Client.Engine.xml - latest - full - true bin\Release\net46\MineCase.Client.Engine.xml - latest + + + + bin\Release\net46\MineCase.Client.Engine.xml + + + + bin\Release\net46\MineCase.Client.Engine.xml + + + + full + true @@ -30,6 +41,24 @@ + + + + + + + + + + + + + + + + + + True @@ -45,6 +74,10 @@ + + + + diff --git a/src/MineCase.Client.Engine/Threading/CoroutineAwaiter.cs b/src/MineCase.Client.Engine/Threading/CoroutineAwaiter.cs new file mode 100644 index 00000000..fa8ec87c --- /dev/null +++ b/src/MineCase.Client.Engine/Threading/CoroutineAwaiter.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using UnityEngine; + +namespace MineCase.Engine.Threading +{ + /// + /// 协程等待器构造器 + /// + public sealed class CoroutineAwaiterBuilder : MonoBehaviour + { + private static readonly KeepAliveLazy _instance = new KeepAliveLazy(); + + /// + /// 获取单例 + /// + public static CoroutineAwaiterBuilder Current => _instance.Value; + + internal void Scheduler(IEnumerator enumerator, Action continuation) + { + Execute.OnMainThreadAsync(() => StartCoroutine(ExecuteCoroutine(enumerator, continuation))); + } + + private IEnumerator ExecuteCoroutine(IEnumerator enumerator, Action continuation) + { + yield return enumerator; + continuation(); + } + } + + /// + /// 协程等待器 + /// + public struct CoroutineAwaiter : INotifyCompletion + where T : IEnumerator + { + private T _enumerator; + + /// + /// 获取是否完成 + /// + public bool IsCompleted => false; + + /// + /// 获取结果 + /// + /// 结果 + public T GetResult() => _enumerator; + + internal CoroutineAwaiter(T enumerator) + { + _enumerator = enumerator; + } + + /// + public void OnCompleted(Action continuation) + { + CoroutineAwaiterBuilder.Current.Scheduler(_enumerator, continuation); + } + } +} diff --git a/src/MineCase.Client.Engine/Threading/CoroutineExtensions.cs b/src/MineCase.Client.Engine/Threading/CoroutineExtensions.cs new file mode 100644 index 00000000..724723dd --- /dev/null +++ b/src/MineCase.Client.Engine/Threading/CoroutineExtensions.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using MineCase.Engine.Threading; +using UnityEngine; + +/// +/// 协程扩展 +/// +public static class CoroutineExtensions +{ + /// + /// 获取等待器 + /// + /// 操作 + /// 等待器 + public static CoroutineAwaiter GetAwaiter(this T source) + where T : CustomYieldInstruction + { + return new CoroutineAwaiter(source); + } +} \ No newline at end of file diff --git a/src/MineCase.Client.Scripts/AppBootstrapper.cs b/src/MineCase.Client.Scripts/AppBootstrapper.cs index 20d85a4b..5b60aa56 100644 --- a/src/MineCase.Client.Scripts/AppBootstrapper.cs +++ b/src/MineCase.Client.Scripts/AppBootstrapper.cs @@ -25,6 +25,7 @@ public AppBootstrapper() protected override void ConfigureApplicationParts(ICollection assemblies) { + assemblies.AddEngine(); assemblies.Add(typeof(AppBootstrapper).Assembly); } } diff --git a/src/MineCase.Client.Scripts/Game/Blocks/BlockTextureLoader.cs b/src/MineCase.Client.Scripts/Game/Blocks/BlockTextureLoader.cs index e032c72b..bdc46af0 100644 --- a/src/MineCase.Client.Scripts/Game/Blocks/BlockTextureLoader.cs +++ b/src/MineCase.Client.Scripts/Game/Blocks/BlockTextureLoader.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -15,47 +16,42 @@ public interface IBlockTextureLoader Dictionary TextureOffsets { get; } - void Initialize(Material cubeMaterial); + Task Initialize(Material cubeMaterial); Vector2 GetCubeUV(Vector2Int coord, BlockHandler.BlockFace face, int vertexIndex); } internal class BlockTextureLoader : IBlockTextureLoader { - private static readonly string[] _textureNames = new[] - { - "stone", - "grass_side", - "grass_top", - "dirt", - "water_overlay", - "planks_oak", - "log_oak", - "leaves_oak" - }; - public Dictionary TextureOffsets { get; } = new Dictionary(); public Vector2Int TextureSize { get; private set; } public Texture2D Texture { get; private set; } - public void Initialize(Material cubeMaterial) + public async Task Initialize(Material cubeMaterial) { const int maxWidth = 1024; - var height = (int)Math.Ceiling((float)_textureNames.Length / (maxWidth / 16)) * 16; + + int x = 0, y = 0; + var textureFiles = Directory.EnumerateFiles(Path.Combine(Application.streamingAssetsPath, "textures/blocks/"), "*.png").ToList(); + var height = (int)Math.Ceiling((float)textureFiles.Count / (maxWidth / 16)) * 16; var texture = new Texture2D(maxWidth, height, TextureFormat.ARGB32, true) { filterMode = FilterMode.Bilinear, alphaIsTransparency = true }; - int x = 0, y = 0; - foreach (var texName in _textureNames) + foreach (var texFile in textureFiles) { - var tex = Resources.Load("textures/blocks/" + texName); - texture.SetPixels(x, y, 16, 16, tex.GetPixels()); - TextureOffsets.Add(texName, new Vector2Int(x, y)); + using (var www = new WWW(texFile)) + { + await www; + var tex = www.texture; + texture.SetPixels(x, y, 16, 16, tex.GetPixels()); + } + + TextureOffsets.Add(Path.GetFileNameWithoutExtension(texFile), new Vector2Int(x, y)); x += 16; if (x >= maxWidth) diff --git a/src/MineCase.Client.Scripts/Game/Entities/Components/PlayerInputTranslatorComponent.cs b/src/MineCase.Client.Scripts/Game/Entities/Components/PlayerInputTranslatorComponent.cs new file mode 100644 index 00000000..2739ad0a --- /dev/null +++ b/src/MineCase.Client.Scripts/Game/Entities/Components/PlayerInputTranslatorComponent.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Autofac; +using MineCase.Client.Messages; +using MineCase.Engine; +using MineCase.Engine.Messages; +using UnityEngine; + +namespace MineCase.Client.Game.Entities.Components +{ + /// + /// 玩家输入翻译组件 + /// + public class PlayerInputTranslatorComponent : Component, IHandle + { + private bool _isEnableCursorLock = true; + private bool _isCursorLocked = false; + + private IEventAggregator _eventAggregator; + + public PlayerInputTranslatorComponent(string name = "playerInputTranslator") + : base(name) + { + } + + protected override void OnAttached() + { + _eventAggregator = ServiceProvider.Resolve(); + } + + void IHandle.Handle(Update message) + { + if (_isEnableCursorLock) + UpdateMouseLock(); + + if (Cursor.lockState == CursorLockMode.Locked) + { + var horizontalMovement = Input.GetAxis("Horizontal"); + var verticalMovement = Input.GetAxis("Vertical"); + + if (horizontalMovement != 0 || verticalMovement != 0) + AttachedObject.Tell(new PositionMove { Horizontal = horizontalMovement, Vertical = verticalMovement }); + + var mouseX = Input.GetAxis("Mouse X"); + var mouseY = Input.GetAxis("Mouse Y"); + if (mouseX != 0 || mouseY != 0) + _eventAggregator.PublishOnCurrentThread(new CursorMoveMessage { DeltaX = mouseX, DeltaY = mouseY }); + } + } + + private void UpdateMouseLock() + { + if (Input.GetKeyUp(KeyCode.Escape)) + _isCursorLocked = false; + else if (Input.GetMouseButtonUp(0)) + _isCursorLocked = true; + + if (_isCursorLocked) + { + Cursor.lockState = CursorLockMode.Locked; + Cursor.visible = false; + } + else if (!_isCursorLocked) + { + Cursor.lockState = CursorLockMode.None; + Cursor.visible = true; + } + } + } +} diff --git a/src/MineCase.Client.Scripts/Game/Entities/Components/PlayerMotorComponent.cs b/src/MineCase.Client.Scripts/Game/Entities/Components/PlayerMotorComponent.cs new file mode 100644 index 00000000..2650f493 --- /dev/null +++ b/src/MineCase.Client.Scripts/Game/Entities/Components/PlayerMotorComponent.cs @@ -0,0 +1,90 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using MineCase.Engine; +using MineCase.Engine.Messages; +using MineCase.World; +using UnityEngine; + +namespace MineCase.Client.Game.Entities.Components +{ + /// + /// 玩家移动和动作 + /// + public class PlayerMotorComponent : Component, + IHandle, IHandle, IHandle, IHandle + { + public static readonly DependencyProperty SpeedProperty = + DependencyProperty.Register(nameof(Speed), typeof(PlayerMotorComponent), new PropertyMetadata(0.3f)); + + /// + /// 移动速度 + /// + public float Speed + { + get => AttachedObject.GetValue(SpeedProperty); + set => AttachedObject.SetLocalValue(SpeedProperty, value); + } + + private Rigidbody _rigidbody; + private Animator _animator; + + private Vector3? _lookAt; + private ChunkWorldPos? _lastChunkWorldPos; + + public PlayerMotorComponent(string name = "playerMotor") + : base(name) + { + } + + protected override void OnAttached() + { + _rigidbody = AttachedObject.GetUnityComponent(); + _animator = AttachedObject.GetUnityComponent(); + } + + void IHandle.Handle(Update message) + { + if (_lookAt is Vector3 lookAt) + { + var forward = lookAt - AttachedObject.transform.position; + forward.y = 0; + _rigidbody.transform.rotation = Quaternion.LookRotation(forward); + } + + var position = AttachedObject.transform.position; + var chunkWorldPos = new EntityWorldPos(position.x, position.y, position.z).ToChunkWorldPos(); + if (_lastChunkWorldPos != chunkWorldPos) + { + _lastChunkWorldPos = chunkWorldPos; + } + } + + void IHandle.Handle(LookAt message) + { + _lookAt = message.Position; + } + + void IHandle.Handle(PositionMove message) + { + var velocity = (AttachedObject.transform.forward * message.Vertical + AttachedObject.transform.right * message.Horizontal) * Speed; + _animator.SetFloat("Speed", velocity.magnitude); + _animator.SetFloat("PosX", message.Horizontal); + _animator.SetFloat("PosY", message.Vertical); + + // velocity.y = _rigidbody.velocity.y; + _rigidbody.velocity = velocity; + } + + void IHandle.Handle(OnAnimatorIK message) + { + if (_lookAt is Vector3 lookAt) + { + _animator.SetLookAtWeight(1); + _animator.SetLookAtPosition(lookAt); + } + } + } +} diff --git a/src/MineCase.Client.Scripts/Game/Entities/Entity.cs b/src/MineCase.Client.Scripts/Game/Entities/Entity.cs new file mode 100644 index 00000000..888b3a99 --- /dev/null +++ b/src/MineCase.Client.Scripts/Game/Entities/Entity.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using MineCase.Engine; + +namespace MineCase.Client.Game.Entities +{ + public abstract class Entity : DependencyObject + { + } +} diff --git a/src/MineCase.Client.Scripts/Game/Entities/EntityMessages.cs b/src/MineCase.Client.Scripts/Game/Entities/EntityMessages.cs new file mode 100644 index 00000000..5a04668c --- /dev/null +++ b/src/MineCase.Client.Scripts/Game/Entities/EntityMessages.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using MineCase.Engine; +using UnityEngine; + +namespace MineCase.Client.Game.Entities +{ + public sealed class PositionMove : IEntityMessage + { + public float Horizontal { get; set; } + + public float Vertical { get; set; } + } + + public sealed class LookAt : IEntityMessage + { + public Vector3 Position { get; set; } + } +} diff --git a/src/MineCase.Client.Scripts/Game/Entities/PlayerEntity.cs b/src/MineCase.Client.Scripts/Game/Entities/PlayerEntity.cs new file mode 100644 index 00000000..7428f332 --- /dev/null +++ b/src/MineCase.Client.Scripts/Game/Entities/PlayerEntity.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using MineCase.Client.Game.Entities.Components; + +namespace MineCase.Client.Game.Entities +{ + public class PlayerEntity : Entity + { + protected override void InitializeComponents() + { + base.InitializeComponents(); + SetComponent(new PlayerInputTranslatorComponent()); + SetComponent(new PlayerMotorComponent()); + } + } +} diff --git a/src/MineCase.Client.Scripts/GameBootstrapper.cs b/src/MineCase.Client.Scripts/GameBootstrapper.cs index f222c6fa..0736bf57 100644 --- a/src/MineCase.Client.Scripts/GameBootstrapper.cs +++ b/src/MineCase.Client.Scripts/GameBootstrapper.cs @@ -15,16 +15,17 @@ public class GameBootstrapper : SmartBehaviour public Material CubeMaterial; - private void Start() + private async void Start() { - BlockTextureLoader.Initialize(CubeMaterial); + await BlockTextureLoader.Initialize(CubeMaterial); FindObjectOfType().ConnectServer(0, false); } private void OnGUI() { - GUI.DrawTexture(new Rect(0, 0, 1024, 16), BlockTextureLoader.Texture); + if (BlockTextureLoader.Texture) + GUI.DrawTexture(new Rect(0, 0, 1024, 16), BlockTextureLoader.Texture); } } } diff --git a/src/MineCase.Client.Scripts/InputController.cs b/src/MineCase.Client.Scripts/InputController.cs deleted file mode 100644 index 5c7bd76e..00000000 --- a/src/MineCase.Client.Scripts/InputController.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using MineCase.Client.Messages; -using MineCase.Engine; -using UnityEngine; - -namespace MineCase.Client -{ - public class InputController : SmartBehaviour - { - public IEventAggregator EventAggregator { get; set; } - - private float _mouseX; - private float _mouseY; - - private void Start() - { - _mouseX = Input.mousePosition.x; - _mouseY = Input.mousePosition.y; - } - - private void FixedUpdate() - { - var horizontalMovement = Input.GetAxis("Horizontal"); - var verticalMovement = Input.GetAxis("Vertical"); - - if (horizontalMovement != 0 || verticalMovement != 0) - EventAggregator.PublishOnCurrentThread(new PositionMoveMessage { Horizontal = horizontalMovement, Vertical = verticalMovement }); - - var mouseX = Input.mousePosition.x; - var mouseY = Input.mousePosition.y; - var deltaMouseX = mouseX - _mouseX; - var deltaMouseY = mouseY - _mouseY; - if (deltaMouseX != 0 || deltaMouseY != 0) - EventAggregator.PublishOnCurrentThread(new CursorMoveMessage { DeltaX = deltaMouseX, DeltaY = deltaMouseY }); - _mouseX = mouseX; - _mouseY = mouseY; - } - } -} diff --git a/src/MineCase.Client.Scripts/Messages/PositionMoveMessage.cs b/src/MineCase.Client.Scripts/Messages/PositionMoveMessage.cs deleted file mode 100644 index b040b3e5..00000000 --- a/src/MineCase.Client.Scripts/Messages/PositionMoveMessage.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace MineCase.Client.Messages -{ - internal class PositionMoveMessage - { - public float Horizontal { get; set; } - - public float Vertical { get; set; } - } -} diff --git a/src/MineCase.Client.Scripts/MineCase.Client.Scripts.csproj b/src/MineCase.Client.Scripts/MineCase.Client.Scripts.csproj index ec825e63..1cb0872a 100644 --- a/src/MineCase.Client.Scripts/MineCase.Client.Scripts.csproj +++ b/src/MineCase.Client.Scripts/MineCase.Client.Scripts.csproj @@ -7,9 +7,10 @@ ../../build/Analyzers.ruleset latest portable-net45+win8+wpa81 + Debug;Release;Appveyor;TravisCI - + full true diff --git a/src/MineCase.Client.Scripts/Network/Play/ClientboundPacketComponent.cs b/src/MineCase.Client.Scripts/Network/Play/ClientboundPacketComponent.cs index 59eb0f5d..b364cb0c 100644 --- a/src/MineCase.Client.Scripts/Network/Play/ClientboundPacketComponent.cs +++ b/src/MineCase.Client.Scripts/Network/Play/ClientboundPacketComponent.cs @@ -1,8 +1,10 @@ using System; +using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using MineCase.Client.Messages; using MineCase.Client.World; @@ -15,25 +17,34 @@ namespace MineCase.Client.Network.Play { - public class ClientboundPacketComponent : SmartBehaviour, IHandle + public class ClientboundPacketComponent : SmartBehaviour, IHandleEvent { public IEventAggregator EventAggregator { get; set; } - private Queue _deferredPacket; + private ConcurrentQueue _deferredPacket; + private Timer _dispatchTimer; + private UserChunkLoaderComponent _chunkLoader; private void Start() { - _deferredPacket = new Queue(); + _deferredPacket = new ConcurrentQueue(); EventAggregator.Subscribe(this); + _dispatchTimer = new Timer(s => OnDispatcherTick().Wait(), null, TimeSpan.Zero, TimeSpan.FromSeconds(0.02)); + _chunkLoader = FindObjectOfType(); } - private void FixedUpdate() + private void OnDestroy() { - while (_deferredPacket.Count != 0) - DispatchPacket((dynamic)_deferredPacket.Dequeue()); + _dispatchTimer.Dispose(); } - private void DispatchPacket(object packet) + private async Task OnDispatcherTick() + { + while (_deferredPacket.TryDequeue(out var packet)) + await DispatchPacket((dynamic)packet); + } + + private Task DispatchPacket(object packet) { throw new NotImplementedException(); } @@ -64,46 +75,45 @@ private object DeserializePlayPacket(UncompressedPacket packet) return innerPacket; } - void IHandle.Handle(ClientboundPacketMessage message) + void IHandleEvent.Handle(ClientboundPacketMessage message) { var packet = DeserializePlayPacket(message.Packet); if (packet != null) _deferredPacket.Enqueue(packet); } - private void DispatchPacket(EntityLookAndRelativeMove packet) + private Task DispatchPacket(EntityLookAndRelativeMove packet) { + return Task.CompletedTask; } - private async void DispatchPacket(ChunkData packet) + private Task DispatchPacket(ChunkData packet) { var column = new ChunkColumnCompactStorage(packet.Biomes); - await Task.Run(() => + var mask = packet.PrimaryBitMask; + int index = 0; + int srcIndex = 0; + while (index < ChunkConstants.SectionsPerChunk) { - var mask = packet.PrimaryBitMask; - int index = 0; - int srcIndex = 0; - while (index < ChunkConstants.SectionsPerChunk) + if ((mask & 1) == 1) { - if ((mask & 1) == 1) - { - var src = packet.Data[srcIndex]; - column.Sections[index] = new ChunkSectionCompactStorage( - new ChunkSectionCompactStorage.DataArray(src.DataArray), - new ChunkSectionCompactStorage.NibbleArray(src.BlockLight), - src.SkyLight != null ? new ChunkSectionCompactStorage.NibbleArray(src.SkyLight) : null); - srcIndex++; - } - - mask >>= 1; - index++; + var src = packet.Data[srcIndex]; + column.Sections[index] = new ChunkSectionCompactStorage( + new ChunkSectionCompactStorage.DataArray(src.DataArray), + new ChunkSectionCompactStorage.NibbleArray(src.BlockLight), + src.SkyLight != null ? new ChunkSectionCompactStorage.NibbleArray(src.SkyLight) : null); + srcIndex++; } - System.Diagnostics.Debug.Assert(packet.PrimaryBitMask == column.SectionBitMask, "PrimaryBitMask must be equal."); - }); + mask >>= 1; + index++; + } + + System.Diagnostics.Debug.Assert(packet.PrimaryBitMask == column.SectionBitMask, "PrimaryBitMask must be equal."); + + _chunkLoader.LoadTerrain(packet.ChunkX, packet.ChunkZ, column); - var loader = FindObjectOfType(); - loader.LoadTerrain(packet.ChunkX, packet.ChunkZ, column); + return Task.CompletedTask; } } diff --git a/src/MineCase.Client.Scripts/PlayerMovement.cs b/src/MineCase.Client.Scripts/PlayerMovement.cs deleted file mode 100644 index 38bd48d8..00000000 --- a/src/MineCase.Client.Scripts/PlayerMovement.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using MineCase.Client.Messages; -using MineCase.Engine; -using UnityEngine; - -namespace MineCase.Client -{ - [RequireComponent(typeof(Rigidbody), typeof(Animator))] - public class PlayerMovement : SmartBehaviour, IHandle - { - public float Speed = 0.3f; - - public IEventAggregator EventAggregator { get; set; } - - private Rigidbody _rigidbody; - private Animator _animator; - - private void Start() - { - _rigidbody = GetComponent(); - _animator = GetComponent(); - EventAggregator.Subscribe(this); - } - - void IHandle.Handle(PositionMoveMessage message) - { - var velocity = (transform.forward * message.Vertical + transform.right * message.Horizontal) * Speed; - _animator.SetFloat("Speed", velocity.magnitude); - _animator.SetFloat("PosX", message.Horizontal); - _animator.SetFloat("PosY", message.Vertical); - - // velocity.y = _rigidbody.velocity.y; - _rigidbody.velocity = velocity; - } - - private void FixedUpdate() - { - var forward = _lookAt - transform.position; - forward.y = 0; - _rigidbody.transform.rotation = Quaternion.LookRotation(forward); - } - - private Vector3 _lookAt; - - public void SetLookAtPosition(Vector3 lookAt) - { - _lookAt = lookAt; - } - - private void OnAnimatorIK(int layerIndex) - { - _animator.SetLookAtWeight(1); - _animator.SetLookAtPosition(_lookAt); - } - } -} diff --git a/src/MineCase.Client.Scripts/ThirdPersonCameraController.cs b/src/MineCase.Client.Scripts/ThirdPersonCameraController.cs index 0523d10b..17c007b5 100644 --- a/src/MineCase.Client.Scripts/ThirdPersonCameraController.cs +++ b/src/MineCase.Client.Scripts/ThirdPersonCameraController.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using MineCase.Client.Game.Entities; using MineCase.Client.Messages; using MineCase.Engine; using UnityEngine; @@ -10,59 +11,45 @@ namespace MineCase.Client { [RequireComponent(typeof(Camera))] - public class ThirdPersonCameraController : SmartBehaviour, IHandle + public class ThirdPersonCameraController : SmartBehaviour, IHandleEvent { public float RotateFactor = 0.1f; - public float Backward = 2; + public float Distance; + public Vector3 Forward; + public DependencyObject Player; public IEventAggregator EventAggregator { get; set; } private Camera _camera; - private Transform _player; - private PlayerMovement _playerMovement; - private float _height; - - private float _rotateX; - private float _rotateY; + private Vector3 _angles; private void Start() { _camera = GetComponent(); - var player = GameObject.FindGameObjectWithTag("Player"); - _player = player.transform; - _playerMovement = player.GetComponent(); - _height = (transform.position - _player.position).y; - _rotateX = transform.localRotation.eulerAngles.x; - _rotateY = transform.localRotation.eulerAngles.y; - UpdateLookAt(); EventAggregator.Subscribe(this); } private void LateUpdate() { - transform.position = new Vector3(0, _height, 0) + _player.position + GetForward() * -Backward; + transform.eulerAngles = _angles; + transform.position = Player.transform.position - (transform.localRotation * Forward * Distance); } - private Vector3 GetForward() + void IHandleEvent.Handle(CursorMoveMessage message) { - var forward = transform.forward; - forward.y = 0; - return forward.normalized; - } + var angles = transform.localEulerAngles; + angles.y += message.DeltaX * RotateFactor; + angles.x += -message.DeltaY * RotateFactor; + _angles = angles; - void IHandle.Handle(CursorMoveMessage message) - { - _rotateY += message.DeltaX * RotateFactor; - _rotateX += -message.DeltaY * RotateFactor; - transform.localRotation = Quaternion.Euler(_rotateX, _rotateY, 0); UpdateLookAt(); } private void UpdateLookAt() { - var lookAt = transform.forward * 50 + transform.position; - _playerMovement.SetLookAtPosition(lookAt); + var lookAt = Quaternion.Euler(_angles) * Forward * 50 + transform.position; + Player.Tell( new LookAt { Position = lookAt }); } } } diff --git a/src/MineCase.Client.Scripts/World/ChunkColumnTerrainMeshUpdater.cs b/src/MineCase.Client.Scripts/World/ChunkColumnTerrainMeshUpdater.cs index d8f93439..d936784c 100644 --- a/src/MineCase.Client.Scripts/World/ChunkColumnTerrainMeshUpdater.cs +++ b/src/MineCase.Client.Scripts/World/ChunkColumnTerrainMeshUpdater.cs @@ -4,6 +4,7 @@ using System.Text; using System.Threading.Tasks; using MineCase.Client.Game.Blocks; +using MineCase.Engine; using MineCase.World; using UnityEngine; @@ -11,20 +12,37 @@ namespace MineCase.Client.World { public class ChunkColumnTerrainMeshUpdater : MonoBehaviour { - public ChunkSectionTerrainMeshUpdater[] Sections; + public GameObject Section; - private void Start() + private readonly ChunkSectionTerrainMeshUpdater[] _sections = new ChunkSectionTerrainMeshUpdater[16]; + + public void LoadFromChunkData(int chunkX, int chunkZ, ChunkColumnCompactStorage column, NeighborColumns neighborColumns) { - if (Sections.Length != 16) - Debug.LogError("Count of sections must be 16."); + for (int i = 0; i < 16; i++) + { + var src = column.Sections[i]; + if (src != null) + InstantiateSection(i, src, column, neighborColumns); + } } - public async void LoadFromChunkData(int chunkX, int chunkZ, ChunkColumnCompactStorage column, NeighborColumns neighborColumns) + private ChunkSectionTerrainMeshUpdater InstantiateSection(int y, ChunkSectionCompactStorage src, ChunkColumnCompactStorage column, NeighborColumns neighborColumns) { - await Task.WhenAll(from i in Enumerable.Range(0, 16) - let src = column.Sections[i] - where src != null - select Sections[i].LoadFromSectionData(src, FindNeighborSections(column, neighborColumns, i))); + var updater = _sections[y]; + if (!updater) + { + Execute.OnMainThread(() => + { + var go = Instantiate(Section, transform); + go.name = "Section " + y; + go.transform.localPosition = new Vector3(0, y * 16, 0); + updater = go.GetComponent(); + }); + _sections[y] = updater; + } + + updater.LoadFromSectionData(src, FindNeighborSections(column, neighborColumns, y)); + return updater; } private NeighborSections FindNeighborSections(ChunkColumnCompactStorage column, NeighborColumns neighborColumns, int y) diff --git a/src/MineCase.Client.Scripts/World/ChunkSectionTerrainMeshUpdater.cs b/src/MineCase.Client.Scripts/World/ChunkSectionTerrainMeshUpdater.cs index 330a621c..e6d193db 100644 --- a/src/MineCase.Client.Scripts/World/ChunkSectionTerrainMeshUpdater.cs +++ b/src/MineCase.Client.Scripts/World/ChunkSectionTerrainMeshUpdater.cs @@ -13,73 +13,100 @@ namespace MineCase.Client.World [RequireComponent(typeof(MeshFilter), typeof(MeshCollider))] public class ChunkSectionTerrainMeshUpdater : SmartBehaviour { - private Mesh _columnMesh; private MeshFilter _meshFilter; private MeshCollider _meshCollider; + private BuildResult _buildResult; + private UserChunkLoaderComponent _chunkLoader; protected override void Awake() { base.Awake(); _meshFilter = GetComponent(); _meshCollider = GetComponent(); + _chunkLoader = FindObjectOfType(); } - public async Task LoadFromSectionData(ChunkSectionCompactStorage section, NeighborSections neighbor) + public void LoadFromSectionData(ChunkSectionCompactStorage section, NeighborSections neighbor) { - _columnMesh = await BuildMesh(section, neighbor); - _meshFilter.mesh = _columnMesh; - _meshCollider.sharedMesh = _meshFilter.sharedMesh; + _buildResult = BuildMesh(section, neighbor); + _chunkLoader.QueueSectionUpdate(this); } - private async Task BuildMesh(ChunkSectionCompactStorage section, NeighborSections neighbor) + private BuildResult BuildMesh(ChunkSectionCompactStorage section, NeighborSections neighbor) { - var mesh = new Mesh { name = "Chunk Section" }; - var result = await Task.Run(() => + // 计算面总数 + int planeCount = 0; + for (int z = 0; z < ChunkConstants.BlockEdgeWidthInSection; z++) { - // 计算面总数 - int planeCount = 0; - for (int z = 0; z < ChunkConstants.BlockEdgeWidthInSection; z++) + for (int y = 0; y < ChunkConstants.BlockEdgeWidthInSection; y++) { - for (int y = 0; y < ChunkConstants.BlockEdgeWidthInSection; y++) + for (int x = 0; x < ChunkConstants.BlockEdgeWidthInSection; x++) { - for (int x = 0; x < ChunkConstants.BlockEdgeWidthInSection; x++) - { - var blockHandler = BlockHandler.Create((BlockId)section.Data[x, y, z].Id, ServiceProvider); - planeCount += blockHandler.CalculatePlanesCount(new Vector3Int(x, y, z), section, neighbor); - } + var blockHandler = BlockHandler.Create((BlockId)section.Data[x, y, z].Id, ServiceProvider); + planeCount += blockHandler.CalculatePlanesCount(new Vector3Int(x, y, z), section, neighbor); } } + } + + if (planeCount == 0) return null; - // 填充 Mesh - var vertices = new Vector3[planeCount * 4]; - var normals = new Vector3[planeCount * 4]; - var uvs = new Vector2[planeCount * 4]; - var triangles = new int[planeCount * 6]; - int planeIndex = 0; - for (int z = 0; z < ChunkConstants.BlockEdgeWidthInSection; z++) + // 填充 Mesh + var vertices = new Vector3[planeCount * 4]; + var normals = new Vector3[planeCount * 4]; + var uvs = new Vector2[planeCount * 4]; + var triangles = new int[planeCount * 6]; + int planeIndex = 0; + for (int z = 0; z < ChunkConstants.BlockEdgeWidthInSection; z++) + { + for (int y = 0; y < ChunkConstants.BlockEdgeWidthInSection; y++) { - for (int y = 0; y < ChunkConstants.BlockEdgeWidthInSection; y++) + for (int x = 0; x < ChunkConstants.BlockEdgeWidthInSection; x++) { - for (int x = 0; x < ChunkConstants.BlockEdgeWidthInSection; x++) - { - var blockHandler = BlockHandler.Create((BlockId)section.Data[x, y, z].Id, ServiceProvider); - blockHandler.CreateMesh(vertices, normals, uvs, triangles, ref planeIndex, new Vector3Int(x, y, z), section, neighbor); - } + var blockHandler = BlockHandler.Create((BlockId)section.Data[x, y, z].Id, ServiceProvider); + blockHandler.CreateMesh(vertices, normals, uvs, triangles, ref planeIndex, new Vector3Int(x, y, z), section, neighbor); } } + } + + return new BuildResult + { + Vertices = vertices, + Normals = normals, + UVs = uvs, + Triangles = triangles + }; + } + + public void InstallMesh() + { + Mesh mesh; + if (_buildResult is BuildResult buildResult) + { + mesh = new Mesh { name = "Chunk Section" }; + + mesh.vertices = buildResult.Vertices; + mesh.normals = buildResult.Normals; + mesh.uv = buildResult.UVs; + mesh.triangles = buildResult.Triangles; + } + else + { + mesh = null; + } + + _meshFilter.mesh = mesh; + _meshCollider.sharedMesh = _meshFilter.sharedMesh; + } + + private class BuildResult + { + public Vector3[] Vertices; - return (vertices, normals, uvs, triangles); - }); + public Vector3[] Normals; - if (result.vertices.Length == 0) return null; + public Vector2[] UVs; - mesh.vertices = result.vertices; - mesh.normals = result.normals; - mesh.uv = result.uvs; - mesh.triangles = result.triangles; - mesh.RecalculateBounds(); - mesh.RecalculateTangents(); - return mesh; + public int[] Triangles; } } } diff --git a/src/MineCase.Client.Scripts/World/UserChunkLoaderComponent.cs b/src/MineCase.Client.Scripts/World/UserChunkLoaderComponent.cs index ab63501c..fe4d539a 100644 --- a/src/MineCase.Client.Scripts/World/UserChunkLoaderComponent.cs +++ b/src/MineCase.Client.Scripts/World/UserChunkLoaderComponent.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Text; @@ -26,11 +27,22 @@ public class UserChunkLoaderComponent : SmartBehaviour private Dictionary _sections; private Dictionary _updater; + private ConcurrentQueue _deferredUpdater; private void Start() { _sections = new Dictionary(); _updater = new Dictionary(); + _deferredUpdater = new ConcurrentQueue(); + } + + private void Update() + { + if (_deferredUpdater.TryDequeue(out var updater)) + { + if (updater) + updater.InstallMesh(); + } } public void LoadTerrain(int chunkX, int chunkZ, ChunkColumnCompactStorage column) @@ -38,15 +50,26 @@ public void LoadTerrain(int chunkX, int chunkZ, ChunkColumnCompactStorage column var key = new Vector2Int(chunkX, chunkZ); _sections.Add(key, column); - var go = Instantiate(ChunkColumn); - go.transform.position = new Vector3(chunkX * 16, 0, chunkZ * 16); - var updater = go.GetComponentInChildren(); + var updater = InstantiateUpdater(chunkX, chunkZ); _updater.Add(key, updater); - updater.LoadFromChunkData(chunkX, chunkZ, column, FindNeighborColumns(key)); + updater?.LoadFromChunkData(chunkX, chunkZ, column, FindNeighborColumns(key)); UpdateNeighborChunks(key); } + private ChunkColumnTerrainMeshUpdater InstantiateUpdater(int chunkX, int chunkZ) + { + ChunkColumnTerrainMeshUpdater updater = null; + Execute.OnMainThread(() => + { + var go = Instantiate(ChunkColumn); + go.name = $"Chunk Column ({chunkX}, {chunkZ})"; + go.transform.position = new Vector3(chunkX * 16, 0, chunkZ * 16); + updater = go.GetComponentInChildren(); + }); + return updater; + } + private static readonly Vector2Int[] _neighbors = new[] { new Vector2Int(-1, 0), @@ -74,7 +97,15 @@ private void UpdateNeighborChunks(Vector2Int origin) private void TryUpdateChunk(Vector2Int key) { if (_updater.TryGetValue(key, out var updater) && _sections.TryGetValue(key, out var column)) - updater.LoadFromChunkData(key.x, key.y, column, FindNeighborColumns(key)); + { + if (updater) + updater.LoadFromChunkData(key.x, key.y, column, FindNeighborColumns(key)); + } + } + + public void QueueSectionUpdate(ChunkSectionTerrainMeshUpdater updater) + { + _deferredUpdater.Enqueue(updater); } } } diff --git a/src/MineCase.Client/Assets/Materials/Blocks/CubeMaterial.mat b/src/MineCase.Client/Assets/Materials/Blocks/CubeMaterial.mat index ff62f701..30478806 100644 --- a/src/MineCase.Client/Assets/Materials/Blocks/CubeMaterial.mat +++ b/src/MineCase.Client/Assets/Materials/Blocks/CubeMaterial.mat @@ -7,7 +7,7 @@ Material: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: CubeMaterial - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_Shader: {fileID: 10703, guid: 0000000000000000f000000000000000, type: 0} m_ShaderKeywords: _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A m_LightmapFlags: 4 m_EnableInstancingVariants: 0 diff --git a/src/MineCase.Client/Assets/Models/Characters/Neptune_University/Tag.txt.meta b/src/MineCase.Client/Assets/Models/Characters/Neptune_University/Tag.txt.meta deleted file mode 100644 index bf93ac63..00000000 --- a/src/MineCase.Client/Assets/Models/Characters/Neptune_University/Tag.txt.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: a453b66cf59e9144b9f185aa0d4d0974 -timeCreated: 1510033492 -licenseType: Free -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/MineCase.Client/Assets/Prefabs/Cameras/3rd Person Camera.prefab b/src/MineCase.Client/Assets/Prefabs/Cameras/3rd Person Camera.prefab index c39e5fc7..d05b93ac 100644 --- a/src/MineCase.Client/Assets/Prefabs/Cameras/3rd Person Camera.prefab +++ b/src/MineCase.Client/Assets/Prefabs/Cameras/3rd Person Camera.prefab @@ -9,75 +9,46 @@ Prefab: m_Modifications: [] m_RemovedComponents: [] m_ParentPrefab: {fileID: 0} - m_RootGameObject: {fileID: 1236235886054236} + m_RootGameObject: {fileID: 1662786438690298} m_IsPrefabParent: 1 ---- !u!1 &1236235886054236 +--- !u!1 &1662786438690298 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4214199392695594} + - component: {fileID: 4207634367194882} + - component: {fileID: 20217756521099650} + - component: {fileID: 124734776929340208} + - component: {fileID: 81510775275246340} + - component: {fileID: 114323612625339220} m_Layer: 0 m_Name: 3rd Person Camera - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1403470781487774 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4689407607644116} - - component: {fileID: 20650348812242892} - - component: {fileID: 124903953340584436} - - component: {fileID: 81983909357913530} - - component: {fileID: 114165666393376846} - m_Layer: 0 - m_Name: Camera m_TagString: MainCamera m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &4214199392695594 +--- !u!4 &4207634367194882 Transform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1236235886054236} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_GameObject: {fileID: 1662786438690298} + 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: 4689407607644116} + m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4689407607644116 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1403470781487774} - m_LocalRotation: {x: 0.2164396, y: 0, z: 0, w: 0.97629607} - m_LocalPosition: {x: 0, y: 2, z: -2} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4214199392695594} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 25, y: 0, z: 0} ---- !u!20 &20650348812242892 +--- !u!20 &20217756521099650 Camera: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1403470781487774} + m_GameObject: {fileID: 1662786438690298} m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 1 @@ -107,30 +78,32 @@ Camera: m_OcclusionCulling: 1 m_StereoConvergence: 10 m_StereoSeparation: 0.022 ---- !u!81 &81983909357913530 +--- !u!81 &81510775275246340 AudioListener: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1403470781487774} + m_GameObject: {fileID: 1662786438690298} m_Enabled: 1 ---- !u!114 &114165666393376846 +--- !u!114 &114323612625339220 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1403470781487774} + m_GameObject: {fileID: 1662786438690298} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 1678687324, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} m_Name: m_EditorClassIdentifier: - RotateFactor: 0.1 - Backward: 2 ---- !u!124 &124903953340584436 + RotateFactor: 2 + Distance: 5 + Forward: {x: 0, y: -0.3, z: 1} + Player: {fileID: 0} +--- !u!124 &124734776929340208 Behaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1403470781487774} + m_GameObject: {fileID: 1662786438690298} m_Enabled: 1 diff --git a/src/MineCase.Client/Assets/Prefabs/Cameras/3rd Person Camera.prefab.meta b/src/MineCase.Client/Assets/Prefabs/Cameras/3rd Person Camera.prefab.meta index 124bfa31..d88cc6ca 100644 --- a/src/MineCase.Client/Assets/Prefabs/Cameras/3rd Person Camera.prefab.meta +++ b/src/MineCase.Client/Assets/Prefabs/Cameras/3rd Person Camera.prefab.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: 596ff959bcaba94439bf83e489e6df88 -timeCreated: 1510131536 +timeCreated: 1510905822 licenseType: Free NativeFormatImporter: externalObjects: {} diff --git a/src/MineCase.Client/Assets/Prefabs/Characters/Player.prefab b/src/MineCase.Client/Assets/Prefabs/Characters/Player.prefab index d28c10d1..13c8c695 100644 --- a/src/MineCase.Client/Assets/Prefabs/Characters/Player.prefab +++ b/src/MineCase.Client/Assets/Prefabs/Characters/Player.prefab @@ -862,7 +862,8 @@ GameObject: - component: {fileID: 54145064772072778} - component: {fileID: 95077649161029010} - component: {fileID: 65480175247349988} - - component: {fileID: 114804631580641650} + - component: {fileID: 114676870684462456} + - component: {fileID: 114347493614804378} m_Layer: 0 m_Name: Player m_TagString: Player @@ -2305,7 +2306,7 @@ Transform: m_PrefabInternal: {fileID: 100100000} m_GameObject: {fileID: 1638762341208800} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 0, y: 200, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 4907046634286622} @@ -2640,7 +2641,18 @@ Animator: m_WarningMessage: m_HasTransformHierarchy: 1 m_AllowConstantClipSamplingOptimization: 1 ---- !u!114 &114804631580641650 +--- !u!114 &114347493614804378 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1638762341208800} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -2119687982, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &114676870684462456 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} @@ -2648,10 +2660,9 @@ MonoBehaviour: m_GameObject: {fileID: 1638762341208800} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -1546901112, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} + m_Script: {fileID: -1904368855, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} m_Name: m_EditorClassIdentifier: - Speed: 1.5 --- !u!137 &137435094914731120 SkinnedMeshRenderer: m_ObjectHideFlags: 1 diff --git a/src/MineCase.Client/Assets/Prefabs/World/Chunk Column.prefab b/src/MineCase.Client/Assets/Prefabs/World/Chunk Column.prefab new file mode 100644 index 00000000..e3e075c6 --- /dev/null +++ b/src/MineCase.Client/Assets/Prefabs/World/Chunk Column.prefab @@ -0,0 +1,83 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &100100000 +Prefab: + m_ObjectHideFlags: 1 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: [] + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 0} + m_RootGameObject: {fileID: 1531037263760400} + m_IsPrefabParent: 1 +--- !u!1 &1531037263760400 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4194806676614656} + m_Layer: 0 + m_Name: Chunk Column + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1771171897821424 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4107652350377474} + - component: {fileID: 114015739515647220} + m_Layer: 0 + m_Name: Terrain + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 4294967295 + m_IsActive: 1 +--- !u!4 &4107652350377474 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1771171897821424} + 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: 4194806676614656} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4194806676614656 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1531037263760400} + 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: 4107652350377474} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &114015739515647220 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1771171897821424} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -266058236, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} + m_Name: + m_EditorClassIdentifier: + Section: {fileID: 1742492568048926, guid: fffaa1d7734868b4f9a53ea29f379701, type: 2} diff --git a/src/MineCase.Client/Assets/Prefabs/World/ChunkColumn.prefab.meta b/src/MineCase.Client/Assets/Prefabs/World/Chunk Column.prefab.meta similarity index 72% rename from src/MineCase.Client/Assets/Prefabs/World/ChunkColumn.prefab.meta rename to src/MineCase.Client/Assets/Prefabs/World/Chunk Column.prefab.meta index d656dced..6a22e025 100644 --- a/src/MineCase.Client/Assets/Prefabs/World/ChunkColumn.prefab.meta +++ b/src/MineCase.Client/Assets/Prefabs/World/Chunk Column.prefab.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: f25d2786733bdae438b9420312ed494d -timeCreated: 1510213008 +guid: e7a3eda308064cf4786d0e4e5da26170 +timeCreated: 1510910573 licenseType: Free NativeFormatImporter: externalObjects: {} diff --git a/src/MineCase.Client/Assets/Prefabs/World/Section.prefab b/src/MineCase.Client/Assets/Prefabs/World/Chunk Section.prefab similarity index 64% rename from src/MineCase.Client/Assets/Prefabs/World/Section.prefab rename to src/MineCase.Client/Assets/Prefabs/World/Chunk Section.prefab index 2dab02a7..b8ef77be 100644 --- a/src/MineCase.Client/Assets/Prefabs/World/Section.prefab +++ b/src/MineCase.Client/Assets/Prefabs/World/Chunk Section.prefab @@ -9,33 +9,34 @@ Prefab: m_Modifications: [] m_RemovedComponents: [] m_ParentPrefab: {fileID: 0} - m_RootGameObject: {fileID: 1282525747172824} + m_RootGameObject: {fileID: 1742492568048926} m_IsPrefabParent: 1 ---- !u!1 &1282525747172824 +--- !u!1 &1742492568048926 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} serializedVersion: 5 m_Component: - - component: {fileID: 4033647009111174} - - component: {fileID: 114639196096563040} - - component: {fileID: 33175936152927160} - - component: {fileID: 64371235821810322} - - component: {fileID: 23169192482329696} + - component: {fileID: 4132774981222766} + - component: {fileID: 114516153121856072} + - component: {fileID: 33589480341609490} + - component: {fileID: 64918294553600612} + - component: {fileID: 23471504109938214} + - component: {fileID: 205079557481491882} m_Layer: 0 - m_Name: Section + m_Name: Chunk Section m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 4294967295 m_IsActive: 1 ---- !u!4 &4033647009111174 +--- !u!4 &4132774981222766 Transform: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1282525747172824} + m_GameObject: {fileID: 1742492568048926} 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} @@ -43,16 +44,16 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!23 &23169192482329696 +--- !u!23 &23471504109938214 MeshRenderer: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1282525747172824} + m_GameObject: {fileID: 1742492568048926} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 - m_DynamicOccludee: 1 + m_DynamicOccludee: 0 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 @@ -77,19 +78,19 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 ---- !u!33 &33175936152927160 +--- !u!33 &33589480341609490 MeshFilter: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1282525747172824} + m_GameObject: {fileID: 1742492568048926} m_Mesh: {fileID: 0} ---- !u!64 &64371235821810322 +--- !u!64 &64918294553600612 MeshCollider: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1282525747172824} + m_GameObject: {fileID: 1742492568048926} m_Material: {fileID: 0} m_IsTrigger: 0 m_Enabled: 1 @@ -98,14 +99,36 @@ MeshCollider: m_InflateMesh: 0 m_SkinWidth: 0.01 m_Mesh: {fileID: 0} ---- !u!114 &114639196096563040 +--- !u!114 &114516153121856072 MonoBehaviour: m_ObjectHideFlags: 1 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1282525747172824} + m_GameObject: {fileID: 1742492568048926} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 293836631, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!205 &205079557481491882 +LODGroup: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1742492568048926} + serializedVersion: 2 + m_LocalReferencePoint: {x: 0, y: 0, z: 0} + m_Size: 1 + m_FadeMode: 0 + m_AnimateCrossFading: 0 + m_LODs: + - screenRelativeHeight: 0.6 + fadeTransitionWidth: 0 + renderers: [] + - screenRelativeHeight: 0.2932691 + fadeTransitionWidth: 0 + renderers: [] + - screenRelativeHeight: 0.2932691 + fadeTransitionWidth: 0 + renderers: [] + m_Enabled: 1 diff --git a/src/MineCase.Client/Assets/Prefabs/World/Section.prefab.meta b/src/MineCase.Client/Assets/Prefabs/World/Chunk Section.prefab.meta similarity index 72% rename from src/MineCase.Client/Assets/Prefabs/World/Section.prefab.meta rename to src/MineCase.Client/Assets/Prefabs/World/Chunk Section.prefab.meta index 4fdce2cc..6b187791 100644 --- a/src/MineCase.Client/Assets/Prefabs/World/Section.prefab.meta +++ b/src/MineCase.Client/Assets/Prefabs/World/Chunk Section.prefab.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 585b2b948b6dad54f8e26769d6c4cd6c -timeCreated: 1510567305 +guid: fffaa1d7734868b4f9a53ea29f379701 +timeCreated: 1510910542 licenseType: Free NativeFormatImporter: externalObjects: {} diff --git a/src/MineCase.Client/Assets/Prefabs/World/ChunkColumn.prefab b/src/MineCase.Client/Assets/Prefabs/World/ChunkColumn.prefab deleted file mode 100644 index c516e389..00000000 --- a/src/MineCase.Client/Assets/Prefabs/World/ChunkColumn.prefab +++ /dev/null @@ -1,2051 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1001 &100100000 -Prefab: - m_ObjectHideFlags: 1 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: [] - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 0} - m_RootGameObject: {fileID: 1348648599246774} - m_IsPrefabParent: 1 ---- !u!1 &1093017687423666 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4502107886127422} - - component: {fileID: 114717780566559962} - - component: {fileID: 33343939135882290} - - component: {fileID: 64464322911532466} - - component: {fileID: 23589331388608710} - - component: {fileID: 205183767392414250} - m_Layer: 0 - m_Name: Section 13 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 - m_IsActive: 1 ---- !u!1 &1096291444604246 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4411637646999276} - - component: {fileID: 114573579245577014} - m_Layer: 0 - m_Name: Terrain - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 - m_IsActive: 1 ---- !u!1 &1099003446746840 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4848110992237388} - - component: {fileID: 114108193977615794} - - component: {fileID: 33458740297933662} - - component: {fileID: 64834383328160780} - - component: {fileID: 23605289659754516} - - component: {fileID: 205150341313805360} - m_Layer: 0 - m_Name: Section 0 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 - m_IsActive: 1 ---- !u!1 &1159148333252780 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4247066696109944} - - component: {fileID: 114635928953488562} - - component: {fileID: 33111821447916412} - - component: {fileID: 64699261099143282} - - component: {fileID: 23306005102718860} - - component: {fileID: 205618829448221724} - m_Layer: 0 - m_Name: Section 11 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 - m_IsActive: 1 ---- !u!1 &1170552244504128 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4069638953826382} - - component: {fileID: 114984468567634750} - - component: {fileID: 33947527955105836} - - component: {fileID: 64151579110634336} - - component: {fileID: 23586190832616138} - - component: {fileID: 205323205377547896} - m_Layer: 0 - m_Name: Section 10 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 - m_IsActive: 1 ---- !u!1 &1227439600505194 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4883103945496908} - - component: {fileID: 114962631379735484} - - component: {fileID: 33522955186520922} - - component: {fileID: 64122332446340610} - - component: {fileID: 23778137726408762} - - component: {fileID: 205008874381329144} - m_Layer: 0 - m_Name: Section 6 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 - m_IsActive: 1 ---- !u!1 &1237598978954906 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4089708410960602} - - component: {fileID: 114790237890372730} - - component: {fileID: 33489707886651922} - - component: {fileID: 64712618632917560} - - component: {fileID: 23860286703489720} - - component: {fileID: 205004197136357866} - m_Layer: 0 - m_Name: Section 4 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 - m_IsActive: 1 ---- !u!1 &1348648599246774 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4551602630984984} - m_Layer: 0 - m_Name: ChunkColumn - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!1 &1363744574123962 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4562915269565828} - - component: {fileID: 114931655683420838} - - component: {fileID: 33817869356482106} - - component: {fileID: 64415869723138314} - - component: {fileID: 23684280632592160} - - component: {fileID: 205268476080829748} - m_Layer: 0 - m_Name: Section 14 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 - m_IsActive: 1 ---- !u!1 &1493255816159540 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4040235581136880} - - component: {fileID: 114851943176905836} - - component: {fileID: 33185160105346686} - - component: {fileID: 64227073932963100} - - component: {fileID: 23084303762524176} - - component: {fileID: 205366931365002406} - m_Layer: 0 - m_Name: Section 3 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 - m_IsActive: 1 ---- !u!1 &1553446549738648 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4892616066556696} - - component: {fileID: 114465527692468318} - - component: {fileID: 33456356436570144} - - component: {fileID: 64388345558348738} - - component: {fileID: 23564895399890064} - - component: {fileID: 205477994622601656} - m_Layer: 0 - m_Name: Section 5 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 - m_IsActive: 1 ---- !u!1 &1572818295343468 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4108225605267702} - - component: {fileID: 114460718510608184} - - component: {fileID: 33946093106118406} - - component: {fileID: 64445857359656814} - - component: {fileID: 23529173065208452} - - component: {fileID: 205508273579632260} - m_Layer: 0 - m_Name: Section 2 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 - m_IsActive: 1 ---- !u!1 &1594866333015846 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4704862311018224} - - component: {fileID: 114136834934121960} - - component: {fileID: 33602948998471248} - - component: {fileID: 64026003602846106} - - component: {fileID: 23564408641700382} - - component: {fileID: 205124124042364236} - m_Layer: 0 - m_Name: Section 9 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 - m_IsActive: 1 ---- !u!1 &1638042809995284 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4948520005843278} - - component: {fileID: 114324385966664540} - - component: {fileID: 33483486929777298} - - component: {fileID: 64929809874421966} - - component: {fileID: 23481493666706516} - - component: {fileID: 205350253188925612} - m_Layer: 0 - m_Name: Section 12 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 - m_IsActive: 1 ---- !u!1 &1737549353143626 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4790290825897472} - - component: {fileID: 114036256723541830} - - component: {fileID: 33080176048465496} - - component: {fileID: 64571302888625704} - - component: {fileID: 23988079779461170} - - component: {fileID: 205850766324421680} - m_Layer: 0 - m_Name: Section 7 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 - m_IsActive: 1 ---- !u!1 &1758826975978230 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4887052189818598} - - component: {fileID: 114482739527071702} - - component: {fileID: 33461098870068650} - - component: {fileID: 64255287239484890} - - component: {fileID: 23322867003270312} - - component: {fileID: 205164686500485532} - m_Layer: 0 - m_Name: Section 1 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 - m_IsActive: 1 ---- !u!1 &1852373451543530 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4830198953157648} - - component: {fileID: 114260441331723260} - - component: {fileID: 33372776512740876} - - component: {fileID: 64221296465520630} - - component: {fileID: 23205197557020622} - - component: {fileID: 205699259530301888} - m_Layer: 0 - m_Name: Section 8 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 - m_IsActive: 1 ---- !u!1 &1972070573180782 -GameObject: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - serializedVersion: 5 - m_Component: - - component: {fileID: 4413657415683046} - - component: {fileID: 114272273496016996} - - component: {fileID: 33875920168281328} - - component: {fileID: 64482899027853376} - - component: {fileID: 23348972751263728} - - component: {fileID: 205130590254589558} - m_Layer: 0 - m_Name: Section 15 - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 4294967295 - m_IsActive: 1 ---- !u!4 &4040235581136880 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1493255816159540} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 48, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4411637646999276} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4069638953826382 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1170552244504128} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 160, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4411637646999276} - m_RootOrder: 10 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4089708410960602 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1237598978954906} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 64, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4411637646999276} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4108225605267702 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1572818295343468} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 32, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4411637646999276} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4247066696109944 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1159148333252780} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 176, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4411637646999276} - m_RootOrder: 11 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4411637646999276 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1096291444604246} - 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: 4848110992237388} - - {fileID: 4887052189818598} - - {fileID: 4108225605267702} - - {fileID: 4040235581136880} - - {fileID: 4089708410960602} - - {fileID: 4892616066556696} - - {fileID: 4883103945496908} - - {fileID: 4790290825897472} - - {fileID: 4830198953157648} - - {fileID: 4704862311018224} - - {fileID: 4069638953826382} - - {fileID: 4247066696109944} - - {fileID: 4948520005843278} - - {fileID: 4502107886127422} - - {fileID: 4562915269565828} - - {fileID: 4413657415683046} - m_Father: {fileID: 4551602630984984} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4413657415683046 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1972070573180782} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 240, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4411637646999276} - m_RootOrder: 15 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4502107886127422 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1093017687423666} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 208, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4411637646999276} - m_RootOrder: 13 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4551602630984984 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1348648599246774} - 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: 4411637646999276} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4562915269565828 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1363744574123962} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 224, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4411637646999276} - m_RootOrder: 14 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4704862311018224 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1594866333015846} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 144, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4411637646999276} - m_RootOrder: 9 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4790290825897472 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1737549353143626} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 112, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4411637646999276} - m_RootOrder: 7 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4830198953157648 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1852373451543530} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 128, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4411637646999276} - m_RootOrder: 8 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4848110992237388 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1099003446746840} - 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: 4411637646999276} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4883103945496908 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1227439600505194} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 96, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4411637646999276} - m_RootOrder: 6 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4887052189818598 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1758826975978230} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 16, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4411637646999276} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4892616066556696 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1553446549738648} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 80, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4411637646999276} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!4 &4948520005843278 -Transform: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1638042809995284} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 192, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 4411637646999276} - m_RootOrder: 12 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!23 &23084303762524176 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1493255816159540} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: 010e8f1835d647e448deb2accd7c6e32, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23205197557020622 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1852373451543530} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: 010e8f1835d647e448deb2accd7c6e32, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23306005102718860 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1159148333252780} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: 010e8f1835d647e448deb2accd7c6e32, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23322867003270312 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1758826975978230} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: 010e8f1835d647e448deb2accd7c6e32, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23348972751263728 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1972070573180782} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: 010e8f1835d647e448deb2accd7c6e32, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23481493666706516 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1638042809995284} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: 010e8f1835d647e448deb2accd7c6e32, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23529173065208452 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1572818295343468} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: 010e8f1835d647e448deb2accd7c6e32, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23564408641700382 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1594866333015846} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: 010e8f1835d647e448deb2accd7c6e32, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23564895399890064 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1553446549738648} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: 010e8f1835d647e448deb2accd7c6e32, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23586190832616138 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1170552244504128} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: 010e8f1835d647e448deb2accd7c6e32, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23589331388608710 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1093017687423666} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: 010e8f1835d647e448deb2accd7c6e32, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23605289659754516 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1099003446746840} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: 010e8f1835d647e448deb2accd7c6e32, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23684280632592160 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1363744574123962} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: 010e8f1835d647e448deb2accd7c6e32, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23778137726408762 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1227439600505194} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: 010e8f1835d647e448deb2accd7c6e32, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23860286703489720 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1237598978954906} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: 010e8f1835d647e448deb2accd7c6e32, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!23 &23988079779461170 -MeshRenderer: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1737549353143626} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 2100000, guid: 010e8f1835d647e448deb2accd7c6e32, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!33 &33080176048465496 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1737549353143626} - m_Mesh: {fileID: 0} ---- !u!33 &33111821447916412 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1159148333252780} - m_Mesh: {fileID: 0} ---- !u!33 &33185160105346686 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1493255816159540} - m_Mesh: {fileID: 0} ---- !u!33 &33343939135882290 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1093017687423666} - m_Mesh: {fileID: 0} ---- !u!33 &33372776512740876 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1852373451543530} - m_Mesh: {fileID: 0} ---- !u!33 &33456356436570144 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1553446549738648} - m_Mesh: {fileID: 0} ---- !u!33 &33458740297933662 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1099003446746840} - m_Mesh: {fileID: 0} ---- !u!33 &33461098870068650 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1758826975978230} - m_Mesh: {fileID: 0} ---- !u!33 &33483486929777298 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1638042809995284} - m_Mesh: {fileID: 0} ---- !u!33 &33489707886651922 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1237598978954906} - m_Mesh: {fileID: 0} ---- !u!33 &33522955186520922 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1227439600505194} - m_Mesh: {fileID: 0} ---- !u!33 &33602948998471248 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1594866333015846} - m_Mesh: {fileID: 0} ---- !u!33 &33817869356482106 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1363744574123962} - m_Mesh: {fileID: 0} ---- !u!33 &33875920168281328 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1972070573180782} - m_Mesh: {fileID: 0} ---- !u!33 &33946093106118406 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1572818295343468} - m_Mesh: {fileID: 0} ---- !u!33 &33947527955105836 -MeshFilter: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1170552244504128} - m_Mesh: {fileID: 0} ---- !u!64 &64026003602846106 -MeshCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1594866333015846} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Convex: 0 - m_InflateMesh: 0 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 0} ---- !u!64 &64122332446340610 -MeshCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1227439600505194} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Convex: 0 - m_InflateMesh: 0 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 0} ---- !u!64 &64151579110634336 -MeshCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1170552244504128} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Convex: 0 - m_InflateMesh: 0 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 0} ---- !u!64 &64221296465520630 -MeshCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1852373451543530} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Convex: 0 - m_InflateMesh: 0 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 0} ---- !u!64 &64227073932963100 -MeshCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1493255816159540} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Convex: 0 - m_InflateMesh: 0 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 0} ---- !u!64 &64255287239484890 -MeshCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1758826975978230} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Convex: 0 - m_InflateMesh: 0 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 0} ---- !u!64 &64388345558348738 -MeshCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1553446549738648} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Convex: 0 - m_InflateMesh: 0 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 0} ---- !u!64 &64415869723138314 -MeshCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1363744574123962} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Convex: 0 - m_InflateMesh: 0 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 0} ---- !u!64 &64445857359656814 -MeshCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1572818295343468} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Convex: 0 - m_InflateMesh: 0 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 0} ---- !u!64 &64464322911532466 -MeshCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1093017687423666} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Convex: 0 - m_InflateMesh: 0 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 0} ---- !u!64 &64482899027853376 -MeshCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1972070573180782} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Convex: 0 - m_InflateMesh: 0 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 0} ---- !u!64 &64571302888625704 -MeshCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1737549353143626} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Convex: 0 - m_InflateMesh: 0 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 0} ---- !u!64 &64699261099143282 -MeshCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1159148333252780} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Convex: 0 - m_InflateMesh: 0 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 0} ---- !u!64 &64712618632917560 -MeshCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1237598978954906} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Convex: 0 - m_InflateMesh: 0 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 0} ---- !u!64 &64834383328160780 -MeshCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1099003446746840} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Convex: 0 - m_InflateMesh: 0 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 0} ---- !u!64 &64929809874421966 -MeshCollider: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1638042809995284} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 2 - m_Convex: 0 - m_InflateMesh: 0 - m_SkinWidth: 0.01 - m_Mesh: {fileID: 0} ---- !u!114 &114036256723541830 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1737549353143626} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 293836631, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &114108193977615794 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1099003446746840} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 293836631, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &114136834934121960 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1594866333015846} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 293836631, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &114260441331723260 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1852373451543530} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 293836631, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &114272273496016996 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1972070573180782} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 293836631, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &114324385966664540 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1638042809995284} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 293836631, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &114460718510608184 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1572818295343468} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 293836631, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &114465527692468318 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1553446549738648} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 293836631, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &114482739527071702 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1758826975978230} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 293836631, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &114573579245577014 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1096291444604246} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -266058236, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} - m_Name: - m_EditorClassIdentifier: - Sections: - - {fileID: 114108193977615794} - - {fileID: 114482739527071702} - - {fileID: 114460718510608184} - - {fileID: 114851943176905836} - - {fileID: 114790237890372730} - - {fileID: 114465527692468318} - - {fileID: 114962631379735484} - - {fileID: 114036256723541830} - - {fileID: 114260441331723260} - - {fileID: 114136834934121960} - - {fileID: 114984468567634750} - - {fileID: 114635928953488562} - - {fileID: 114324385966664540} - - {fileID: 114717780566559962} - - {fileID: 114931655683420838} - - {fileID: 114272273496016996} ---- !u!114 &114635928953488562 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1159148333252780} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 293836631, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &114717780566559962 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1093017687423666} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 293836631, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &114790237890372730 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1237598978954906} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 293836631, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &114851943176905836 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1493255816159540} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 293836631, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &114931655683420838 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1363744574123962} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 293836631, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &114962631379735484 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1227439600505194} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 293836631, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &114984468567634750 -MonoBehaviour: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1170552244504128} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 293836631, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!205 &205004197136357866 -LODGroup: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1237598978954906} - serializedVersion: 2 - m_LocalReferencePoint: {x: 0, y: 0, z: 0} - m_Size: 1 - m_FadeMode: 0 - m_AnimateCrossFading: 0 - m_LODs: - - screenRelativeHeight: 0.6 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - m_Enabled: 1 ---- !u!205 &205008874381329144 -LODGroup: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1227439600505194} - serializedVersion: 2 - m_LocalReferencePoint: {x: 0, y: 0, z: 0} - m_Size: 1 - m_FadeMode: 0 - m_AnimateCrossFading: 0 - m_LODs: - - screenRelativeHeight: 0.6 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - m_Enabled: 1 ---- !u!205 &205124124042364236 -LODGroup: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1594866333015846} - serializedVersion: 2 - m_LocalReferencePoint: {x: 0, y: 0, z: 0} - m_Size: 1 - m_FadeMode: 0 - m_AnimateCrossFading: 0 - m_LODs: - - screenRelativeHeight: 0.6 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - m_Enabled: 1 ---- !u!205 &205130590254589558 -LODGroup: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1972070573180782} - serializedVersion: 2 - m_LocalReferencePoint: {x: 0, y: 0, z: 0} - m_Size: 1 - m_FadeMode: 0 - m_AnimateCrossFading: 0 - m_LODs: - - screenRelativeHeight: 0.6 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - m_Enabled: 1 ---- !u!205 &205150341313805360 -LODGroup: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1099003446746840} - serializedVersion: 2 - m_LocalReferencePoint: {x: 0, y: 0, z: 0} - m_Size: 1 - m_FadeMode: 0 - m_AnimateCrossFading: 0 - m_LODs: - - screenRelativeHeight: 0.6 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - m_Enabled: 1 ---- !u!205 &205164686500485532 -LODGroup: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1758826975978230} - serializedVersion: 2 - m_LocalReferencePoint: {x: 0, y: 0, z: 0} - m_Size: 1 - m_FadeMode: 0 - m_AnimateCrossFading: 0 - m_LODs: - - screenRelativeHeight: 0.6 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - m_Enabled: 1 ---- !u!205 &205183767392414250 -LODGroup: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1093017687423666} - serializedVersion: 2 - m_LocalReferencePoint: {x: 0, y: 0, z: 0} - m_Size: 1 - m_FadeMode: 0 - m_AnimateCrossFading: 0 - m_LODs: - - screenRelativeHeight: 0.6 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - m_Enabled: 1 ---- !u!205 &205268476080829748 -LODGroup: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1363744574123962} - serializedVersion: 2 - m_LocalReferencePoint: {x: 0, y: 0, z: 0} - m_Size: 1 - m_FadeMode: 0 - m_AnimateCrossFading: 0 - m_LODs: - - screenRelativeHeight: 0.6 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - m_Enabled: 1 ---- !u!205 &205323205377547896 -LODGroup: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1170552244504128} - serializedVersion: 2 - m_LocalReferencePoint: {x: 0, y: 0, z: 0} - m_Size: 1 - m_FadeMode: 0 - m_AnimateCrossFading: 0 - m_LODs: - - screenRelativeHeight: 0.6 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - m_Enabled: 1 ---- !u!205 &205350253188925612 -LODGroup: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1638042809995284} - serializedVersion: 2 - m_LocalReferencePoint: {x: 0, y: 0, z: 0} - m_Size: 1 - m_FadeMode: 0 - m_AnimateCrossFading: 0 - m_LODs: - - screenRelativeHeight: 0.6 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - m_Enabled: 1 ---- !u!205 &205366931365002406 -LODGroup: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1493255816159540} - serializedVersion: 2 - m_LocalReferencePoint: {x: 0, y: 0, z: 0} - m_Size: 1 - m_FadeMode: 0 - m_AnimateCrossFading: 0 - m_LODs: - - screenRelativeHeight: 0.6 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - m_Enabled: 1 ---- !u!205 &205477994622601656 -LODGroup: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1553446549738648} - serializedVersion: 2 - m_LocalReferencePoint: {x: 0, y: 0, z: 0} - m_Size: 1 - m_FadeMode: 0 - m_AnimateCrossFading: 0 - m_LODs: - - screenRelativeHeight: 0.6 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - m_Enabled: 1 ---- !u!205 &205508273579632260 -LODGroup: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1572818295343468} - serializedVersion: 2 - m_LocalReferencePoint: {x: 0, y: 0, z: 0} - m_Size: 1 - m_FadeMode: 0 - m_AnimateCrossFading: 0 - m_LODs: - - screenRelativeHeight: 0.6 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - m_Enabled: 1 ---- !u!205 &205618829448221724 -LODGroup: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1159148333252780} - serializedVersion: 2 - m_LocalReferencePoint: {x: 0, y: 0, z: 0} - m_Size: 1 - m_FadeMode: 0 - m_AnimateCrossFading: 0 - m_LODs: - - screenRelativeHeight: 0.6 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - m_Enabled: 1 ---- !u!205 &205699259530301888 -LODGroup: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1852373451543530} - serializedVersion: 2 - m_LocalReferencePoint: {x: 0, y: 0, z: 0} - m_Size: 1 - m_FadeMode: 0 - m_AnimateCrossFading: 0 - m_LODs: - - screenRelativeHeight: 0.6 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - m_Enabled: 1 ---- !u!205 &205850766324421680 -LODGroup: - m_ObjectHideFlags: 1 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 100100000} - m_GameObject: {fileID: 1737549353143626} - serializedVersion: 2 - m_LocalReferencePoint: {x: 0, y: 0, z: 0} - m_Size: 1 - m_FadeMode: 0 - m_AnimateCrossFading: 0 - m_LODs: - - screenRelativeHeight: 0.6 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - - screenRelativeHeight: 0.2932691 - fadeTransitionWidth: 0 - renderers: [] - m_Enabled: 1 diff --git a/src/MineCase.Client/Assets/Resources/textures/blocks/dirt.png.meta b/src/MineCase.Client/Assets/Resources/textures/blocks/dirt.png.meta deleted file mode 100644 index 61ecabc4..00000000 --- a/src/MineCase.Client/Assets/Resources/textures/blocks/dirt.png.meta +++ /dev/null @@ -1,103 +0,0 @@ -fileFormatVersion: 2 -guid: 8bf7ae7bab111aa47ac630222a12dac0 -timeCreated: 1510651817 -licenseType: Free -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 1 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapU: -1 - wrapV: -1 - wrapW: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Standalone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Android - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: WebGL - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/MineCase.Client/Assets/Resources/textures/blocks/grass_side.png.meta b/src/MineCase.Client/Assets/Resources/textures/blocks/grass_side.png.meta deleted file mode 100644 index a2f6f0a8..00000000 --- a/src/MineCase.Client/Assets/Resources/textures/blocks/grass_side.png.meta +++ /dev/null @@ -1,103 +0,0 @@ -fileFormatVersion: 2 -guid: f38d89d93abb52c49a734aab5643e432 -timeCreated: 1510651128 -licenseType: Free -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 1 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapU: -1 - wrapV: -1 - wrapW: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Standalone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Android - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: WebGL - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/MineCase.Client/Assets/Resources/textures/blocks/grass_top.png.meta b/src/MineCase.Client/Assets/Resources/textures/blocks/grass_top.png.meta deleted file mode 100644 index 2337a43a..00000000 --- a/src/MineCase.Client/Assets/Resources/textures/blocks/grass_top.png.meta +++ /dev/null @@ -1,103 +0,0 @@ -fileFormatVersion: 2 -guid: 3459f7915a4a3cf4083769df67a5185b -timeCreated: 1510651510 -licenseType: Free -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 1 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapU: -1 - wrapV: -1 - wrapW: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Standalone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Android - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: WebGL - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/MineCase.Client/Assets/Resources/textures/blocks/leaves_oak.png.meta b/src/MineCase.Client/Assets/Resources/textures/blocks/leaves_oak.png.meta deleted file mode 100644 index a09622cf..00000000 --- a/src/MineCase.Client/Assets/Resources/textures/blocks/leaves_oak.png.meta +++ /dev/null @@ -1,103 +0,0 @@ -fileFormatVersion: 2 -guid: 17122afdec613f44ab592ac76bcbf4b4 -timeCreated: 1510652802 -licenseType: Free -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 1 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapU: -1 - wrapV: -1 - wrapW: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Standalone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Android - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: WebGL - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/MineCase.Client/Assets/Resources/textures/blocks/log_oak.png.meta b/src/MineCase.Client/Assets/Resources/textures/blocks/log_oak.png.meta deleted file mode 100644 index dbffaf43..00000000 --- a/src/MineCase.Client/Assets/Resources/textures/blocks/log_oak.png.meta +++ /dev/null @@ -1,103 +0,0 @@ -fileFormatVersion: 2 -guid: 65247229c50dbfc4fb1c96207575125a -timeCreated: 1510652440 -licenseType: Free -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 1 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapU: -1 - wrapV: -1 - wrapW: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Standalone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Android - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: WebGL - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/MineCase.Client/Assets/Resources/textures/blocks/planks_oak.png.meta b/src/MineCase.Client/Assets/Resources/textures/blocks/planks_oak.png.meta deleted file mode 100644 index 53f4ecd0..00000000 --- a/src/MineCase.Client/Assets/Resources/textures/blocks/planks_oak.png.meta +++ /dev/null @@ -1,103 +0,0 @@ -fileFormatVersion: 2 -guid: 4c3b9c5704d243f43b6319418f031999 -timeCreated: 1510652209 -licenseType: Free -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 1 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapU: -1 - wrapV: -1 - wrapW: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Standalone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Android - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: WebGL - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/MineCase.Client/Assets/Resources/textures/blocks/stone.png.meta b/src/MineCase.Client/Assets/Resources/textures/blocks/stone.png.meta deleted file mode 100644 index e1143641..00000000 --- a/src/MineCase.Client/Assets/Resources/textures/blocks/stone.png.meta +++ /dev/null @@ -1,103 +0,0 @@ -fileFormatVersion: 2 -guid: a757cfc0fad3ce64f825842da653acd1 -timeCreated: 1510555762 -licenseType: Free -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 1 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: 1 - aniso: -1 - mipBias: -1 - wrapU: -1 - wrapV: -1 - wrapW: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Standalone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Android - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: WebGL - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/MineCase.Client/Assets/Resources/textures/blocks/water_overlay.png.meta b/src/MineCase.Client/Assets/Resources/textures/blocks/water_overlay.png.meta deleted file mode 100644 index e33943af..00000000 --- a/src/MineCase.Client/Assets/Resources/textures/blocks/water_overlay.png.meta +++ /dev/null @@ -1,103 +0,0 @@ -fileFormatVersion: 2 -guid: 74cef7c2d52886b4fafac0f7a7439e10 -timeCreated: 1510651971 -licenseType: Free -TextureImporter: - fileIDToRecycleName: {} - externalObjects: {} - serializedVersion: 4 - mipmaps: - mipMapMode: 0 - enableMipMap: 1 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 1 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -1 - wrapU: -1 - wrapV: -1 - wrapW: -1 - nPOTScale: 1 - lightmap: 0 - compressionQuality: 50 - spriteMode: 0 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spritePixelsToUnits: 100 - alphaUsage: 1 - alphaIsTransparency: 0 - spriteTessellationDetail: -1 - textureType: 0 - textureShape: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - platformSettings: - - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Standalone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: Android - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - - buildTarget: WebGL - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - spritePackingTag: - userData: - assetBundleName: - assetBundleVariant: diff --git a/src/MineCase.Client/Assets/Scenes/World.unity b/src/MineCase.Client/Assets/Scenes/World.unity index dcc0a506..1f44cd34 100644 --- a/src/MineCase.Client/Assets/Scenes/World.unity +++ b/src/MineCase.Client/Assets/Scenes/World.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657868, g: 0.49641263, b: 0.57481706, a: 1} + m_IndirectSpecularColor: {r: 0.44657844, g: 0.49641222, b: 0.57481694, a: 1} --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 @@ -150,159 +150,102 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 5 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &639994473 stripped -GameObject: - m_PrefabParentObject: {fileID: 1638762341208800, guid: d1b957bd0bfb71349ae7d755126430b4, +--- !u!114 &639994475 stripped +MonoBehaviour: + m_PrefabParentObject: {fileID: 114347493614804378, guid: d1b957bd0bfb71349ae7d755126430b4, type: 2} m_PrefabInternal: {fileID: 2114258279} ---- !u!114 &639994474 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 639994473} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -1904368855, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!1 &892811803 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 5 - m_Component: - - component: {fileID: 892811805} - - component: {fileID: 892811804} - m_Layer: 0 - m_Name: Game Bootstrapper - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &892811804 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 892811803} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: -1651594269, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} - m_Name: - m_EditorClassIdentifier: - CubeMaterial: {fileID: 2100000, guid: 010e8f1835d647e448deb2accd7c6e32, type: 2} ---- !u!4 &892811805 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 892811803} - 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: 7 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1001 &944972280 + m_Script: {fileID: -2119687982, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} +--- !u!1001 &770593326 Prefab: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 4551602630984984, guid: f25d2786733bdae438b9420312ed494d, type: 2} + - target: {fileID: 4207634367194882, guid: 596ff959bcaba94439bf83e489e6df88, type: 2} propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 4551602630984984, guid: f25d2786733bdae438b9420312ed494d, type: 2} + - target: {fileID: 4207634367194882, guid: 596ff959bcaba94439bf83e489e6df88, type: 2} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 4551602630984984, guid: f25d2786733bdae438b9420312ed494d, type: 2} + - target: {fileID: 4207634367194882, guid: 596ff959bcaba94439bf83e489e6df88, type: 2} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 4551602630984984, guid: f25d2786733bdae438b9420312ed494d, type: 2} + - target: {fileID: 4207634367194882, guid: 596ff959bcaba94439bf83e489e6df88, type: 2} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - - target: {fileID: 4551602630984984, guid: f25d2786733bdae438b9420312ed494d, type: 2} + - target: {fileID: 4207634367194882, guid: 596ff959bcaba94439bf83e489e6df88, type: 2} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - - target: {fileID: 4551602630984984, guid: f25d2786733bdae438b9420312ed494d, type: 2} + - target: {fileID: 4207634367194882, guid: 596ff959bcaba94439bf83e489e6df88, type: 2} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - - target: {fileID: 4551602630984984, guid: f25d2786733bdae438b9420312ed494d, type: 2} + - target: {fileID: 4207634367194882, guid: 596ff959bcaba94439bf83e489e6df88, type: 2} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 4551602630984984, guid: f25d2786733bdae438b9420312ed494d, type: 2} + - target: {fileID: 4207634367194882, guid: 596ff959bcaba94439bf83e489e6df88, type: 2} propertyPath: m_RootOrder - value: 4 + value: 2 objectReference: {fileID: 0} + - target: {fileID: 114323612625339220, guid: 596ff959bcaba94439bf83e489e6df88, + type: 2} + propertyPath: Player + value: + objectReference: {fileID: 639994475} m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: f25d2786733bdae438b9420312ed494d, type: 2} + m_ParentPrefab: {fileID: 100100000, guid: 596ff959bcaba94439bf83e489e6df88, type: 2} m_IsPrefabParent: 0 ---- !u!1 &1130615560 +--- !u!1 &892811803 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} serializedVersion: 5 m_Component: - - component: {fileID: 1130615562} - - component: {fileID: 1130615561} - - component: {fileID: 1130615563} + - component: {fileID: 892811805} + - component: {fileID: 892811804} m_Layer: 0 - m_Name: Input Manager + m_Name: Game Bootstrapper m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &1130615561 +--- !u!114 &892811804 MonoBehaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1130615560} + m_GameObject: {fileID: 892811803} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: -1317228541, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} + m_Script: {fileID: -1651594269, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} m_Name: m_EditorClassIdentifier: ---- !u!4 &1130615562 + CubeMaterial: {fileID: 2100000, guid: 010e8f1835d647e448deb2accd7c6e32, type: 2} +--- !u!4 &892811805 Transform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1130615560} + m_GameObject: {fileID: 892811803} 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: 0 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1130615563 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1130615560} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 26435be8617eb664184ffed45f7b6a59, type: 3} - m_Name: - m_EditorClassIdentifier: --- !u!1 &1170957349 GameObject: m_ObjectHideFlags: 0 @@ -366,7 +309,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 1 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} --- !u!1 &1188822040 GameObject: @@ -395,7 +338,7 @@ MonoBehaviour: m_Script: {fileID: -22633481, guid: 1d1ef308cc4a6bf4c817b25dee1b991c, type: 3} m_Name: m_EditorClassIdentifier: - ChunkColumn: {fileID: 1348648599246774, guid: f25d2786733bdae438b9420312ed494d, + ChunkColumn: {fileID: 1531037263760400, guid: e7a3eda308064cf4786d0e4e5da26170, type: 2} --- !u!4 &1188822042 Transform: @@ -408,50 +351,8 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 6 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1001 &1915456804 -Prefab: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 4214199392695594, guid: 596ff959bcaba94439bf83e489e6df88, type: 2} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4214199392695594, guid: 596ff959bcaba94439bf83e489e6df88, type: 2} - propertyPath: m_LocalPosition.y - value: 200 - objectReference: {fileID: 0} - - target: {fileID: 4214199392695594, guid: 596ff959bcaba94439bf83e489e6df88, type: 2} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4214199392695594, guid: 596ff959bcaba94439bf83e489e6df88, type: 2} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4214199392695594, guid: 596ff959bcaba94439bf83e489e6df88, type: 2} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4214199392695594, guid: 596ff959bcaba94439bf83e489e6df88, type: 2} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4214199392695594, guid: 596ff959bcaba94439bf83e489e6df88, type: 2} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4214199392695594, guid: 596ff959bcaba94439bf83e489e6df88, type: 2} - propertyPath: m_RootOrder - value: 3 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: 596ff959bcaba94439bf83e489e6df88, type: 2} - m_IsPrefabParent: 0 --- !u!1001 &2114258279 Prefab: m_ObjectHideFlags: 0 @@ -489,7 +390,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 4741666147296076, guid: d1b957bd0bfb71349ae7d755126430b4, type: 2} propertyPath: m_RootOrder - value: 2 + value: 1 objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: d1b957bd0bfb71349ae7d755126430b4, type: 2} diff --git a/src/MineCase.Client/Assets/Resources.meta b/src/MineCase.Client/Assets/StreamingAssets.meta similarity index 70% rename from src/MineCase.Client/Assets/Resources.meta rename to src/MineCase.Client/Assets/StreamingAssets.meta index 87b9729e..e2cf078b 100644 --- a/src/MineCase.Client/Assets/Resources.meta +++ b/src/MineCase.Client/Assets/StreamingAssets.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 9633088224aadcd4c9d3c7bb75d11e58 +guid: efd36f540b001ae40a54588b311da55f folderAsset: yes -timeCreated: 1510646197 +timeCreated: 1510913225 licenseType: Free DefaultImporter: externalObjects: {} diff --git a/src/MineCase.Client/Assets/Resources/textures.meta b/src/MineCase.Client/Assets/StreamingAssets/textures.meta similarity index 70% rename from src/MineCase.Client/Assets/Resources/textures.meta rename to src/MineCase.Client/Assets/StreamingAssets/textures.meta index a04e19d1..020d70e5 100644 --- a/src/MineCase.Client/Assets/Resources/textures.meta +++ b/src/MineCase.Client/Assets/StreamingAssets/textures.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 4b0b5606784882a409a1aa8e0b34079e +guid: a050a3f57a5e06241bd113d20841a31a folderAsset: yes -timeCreated: 1510646203 +timeCreated: 1510913226 licenseType: Free DefaultImporter: externalObjects: {} diff --git a/src/MineCase.Client/Assets/Resources/textures/blocks.meta b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks.meta similarity index 70% rename from src/MineCase.Client/Assets/Resources/textures/blocks.meta rename to src/MineCase.Client/Assets/StreamingAssets/textures/blocks.meta index fd8cb5eb..02292ed5 100644 --- a/src/MineCase.Client/Assets/Resources/textures/blocks.meta +++ b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 30c01c8e921eb8a4ea5b8fb66483740a +guid: 8a6257eea5f209743a60aee1e70365da folderAsset: yes -timeCreated: 1510555753 +timeCreated: 1510913226 licenseType: Free DefaultImporter: externalObjects: {} diff --git a/src/MineCase.Client/Assets/Resources/textures/blocks/dirt.png b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/dirt.png similarity index 100% rename from src/MineCase.Client/Assets/Resources/textures/blocks/dirt.png rename to src/MineCase.Client/Assets/StreamingAssets/textures/blocks/dirt.png diff --git a/src/MineCase.Client/Assets/Models/Characters/Noire/Tag.txt.meta b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/dirt.png.meta similarity index 58% rename from src/MineCase.Client/Assets/Models/Characters/Noire/Tag.txt.meta rename to src/MineCase.Client/Assets/StreamingAssets/textures/blocks/dirt.png.meta index 5386d21f..f6c02138 100644 --- a/src/MineCase.Client/Assets/Models/Characters/Noire/Tag.txt.meta +++ b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/dirt.png.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: e979cfdd0f288d4409c883c82602cdb9 -timeCreated: 1510034504 +guid: 81f584d822a99cd49b4cb34c99e8ba9c +timeCreated: 1510913226 licenseType: Free -TextScriptImporter: +DefaultImporter: externalObjects: {} userData: assetBundleName: diff --git a/src/MineCase.Client/Assets/Resources/textures/blocks/grass_side.png b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/grass_side.png similarity index 100% rename from src/MineCase.Client/Assets/Resources/textures/blocks/grass_side.png rename to src/MineCase.Client/Assets/StreamingAssets/textures/blocks/grass_side.png diff --git a/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/grass_side.png.meta b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/grass_side.png.meta new file mode 100644 index 00000000..25b29fcf --- /dev/null +++ b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/grass_side.png.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1d3fff79aaea5494380b23ee08404407 +timeCreated: 1510913226 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MineCase.Client/Assets/Resources/textures/blocks/grass_top.png b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/grass_top.png similarity index 100% rename from src/MineCase.Client/Assets/Resources/textures/blocks/grass_top.png rename to src/MineCase.Client/Assets/StreamingAssets/textures/blocks/grass_top.png diff --git a/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/grass_top.png.meta b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/grass_top.png.meta new file mode 100644 index 00000000..e116b8ef --- /dev/null +++ b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/grass_top.png.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 51b22210cccc45e41bb953da83b51a24 +timeCreated: 1510913226 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MineCase.Client/Assets/Resources/textures/blocks/leaves_oak.png b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/leaves_oak.png similarity index 100% rename from src/MineCase.Client/Assets/Resources/textures/blocks/leaves_oak.png rename to src/MineCase.Client/Assets/StreamingAssets/textures/blocks/leaves_oak.png diff --git a/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/leaves_oak.png.meta b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/leaves_oak.png.meta new file mode 100644 index 00000000..765c46a2 --- /dev/null +++ b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/leaves_oak.png.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3edb833e5e5bc6b458480a92f2a30f27 +timeCreated: 1510913226 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MineCase.Client/Assets/Resources/textures/blocks/log_oak.png b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/log_oak.png similarity index 100% rename from src/MineCase.Client/Assets/Resources/textures/blocks/log_oak.png rename to src/MineCase.Client/Assets/StreamingAssets/textures/blocks/log_oak.png diff --git a/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/log_oak.png.meta b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/log_oak.png.meta new file mode 100644 index 00000000..35378150 --- /dev/null +++ b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/log_oak.png.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0517955b60f24bf4ea479e9f9aa2689f +timeCreated: 1510913226 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MineCase.Client/Assets/Resources/textures/blocks/planks_oak.png b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/planks_oak.png similarity index 100% rename from src/MineCase.Client/Assets/Resources/textures/blocks/planks_oak.png rename to src/MineCase.Client/Assets/StreamingAssets/textures/blocks/planks_oak.png diff --git a/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/planks_oak.png.meta b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/planks_oak.png.meta new file mode 100644 index 00000000..9f1cabb9 --- /dev/null +++ b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/planks_oak.png.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 2f87c9eebc787c54f8c966f42b8b3225 +timeCreated: 1510913226 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MineCase.Client/Assets/Resources/textures/blocks/stone.png b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/stone.png similarity index 100% rename from src/MineCase.Client/Assets/Resources/textures/blocks/stone.png rename to src/MineCase.Client/Assets/StreamingAssets/textures/blocks/stone.png diff --git a/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/stone.png.meta b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/stone.png.meta new file mode 100644 index 00000000..48d911d3 --- /dev/null +++ b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/stone.png.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1c45f95ad803d034c8111795a9a79a3c +timeCreated: 1510913226 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MineCase.Client/Assets/Resources/textures/blocks/water_overlay.png b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/water_overlay.png similarity index 100% rename from src/MineCase.Client/Assets/Resources/textures/blocks/water_overlay.png rename to src/MineCase.Client/Assets/StreamingAssets/textures/blocks/water_overlay.png diff --git a/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/water_overlay.png.meta b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/water_overlay.png.meta new file mode 100644 index 00000000..0aecc713 --- /dev/null +++ b/src/MineCase.Client/Assets/StreamingAssets/textures/blocks/water_overlay.png.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d1d59dd811028f74ea3b1226abd21cfe +timeCreated: 1510913226 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Minecase.Core/EntityUsage.cs b/src/MineCase.Core/EntityUsage.cs similarity index 100% rename from src/Minecase.Core/EntityUsage.cs rename to src/MineCase.Core/EntityUsage.cs diff --git a/src/Minecase.Core/Game/Entity/Ai/CreatureEvent.cs b/src/MineCase.Core/Game/Entity/Ai/CreatureEvent.cs similarity index 100% rename from src/Minecase.Core/Game/Entity/Ai/CreatureEvent.cs rename to src/MineCase.Core/Game/Entity/Ai/CreatureEvent.cs diff --git a/src/Minecase.Core/Game/Entity/Ai/CreatureState.cs b/src/MineCase.Core/Game/Entity/Ai/CreatureState.cs similarity index 100% rename from src/Minecase.Core/Game/Entity/Ai/CreatureState.cs rename to src/MineCase.Core/Game/Entity/Ai/CreatureState.cs diff --git a/src/Minecase.Core/Game/Entity/Ai/CreatureTask.cs b/src/MineCase.Core/Game/Entity/Ai/CreatureTask.cs similarity index 100% rename from src/Minecase.Core/Game/Entity/Ai/CreatureTask.cs rename to src/MineCase.Core/Game/Entity/Ai/CreatureTask.cs diff --git a/src/Minecase.Core/Game/Windows/WindowPropertyTypes.cs b/src/MineCase.Core/Game/Windows/WindowPropertyTypes.cs similarity index 100% rename from src/Minecase.Core/Game/Windows/WindowPropertyTypes.cs rename to src/MineCase.Core/Game/Windows/WindowPropertyTypes.cs diff --git a/src/MineCase.Core/Minecase.Core.csproj b/src/MineCase.Core/MineCase.Core.csproj similarity index 82% rename from src/MineCase.Core/Minecase.Core.csproj rename to src/MineCase.Core/MineCase.Core.csproj index 44912c58..55fbb0ef 100644 --- a/src/MineCase.Core/Minecase.Core.csproj +++ b/src/MineCase.Core/MineCase.Core.csproj @@ -1,12 +1,20 @@ - netstandard2.0;net46 MineCase true true ../../build/Analyzers.ruleset MineCase.Core + Debug;Release;Appveyor;TravisCI + + + + netstandard2.0 + + + + netstandard2.0;net46 diff --git a/src/Minecase.Core/PlayerDiggingFace.cs b/src/MineCase.Core/PlayerDiggingFace.cs similarity index 100% rename from src/Minecase.Core/PlayerDiggingFace.cs rename to src/MineCase.Core/PlayerDiggingFace.cs diff --git a/src/Minecase.Core/WorldTime.cs b/src/MineCase.Core/WorldTime.cs similarity index 100% rename from src/Minecase.Core/WorldTime.cs rename to src/MineCase.Core/WorldTime.cs diff --git a/src/MineCase.Engine/Component.Server.cs b/src/MineCase.Engine/Component.Server.cs new file mode 100644 index 00000000..a6bb6340 --- /dev/null +++ b/src/MineCase.Engine/Component.Server.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Orleans; + +namespace MineCase.Engine +{ + public partial class Component + { + protected IGrainFactory GrainFactory { get; private set; } + + protected ILogger Logger { get; private set; } + + partial void AttatchPartial(DependencyObject dependencyObject, IServiceProvider serviceProvider) + { + GrainFactory = serviceProvider.GetService(); + Logger = serviceProvider.GetService()?.CreateLogger(GetType()); + } + } +} diff --git a/src/MineCase.Engine/Component.cs b/src/MineCase.Engine/Component.cs deleted file mode 100644 index 9854eb86..00000000 --- a/src/MineCase.Engine/Component.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Orleans; - -namespace MineCase.Engine -{ - internal interface IComponentIntern - { - Task Attach(DependencyObject dependencyObject, IServiceProvider serviceProvider); - - Task Detach(); - - int GetMessageOrder(object message); - } - - public abstract class Component : IComponentIntern - { - public string Name { get; } - - protected DependencyObject AttachedObject { get; private set; } - - protected IServiceProvider ServiceProvider { get; private set; } - - protected IGrainFactory GrainFactory { get; private set; } - - protected ILogger Logger { get; private set; } - - public Component(string name) - { - Name = name; - } - - Task IComponentIntern.Attach(DependencyObject dependencyObject, IServiceProvider serviceProvider) - { - AttachedObject = dependencyObject; - ServiceProvider = serviceProvider; - GrainFactory = serviceProvider.GetService(); - Logger = serviceProvider.GetService()?.CreateLogger(GetType()); - return OnAttached(); - } - - Task IComponentIntern.Detach() - { - AttachedObject = null; - return OnDetached(); - } - - protected virtual Task OnAttached() - { - return Task.CompletedTask; - } - - protected virtual Task OnDetached() - { - return Task.CompletedTask; - } - - public virtual int GetMessageOrder(object message) - { - return 0; - } - } - - public abstract class Component : Component - where T : DependencyObject - { - public new T AttachedObject => (T)base.AttachedObject; - - public Component(string name) - : base(name) - { - } - } -} diff --git a/src/MineCase.Engine/Data/IDependencyValueProvider.cs b/src/MineCase.Engine/Data/IDependencyValueProvider.cs deleted file mode 100644 index dd78e2ca..00000000 --- a/src/MineCase.Engine/Data/IDependencyValueProvider.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace MineCase.Engine.Data -{ - public interface IDependencyValueProvider - { - float Priority { get; } - } - - public interface IEffectiveValueProvider - { - IEffectiveValue ProviderValue(DependencyObject d); - } - - public interface IEffectiveValueProvider : IEffectiveValueProvider - { - } -} diff --git a/src/MineCase.Engine/Data/IDependencyValueStorage.cs b/src/MineCase.Engine/Data/IDependencyValueStorage.cs deleted file mode 100644 index 91a6a2d7..00000000 --- a/src/MineCase.Engine/Data/IDependencyValueStorage.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; - -namespace MineCase.Engine.Data -{ - public interface IDependencyValueStorage - { - event AsyncEventHandler CurrentValueChanged; - - Task AddOrUpdate(IDependencyValueProvider provider, DependencyProperty key, Func> addValueFactory, Func, Task>> updateValueFactory); - - bool TryGetValue(IDependencyValueProvider provider, DependencyProperty key, out IEffectiveValue value); - - Task TryRemove(IDependencyValueProvider provider, DependencyProperty key, out IEffectiveValue value); - - bool TryGetCurrentValue(DependencyProperty key, out T value); - - bool TryGetCurrentEffectiveValue(DependencyProperty key, out IEffectiveValue value); - - bool TryGetCurrentEffectiveValue(DependencyProperty key, out IEffectiveValue value); - - IEnumerable Keys { get; } - } -} diff --git a/src/MineCase.Engine/Data/IEffectiveValue.cs b/src/MineCase.Engine/Data/IEffectiveValue.cs deleted file mode 100644 index b410bb28..00000000 --- a/src/MineCase.Engine/Data/IEffectiveValue.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; - -namespace MineCase.Engine.Data -{ - public interface IEffectiveValue - { - AsyncEventHandler ValueChanged { set; } - } - - public interface IEffectiveValue : IEffectiveValue - { - bool CanSetValue { get; } - - T Value { get; } - - Task SetValue(T value); - } - - public interface IEffectiveValueChangedEventArgs - { - object OldValue { get; } - - object NewValue { get; } - } - - public class EffectiveValueChangedEventArgs : EventArgs, IEffectiveValueChangedEventArgs - { - public T OldValue { get; } - - public T NewValue { get; } - - object IEffectiveValueChangedEventArgs.OldValue => OldValue; - - object IEffectiveValueChangedEventArgs.NewValue => NewValue; - - public EffectiveValueChangedEventArgs(T oldValue, T newValue) - { - OldValue = oldValue; - NewValue = newValue; - } - } -} diff --git a/src/MineCase.Engine/Data/LocalDependencyValueExtensions.cs b/src/MineCase.Engine/Data/LocalDependencyValueExtensions.cs deleted file mode 100644 index e926f7af..00000000 --- a/src/MineCase.Engine/Data/LocalDependencyValueExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; -using MineCase.Engine.Data; - -namespace MineCase.Engine -{ - public static class LocalDependencyValueExtensions - { - public static bool TryGetLocalValue(this DependencyObject d, DependencyProperty property, out T value) - { - return LocalDependencyValueProvider.Current.TryGetValue(property, d.ValueStorage, out value); - } - - public static Task SetLocalValue(this DependencyObject d, DependencyProperty property, T value) - { - return LocalDependencyValueProvider.Current.SetValue(property, d.ValueStorage, value); - } - - public static Task ClearLocalValue(this DependencyObject d, DependencyProperty property) - { - return LocalDependencyValueProvider.Current.ClearValue(property, d.ValueStorage); - } - } -} diff --git a/src/MineCase.Engine/Data/LocalDependencyValueProvider.cs b/src/MineCase.Engine/Data/LocalDependencyValueProvider.cs deleted file mode 100644 index ccef1312..00000000 --- a/src/MineCase.Engine/Data/LocalDependencyValueProvider.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; - -namespace MineCase.Engine.Data -{ - public class LocalDependencyValueProvider : IDependencyValueProvider - { - public static LocalDependencyValueProvider Current { get; } = new LocalDependencyValueProvider(); - - public float Priority => 1.0f; - - public Task SetValue(DependencyProperty property, IDependencyValueStorage storage, T value) - { - return storage.AddOrUpdate(this, property, o => new LocalEffectiveValue(value), async (k, o) => - { - await ((LocalEffectiveValue)o).SetValue(value); - return o; - }); - } - - public bool TryGetValue(DependencyProperty property, IDependencyValueStorage storage, out T value) - { - IEffectiveValue eValue; - if (storage.TryGetValue(this, property, out eValue)) - { - value = eValue.Value; - return true; - } - - value = default(T); - return false; - } - - public Task ClearValue(DependencyProperty property, IDependencyValueStorage storage) - { - IEffectiveValue eValue; - return storage.TryRemove(this, property, out eValue); - } - - internal class LocalEffectiveValue : IEffectiveValue - { - public AsyncEventHandler ValueChanged { get; set; } - - public bool CanSetValue => true; - - private T _value; - - public T Value => _value; - - public LocalEffectiveValue(T value) - { - _value = value; - } - - public async Task SetValue(T value) - { - if (!EqualityComparer.Default.Equals(_value, value)) - { - var oldValue = _value; - _value = value; - await ValueChanged.InvokeSerial(this, new EffectiveValueChangedEventArgs(oldValue, value)); - } - } - } - } -} \ No newline at end of file diff --git a/src/MineCase.Engine/IDependencyObject.cs b/src/MineCase.Engine/IDependencyObject.cs deleted file mode 100644 index c645c976..00000000 --- a/src/MineCase.Engine/IDependencyObject.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; -using Orleans; -using Orleans.Concurrency; - -namespace MineCase.Engine -{ - [Immutable] - public sealed class AskResult - { - public static readonly AskResult Failed = new AskResult { Succeeded = false }; - - public bool Succeeded; - - public TResponse Response; - } - - public interface IDependencyObject : IGrain - { - Task Tell(IEntityMessage message); - - Task Ask(IEntityMessage message); - - Task> TryAsk(IEntityMessage message); - } -} diff --git a/src/MineCase.Engine/IHandle.cs b/src/MineCase.Engine/IHandle.cs deleted file mode 100644 index 17cfb33d..00000000 --- a/src/MineCase.Engine/IHandle.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; - -namespace MineCase.Engine -{ - public interface IHandle - where TMessage : IEntityMessage - { - Task Handle(TMessage message); - } - - public interface IHandle - where TMessage : IEntityMessage - { - Task Handle(TMessage message); - } -} diff --git a/src/MineCase.Engine/MineCase.Server.Engine.csproj b/src/MineCase.Engine/MineCase.Server.Engine.csproj index c8f04718..689ce273 100644 --- a/src/MineCase.Engine/MineCase.Server.Engine.csproj +++ b/src/MineCase.Engine/MineCase.Server.Engine.csproj @@ -6,6 +6,8 @@ true ../../build/Analyzers.ruleset MineCase.Engine + Debug;Release;Appveyor;TravisCI + $(DefineConstants);ECS_SERVER @@ -23,4 +25,27 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/MineCase.Engine/PropertyChangedEventArgs.cs b/src/MineCase.Engine/PropertyChangedEventArgs.cs deleted file mode 100644 index 49b3fcba..00000000 --- a/src/MineCase.Engine/PropertyChangedEventArgs.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace MineCase.Engine -{ - public class PropertyChangedEventArgs : EventArgs - { - public DependencyProperty Property { get; } - - public PropertyChangedEventArgs(DependencyProperty property) - { - Property = property; - } - } - - public class PropertyChangedEventArgs : PropertyChangedEventArgs - { - public new DependencyProperty Property => (DependencyProperty)base.Property; - - public T OldValue { get; } - - public T NewValue { get; } - - public PropertyChangedEventArgs(DependencyProperty property, T oldValue, T newValue) - : base(property) - { - OldValue = oldValue; - NewValue = newValue; - } - } -} diff --git a/src/MineCase.Engine/PropertyMetadata.cs b/src/MineCase.Engine/PropertyMetadata.cs deleted file mode 100644 index 2f6445ca..00000000 --- a/src/MineCase.Engine/PropertyMetadata.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; - -namespace MineCase.Engine -{ - public class PropertyMetadata - { - private bool _defaultValueSet; - private T _defaultValue; - - public bool HasDefaultValue => _defaultValueSet; - - public T DefaultValue => _defaultValue; - - public event AsyncEventHandler> PropertyChanged; - - public PropertyMetadata(T defaultValue, AsyncEventHandler> propertyChangedHandler = null) - { - _defaultValue = defaultValue; - _defaultValueSet = true; - if (propertyChangedHandler != null) - PropertyChanged += propertyChangedHandler; - } - - public PropertyMetadata(DependencyProperty.UnsetValueType unsetValue, AsyncEventHandler> propertyChangedHandler = null) - { - _defaultValueSet = false; - if (propertyChangedHandler != null) - PropertyChanged += propertyChangedHandler; - } - - public bool TryGetDefaultValue(DependencyObject d, DependencyProperty property, out T value) - { - if (TryGetDefaultValueOverride(d, property, out value)) - return true; - if (_defaultValueSet) - { - value = _defaultValue; - return true; - } - - return false; - } - - protected virtual bool TryGetDefaultValueOverride(DependencyObject d, DependencyProperty property, out T value) - { - value = default(T); - return false; - } - - internal async Task RaisePropertyChanged(object sender, PropertyChangedEventArgs e) - { - await OnPropertyChanged(sender, e); - await PropertyChanged.InvokeSerial(sender, e); - } - - protected virtual Task OnPropertyChanged(object sender, PropertyChangedEventArgs e) - { - return Task.CompletedTask; - } - - protected virtual void MergeOverride(PropertyMetadata old) - { - } - - internal void Merge(PropertyMetadata old, bool ownerIsDerived) - { - if (!_defaultValueSet && old._defaultValueSet) - { - _defaultValue = old._defaultValue; - _defaultValueSet = true; - } - - if (ownerIsDerived) - PropertyChanged = (AsyncEventHandler>)Delegate.Combine(old.PropertyChanged, PropertyChanged); - MergeOverride(old); - } - - public virtual bool TryGetNonDefaultValue(DependencyObject d, DependencyProperty property, out T value) - { - value = default(T); - return false; - } - } -} diff --git a/src/MineCase.Gateway/.dockerignore b/src/MineCase.Gateway/.dockerignore new file mode 100644 index 00000000..d8f8175f --- /dev/null +++ b/src/MineCase.Gateway/.dockerignore @@ -0,0 +1,3 @@ +* +!obj/Docker/publish/* +!obj/Docker/empty/ diff --git a/src/MineCase.Gateway/Dockerfile b/src/MineCase.Gateway/Dockerfile new file mode 100644 index 00000000..58643c4b --- /dev/null +++ b/src/MineCase.Gateway/Dockerfile @@ -0,0 +1,7 @@ +FROM microsoft/dotnet:2.0-runtime +ARG source +WORKDIR /app +EXPOSE 25565 +COPY ${source:-obj/Docker/publish} . +COPY ${source:-obj/Docker/publish}/OrleansConfiguration.docker.xml OrleansConfiguration.dev.xml +ENTRYPOINT ["dotnet", "MineCase.Gateway.dll"] diff --git a/src/MineCase.Gateway/MineCase.Gateway.csproj b/src/MineCase.Gateway/MineCase.Gateway.csproj index 375a3f39..2647f226 100644 --- a/src/MineCase.Gateway/MineCase.Gateway.csproj +++ b/src/MineCase.Gateway/MineCase.Gateway.csproj @@ -5,16 +5,21 @@ netcoreapp2.0 true true + Debug;Release;Appveyor;TravisCI + PreserveNewest + + PreserveNewest + @@ -28,6 +33,7 @@ + @@ -36,4 +42,10 @@ + + + Dockerfile + + + \ No newline at end of file diff --git a/src/MineCase.Gateway/OrleansConfiguration.docker.xml b/src/MineCase.Gateway/OrleansConfiguration.docker.xml new file mode 100644 index 00000000..cca430fe --- /dev/null +++ b/src/MineCase.Gateway/OrleansConfiguration.docker.xml @@ -0,0 +1,3 @@ + + + diff --git a/src/MineCase.Gateway/Program.cs b/src/MineCase.Gateway/Program.cs index f6785b25..842cf499 100644 --- a/src/MineCase.Gateway/Program.cs +++ b/src/MineCase.Gateway/Program.cs @@ -6,6 +6,9 @@ using Microsoft.Extensions.Logging; using MineCase.Gateway.Network; using System.Reflection; +using System.Threading.Tasks; +using Orleans.Runtime; +using Polly; namespace MineCase.Gateway { @@ -20,15 +23,7 @@ partial class Program static void Main(string[] args) { Console.CancelKeyPress += (s, e) => _exitEvent.Set(); - Configuration = LoadConfiguration(); - var builder = new ClientBuilder() - .LoadConfiguration("OrleansConfiguration.dev.xml") - .ConfigureServices(ConfigureServices) - .ConfigureLogging(ConfigureLogging); - SelectAssemblies(); - ConfigureApplicationParts(builder); - _clusterClient = builder.Build(); Startup(); _exitEvent.WaitOne(); } @@ -41,22 +36,37 @@ private static void ConfigureApplicationParts(IClientBuilder builder) private static async void Startup() { - var serviceProvider = _clusterClient.ServiceProvider; - var logger = _clusterClient.ServiceProvider.GetRequiredService().CreateLogger(); - try - { - logger.LogInformation("Connecting to cluster..."); - await _clusterClient.Connect(); - logger.LogInformation("Connected to cluster."); - } - catch (Exception e) + ILogger logger = null; + + var retryPolicy = Policy.Handle() + .WaitAndRetryForeverAsync( + retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)), + (ex, timeSpan) => logger?.LogError($"Cluster connection failed. Next retry: {timeSpan.TotalSeconds} secs later.")); + await retryPolicy.ExecuteAsync(async () => { - logger.LogError("Cluster connection failed.\n" + "Exception stack trace:" + e.StackTrace); - _exitEvent.Set(); - return; - } - var connectionRouter = serviceProvider.GetRequiredService(); + var builder = new ClientBuilder() + .LoadConfiguration("OrleansConfiguration.dev.xml") + .ConfigureServices(ConfigureServices) + .ConfigureLogging(ConfigureLogging); + SelectAssemblies(); + ConfigureApplicationParts(builder); + _clusterClient = builder.Build(); + + var serviceProvider = _clusterClient.ServiceProvider; + logger = _clusterClient.ServiceProvider.GetRequiredService().CreateLogger(); + + await Connect(logger); + }); + + var connectionRouter = _clusterClient.ServiceProvider.GetRequiredService(); await connectionRouter.Startup(default(CancellationToken)); } + + private static async Task Connect(ILogger logger) + { + logger.LogInformation("Connecting to cluster..."); + await _clusterClient.Connect(); + logger.LogInformation("Connected to cluster."); + } } } \ No newline at end of file diff --git a/src/MineCase.Nbt/MineCase.Nbt.csproj b/src/MineCase.Nbt/MineCase.Nbt.csproj index 4f1cd7aa..04a73c8b 100644 --- a/src/MineCase.Nbt/MineCase.Nbt.csproj +++ b/src/MineCase.Nbt/MineCase.Nbt.csproj @@ -1,9 +1,17 @@ - netstandard2.0;net46 true ../../build/Analyzers.ruleset + Debug;Release;Appveyor;TravisCI + + + + netstandard2.0 + + + + netstandard2.0;net46 diff --git a/src/MineCase.Protocol/MineCase.Protocol.csproj b/src/MineCase.Protocol/MineCase.Protocol.csproj index 82d4796f..86642faf 100644 --- a/src/MineCase.Protocol/MineCase.Protocol.csproj +++ b/src/MineCase.Protocol/MineCase.Protocol.csproj @@ -1,15 +1,23 @@  - netstandard2.0;net46 MineCase true true ../../build/Analyzers.ruleset latest + Debug;Release;Appveyor;TravisCI + + + + netstandard2.0 + + + + netstandard2.0;net46 - + full true diff --git a/src/MineCase.Server.Grains/Game/Entities/Components/EntityAiComponent.cs b/src/MineCase.Server.Grains/Game/Entities/Components/EntityAiComponent.cs index e31c4104..34be94c0 100644 --- a/src/MineCase.Server.Grains/Game/Entities/Components/EntityAiComponent.cs +++ b/src/MineCase.Server.Grains/Game/Entities/Components/EntityAiComponent.cs @@ -22,20 +22,15 @@ namespace MineCase.Server.Game.Entities.Components internal class EntityAiComponent : Component, IHandle { public static readonly DependencyProperty AiTypeProperty = - DependencyProperty.Register("AiType", typeof(EntityAiComponent)); + DependencyProperty.Register(nameof(AiType), typeof(EntityAiComponent)); public static readonly DependencyProperty CreatureStateProperty = - DependencyProperty.Register("CreatureState", typeof(EntityAiComponent)); - - public static readonly DependencyProperty CreatureEventProperty = - DependencyProperty.Register("CreatureEvent", typeof(EntityAiComponent)); + DependencyProperty.Register(nameof(CreatureState), typeof(EntityAiComponent)); public CreatureAi AiType => AttachedObject.GetValue(AiTypeProperty); public CreatureState CreatureState => AttachedObject.GetValue(CreatureStateProperty); - public CreatureEvent CreatureEvent => AttachedObject.GetValue(CreatureEventProperty); - private Random random; public EntityAiComponent(string name = "entityAi") @@ -44,12 +39,10 @@ public EntityAiComponent(string name = "entityAi") random = new Random(); } - protected override Task OnAttached() + protected override async Task OnAttached() { Register(); - AttachedObject.SetLocalValue(EntityAiComponent.CreatureStateProperty, CreatureState.Stop); - AttachedObject.SetLocalValue(EntityAiComponent.CreatureEventProperty, CreatureEvent.Nothing); - return base.OnAttached(); + await AttachedObject.SetLocalValue(EntityAiComponent.CreatureStateProperty, CreatureState.Stop); } protected override Task OnDetached() @@ -72,38 +65,43 @@ private void Unregister() async Task IHandle.Handle(SpawnMob message) { + Func getter = () => AttachedObject.GetValue(CreatureStateProperty); + Action setter = v => AttachedObject.SetLocalValue(CreatureStateProperty, v).Wait(); + CreatureAi ai; + switch (message.MobType) { case MobType.Chicken: - await AttachedObject.SetLocalValue(EntityAiComponent.AiTypeProperty, new AiChicken()); + ai = new AiChicken(getter, setter); break; case MobType.Cow: - await AttachedObject.SetLocalValue(EntityAiComponent.AiTypeProperty, new AiCow()); + ai = new AiCow(getter, setter); break; case MobType.Creeper: - await AttachedObject.SetLocalValue(EntityAiComponent.AiTypeProperty, new AiCreeper()); + ai = new AiCreeper(getter, setter); break; case MobType.Pig: - await AttachedObject.SetLocalValue(EntityAiComponent.AiTypeProperty, new AiPig()); + ai = new AiPig(getter, setter); break; case MobType.Sheep: - await AttachedObject.SetLocalValue(EntityAiComponent.AiTypeProperty, new AiSheep()); + ai = new AiSheep(getter, setter); break; case MobType.Skeleton: - await AttachedObject.SetLocalValue(EntityAiComponent.AiTypeProperty, new AiSkeleton()); + ai = new AiSkeleton(getter, setter); break; case MobType.Squid: // TODO new ai for squid - await AttachedObject.SetLocalValue(EntityAiComponent.AiTypeProperty, new AiChicken()); + ai = new AiChicken(getter, setter); break; case MobType.Zombie: - await AttachedObject.SetLocalValue(EntityAiComponent.AiTypeProperty, new AiZombie()); + ai = new AiZombie(getter, setter); break; default: // TODO add more ai - // throw new NotImplementedException("AI of this mob has not been implemented."); - break; + throw new NotImplementedException("AI of this mob has not been implemented."); } + + await AttachedObject.SetLocalValue(AiTypeProperty, ai); } private Task ActionStop() @@ -232,8 +230,8 @@ private Task ActionEscape() private async Task GenerateEvent() { // get state - CreatureAi ai = AttachedObject.GetValue(EntityAiComponent.AiTypeProperty); - CreatureState state = AttachedObject.GetValue(EntityAiComponent.CreatureStateProperty); + var state = AiType.State; + var nextEvent = CreatureEvent.Nothing; // player approaching event if (state == CreatureState.Stop) @@ -242,25 +240,27 @@ private async Task GenerateEvent() var list = await tracker.GetTrackedPlayers(); if (list.Count != 0) { - await AttachedObject.SetLocalValue(EntityAiComponent.CreatureEventProperty, CreatureEvent.PlayerApproaching); + nextEvent = CreatureEvent.PlayerApproaching; } } // random walk if (state == CreatureState.Stop && random.Next(10) == 0) { - await AttachedObject.SetLocalValue(EntityAiComponent.CreatureEventProperty, CreatureEvent.RandomWalk); + nextEvent = CreatureEvent.RandomWalk; } // stop if (state == CreatureState.Walk && random.Next(30) == 0) { - await AttachedObject.SetLocalValue(EntityAiComponent.CreatureEventProperty, CreatureEvent.Stop); + nextEvent = CreatureEvent.Stop; } else if (state == CreatureState.Look && random.Next(10) == 0) { - await AttachedObject.SetLocalValue(EntityAiComponent.CreatureEventProperty, CreatureEvent.Stop); + nextEvent = CreatureEvent.Stop; } + + await AiType.FireAsync(nextEvent); } private async Task OnGameTick(object sender, (TimeSpan deltaTime, long worldAge) e) @@ -290,12 +290,7 @@ private async Task OnGameTick(object sender, (TimeSpan deltaTime, long worldAge) await GenerateEvent(); // get state - CreatureAi ai = AttachedObject.GetValue(EntityAiComponent.AiTypeProperty); - CreatureState state = AttachedObject.GetValue(EntityAiComponent.CreatureStateProperty); - - CreatureEvent evnt = AttachedObject.GetValue(EntityAiComponent.CreatureEventProperty); - CreatureState newState = ai.GetState(state, evnt); - await AttachedObject.SetLocalValue(EntityAiComponent.CreatureStateProperty, newState); + var newState = AiType.State; switch (newState) { case CreatureState.Attacking: @@ -326,8 +321,6 @@ private async Task OnGameTick(object sender, (TimeSpan deltaTime, long worldAge) System.Console.WriteLine(newState); throw new NotSupportedException("Unsupported state."); } - - await AttachedObject.SetLocalValue(EntityAiComponent.CreatureEventProperty, CreatureEvent.Nothing); } public static (float, float) VectorToYawAndPitch(Vector3 from, Vector3 to) diff --git a/src/MineCase.Server.Grains/Game/GameSession.cs b/src/MineCase.Server.Grains/Game/GameSession.cs index c9abd843..948a53a4 100644 --- a/src/MineCase.Server.Grains/Game/GameSession.cs +++ b/src/MineCase.Server.Grains/Game/GameSession.cs @@ -3,7 +3,8 @@ using System.Linq; using System.Text; using System.Threading.Tasks; - +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; using MineCase.Protocol.Play; using MineCase.Server.Network.Play; using MineCase.Server.User; @@ -23,8 +24,11 @@ internal class GameSession : Grain, IGameSession private HashSet _tickables; + private ILogger _logger; + public override async Task OnActivateAsync() { + _logger = ServiceProvider.GetRequiredService().CreateLogger(); _world = await GrainFactory.GetGrain(0).GetWorld(this.GetPrimaryKeyString()); _chunkSender = GrainFactory.GetGrain(this.GetPrimaryKeyString()); _lastGameTickTime = DateTime.UtcNow; @@ -91,23 +95,30 @@ await item.GetName() == senderName) private async Task OnGameTick(object state) { - var now = DateTime.UtcNow; - var deltaTime = now - _lastGameTickTime; - _lastGameTickTime = now; - - var worldTime = await _world.GetTime(); - - if (worldTime.WorldAge % 20 == 0) + try { - await Task.WhenAll(from u in _users.Values - select u.Generator.TimeUpdate(worldTime.WorldAge, worldTime.TimeOfDay)); + var now = DateTime.UtcNow; + var deltaTime = now - _lastGameTickTime; + _lastGameTickTime = now; + + var worldTime = await _world.GetTime(); + + if (worldTime.WorldAge % 20 == 0) + { + await Task.WhenAll(from u in _users.Values + select u.Generator.TimeUpdate(worldTime.WorldAge, worldTime.TimeOfDay)); + } + + await _world.OnGameTick(deltaTime); + await Task.WhenAll(from u in _users.Keys + select u.OnGameTick(deltaTime, worldTime.WorldAge)); + await Task.WhenAll(from u in _tickables + select u.OnGameTick(deltaTime, worldTime.WorldAge)); + } + catch (Exception ex) + { + _logger.LogError(ex, ex.Message); } - - await _world.OnGameTick(deltaTime); - await Task.WhenAll(from u in _users.Keys - select u.OnGameTick(deltaTime, worldTime.WorldAge)); - await Task.WhenAll(from u in _tickables - select u.OnGameTick(deltaTime, worldTime.WorldAge)); } private Task CreateStandardChatMessage(string name, string message) diff --git a/src/MineCase.Server.Grains/MineCase.Server.Grains.csproj b/src/MineCase.Server.Grains/MineCase.Server.Grains.csproj index fbf2ab9c..7e066899 100644 --- a/src/MineCase.Server.Grains/MineCase.Server.Grains.csproj +++ b/src/MineCase.Server.Grains/MineCase.Server.Grains.csproj @@ -6,6 +6,7 @@ true ../../build/Analyzers.ruleset true + Debug;Release;Appveyor;TravisCI diff --git a/src/MineCase.Server.Interfaces/MineCase.Server.Interfaces.csproj b/src/MineCase.Server.Interfaces/MineCase.Server.Interfaces.csproj index 952027bd..90529517 100644 --- a/src/MineCase.Server.Interfaces/MineCase.Server.Interfaces.csproj +++ b/src/MineCase.Server.Interfaces/MineCase.Server.Interfaces.csproj @@ -6,6 +6,7 @@ MineCase.Server true ../../build/Analyzers.ruleset + Debug;Release;Appveyor;TravisCI diff --git a/src/MineCase.Server/.dockerignore b/src/MineCase.Server/.dockerignore new file mode 100644 index 00000000..d8f8175f --- /dev/null +++ b/src/MineCase.Server/.dockerignore @@ -0,0 +1,3 @@ +* +!obj/Docker/publish/* +!obj/Docker/empty/ diff --git a/src/MineCase.Server/Dockerfile b/src/MineCase.Server/Dockerfile new file mode 100644 index 00000000..3e3c6774 --- /dev/null +++ b/src/MineCase.Server/Dockerfile @@ -0,0 +1,7 @@ +FROM microsoft/dotnet:2.0-runtime +ARG source +WORKDIR /app +EXPOSE 30000 +COPY ${source:-obj/Docker/publish} . +COPY ${source:-obj/Docker/publish}/OrleansConfiguration.docker.xml OrleansConfiguration.dev.xml +ENTRYPOINT ["dotnet", "MineCase.Server.dll"] diff --git a/src/MineCase.Server/MineCase.Server.csproj b/src/MineCase.Server/MineCase.Server.csproj index 2078c3ba..7ae17827 100644 --- a/src/MineCase.Server/MineCase.Server.csproj +++ b/src/MineCase.Server/MineCase.Server.csproj @@ -5,12 +5,21 @@ netcoreapp2.0 true true + Debug;Release;Appveyor;TravisCI latest + + latest + + + + latest + + latest @@ -30,6 +39,9 @@ + + Dockerfile + PreserveNewest @@ -43,6 +55,7 @@ + @@ -54,7 +67,7 @@ PreserveNewest - + PreserveNewest @@ -63,10 +76,13 @@ PreserveNewest - + + PreserveNewest + + PreserveNewest - + PreserveNewest diff --git a/src/MineCase.Server/OrleansConfiguration.docker.xml b/src/MineCase.Server/OrleansConfiguration.docker.xml new file mode 100644 index 00000000..e353a922 --- /dev/null +++ b/src/MineCase.Server/OrleansConfiguration.docker.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/MineCase.sln b/src/MineCase.sln index 305dd768..d9b2f453 100644 --- a/src/MineCase.sln +++ b/src/MineCase.sln @@ -50,60 +50,117 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MineCase.Client.Scripts", " EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MineCase.Client.Engine", "MineCase.Client.Engine\MineCase.Client.Engine.csproj", "{D2E3FF57-9287-4584-B8A1-57E19D44E0AF}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker", "docker", "{C32ACBC4-BA67-488B-96CD-ED6CF3255767}" +EndProject +Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker\docker-compose.dcproj", "{2974A4BE-85D2-454D-ACDE-B4BE63993B95}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Appveyor|Any CPU = Appveyor|Any CPU Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU + TravisCI|Any CPU = TravisCI|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8E71CBEC-5804-4125-B651-C78426E57C8C}.Appveyor|Any CPU.ActiveCfg = Appveyor|Any CPU + {8E71CBEC-5804-4125-B651-C78426E57C8C}.Appveyor|Any CPU.Build.0 = Appveyor|Any CPU {8E71CBEC-5804-4125-B651-C78426E57C8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8E71CBEC-5804-4125-B651-C78426E57C8C}.Debug|Any CPU.Build.0 = Debug|Any CPU {8E71CBEC-5804-4125-B651-C78426E57C8C}.Release|Any CPU.ActiveCfg = Release|Any CPU {8E71CBEC-5804-4125-B651-C78426E57C8C}.Release|Any CPU.Build.0 = Release|Any CPU + {8E71CBEC-5804-4125-B651-C78426E57C8C}.TravisCI|Any CPU.ActiveCfg = TravisCI|Any CPU + {8E71CBEC-5804-4125-B651-C78426E57C8C}.TravisCI|Any CPU.Build.0 = TravisCI|Any CPU + {08B3641D-29F1-4E2B-BA88-84B2FFB436FF}.Appveyor|Any CPU.ActiveCfg = Appveyor|Any CPU + {08B3641D-29F1-4E2B-BA88-84B2FFB436FF}.Appveyor|Any CPU.Build.0 = Appveyor|Any CPU {08B3641D-29F1-4E2B-BA88-84B2FFB436FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {08B3641D-29F1-4E2B-BA88-84B2FFB436FF}.Debug|Any CPU.Build.0 = Debug|Any CPU {08B3641D-29F1-4E2B-BA88-84B2FFB436FF}.Release|Any CPU.ActiveCfg = Release|Any CPU {08B3641D-29F1-4E2B-BA88-84B2FFB436FF}.Release|Any CPU.Build.0 = Release|Any CPU + {08B3641D-29F1-4E2B-BA88-84B2FFB436FF}.TravisCI|Any CPU.ActiveCfg = TravisCI|Any CPU + {08B3641D-29F1-4E2B-BA88-84B2FFB436FF}.TravisCI|Any CPU.Build.0 = TravisCI|Any CPU + {0842DE6C-4270-440E-9666-255A0B2EC1D9}.Appveyor|Any CPU.ActiveCfg = Appveyor|Any CPU + {0842DE6C-4270-440E-9666-255A0B2EC1D9}.Appveyor|Any CPU.Build.0 = Appveyor|Any CPU {0842DE6C-4270-440E-9666-255A0B2EC1D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0842DE6C-4270-440E-9666-255A0B2EC1D9}.Debug|Any CPU.Build.0 = Debug|Any CPU {0842DE6C-4270-440E-9666-255A0B2EC1D9}.Release|Any CPU.ActiveCfg = Release|Any CPU {0842DE6C-4270-440E-9666-255A0B2EC1D9}.Release|Any CPU.Build.0 = Release|Any CPU + {0842DE6C-4270-440E-9666-255A0B2EC1D9}.TravisCI|Any CPU.ActiveCfg = TravisCI|Any CPU + {0842DE6C-4270-440E-9666-255A0B2EC1D9}.TravisCI|Any CPU.Build.0 = TravisCI|Any CPU + {98454B69-800A-4DEB-8D13-1E244BF15507}.Appveyor|Any CPU.ActiveCfg = Appveyor|Any CPU + {98454B69-800A-4DEB-8D13-1E244BF15507}.Appveyor|Any CPU.Build.0 = Appveyor|Any CPU {98454B69-800A-4DEB-8D13-1E244BF15507}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {98454B69-800A-4DEB-8D13-1E244BF15507}.Debug|Any CPU.Build.0 = Debug|Any CPU {98454B69-800A-4DEB-8D13-1E244BF15507}.Release|Any CPU.ActiveCfg = Release|Any CPU {98454B69-800A-4DEB-8D13-1E244BF15507}.Release|Any CPU.Build.0 = Release|Any CPU + {98454B69-800A-4DEB-8D13-1E244BF15507}.TravisCI|Any CPU.ActiveCfg = TravisCI|Any CPU + {98454B69-800A-4DEB-8D13-1E244BF15507}.TravisCI|Any CPU.Build.0 = TravisCI|Any CPU + {3F83DE42-121D-4E7A-AB27-825AD8179D3C}.Appveyor|Any CPU.ActiveCfg = Appveyor|Any CPU + {3F83DE42-121D-4E7A-AB27-825AD8179D3C}.Appveyor|Any CPU.Build.0 = Appveyor|Any CPU {3F83DE42-121D-4E7A-AB27-825AD8179D3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3F83DE42-121D-4E7A-AB27-825AD8179D3C}.Debug|Any CPU.Build.0 = Debug|Any CPU {3F83DE42-121D-4E7A-AB27-825AD8179D3C}.Release|Any CPU.ActiveCfg = Release|Any CPU {3F83DE42-121D-4E7A-AB27-825AD8179D3C}.Release|Any CPU.Build.0 = Release|Any CPU + {3F83DE42-121D-4E7A-AB27-825AD8179D3C}.TravisCI|Any CPU.ActiveCfg = TravisCI|Any CPU + {3F83DE42-121D-4E7A-AB27-825AD8179D3C}.TravisCI|Any CPU.Build.0 = TravisCI|Any CPU + {35618D69-85F0-4C38-8224-04A2D75825B6}.Appveyor|Any CPU.ActiveCfg = Appveyor|Any CPU + {35618D69-85F0-4C38-8224-04A2D75825B6}.Appveyor|Any CPU.Build.0 = Appveyor|Any CPU {35618D69-85F0-4C38-8224-04A2D75825B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {35618D69-85F0-4C38-8224-04A2D75825B6}.Debug|Any CPU.Build.0 = Debug|Any CPU {35618D69-85F0-4C38-8224-04A2D75825B6}.Release|Any CPU.ActiveCfg = Release|Any CPU {35618D69-85F0-4C38-8224-04A2D75825B6}.Release|Any CPU.Build.0 = Release|Any CPU + {35618D69-85F0-4C38-8224-04A2D75825B6}.TravisCI|Any CPU.ActiveCfg = TravisCI|Any CPU + {35618D69-85F0-4C38-8224-04A2D75825B6}.TravisCI|Any CPU.Build.0 = TravisCI|Any CPU + {199335D6-9726-42E1-94F2-7D95932D4DDC}.Appveyor|Any CPU.ActiveCfg = Appveyor|Any CPU + {199335D6-9726-42E1-94F2-7D95932D4DDC}.Appveyor|Any CPU.Build.0 = Appveyor|Any CPU {199335D6-9726-42E1-94F2-7D95932D4DDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {199335D6-9726-42E1-94F2-7D95932D4DDC}.Debug|Any CPU.Build.0 = Debug|Any CPU {199335D6-9726-42E1-94F2-7D95932D4DDC}.Release|Any CPU.ActiveCfg = Release|Any CPU {199335D6-9726-42E1-94F2-7D95932D4DDC}.Release|Any CPU.Build.0 = Release|Any CPU + {199335D6-9726-42E1-94F2-7D95932D4DDC}.TravisCI|Any CPU.ActiveCfg = TravisCI|Any CPU + {199335D6-9726-42E1-94F2-7D95932D4DDC}.TravisCI|Any CPU.Build.0 = TravisCI|Any CPU + {47C1F452-E59C-42E3-8799-BF09444D8384}.Appveyor|Any CPU.ActiveCfg = Appveyor|Any CPU + {47C1F452-E59C-42E3-8799-BF09444D8384}.Appveyor|Any CPU.Build.0 = Appveyor|Any CPU {47C1F452-E59C-42E3-8799-BF09444D8384}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {47C1F452-E59C-42E3-8799-BF09444D8384}.Debug|Any CPU.Build.0 = Debug|Any CPU {47C1F452-E59C-42E3-8799-BF09444D8384}.Release|Any CPU.ActiveCfg = Release|Any CPU {47C1F452-E59C-42E3-8799-BF09444D8384}.Release|Any CPU.Build.0 = Release|Any CPU + {47C1F452-E59C-42E3-8799-BF09444D8384}.TravisCI|Any CPU.ActiveCfg = TravisCI|Any CPU + {47C1F452-E59C-42E3-8799-BF09444D8384}.TravisCI|Any CPU.Build.0 = TravisCI|Any CPU + {B7B1A959-72F3-42C6-B138-93C8D654F139}.Appveyor|Any CPU.ActiveCfg = Appveyor|Any CPU + {B7B1A959-72F3-42C6-B138-93C8D654F139}.Appveyor|Any CPU.Build.0 = Appveyor|Any CPU {B7B1A959-72F3-42C6-B138-93C8D654F139}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B7B1A959-72F3-42C6-B138-93C8D654F139}.Debug|Any CPU.Build.0 = Debug|Any CPU {B7B1A959-72F3-42C6-B138-93C8D654F139}.Release|Any CPU.ActiveCfg = Release|Any CPU {B7B1A959-72F3-42C6-B138-93C8D654F139}.Release|Any CPU.Build.0 = Release|Any CPU + {B7B1A959-72F3-42C6-B138-93C8D654F139}.TravisCI|Any CPU.ActiveCfg = TravisCI|Any CPU + {B7B1A959-72F3-42C6-B138-93C8D654F139}.TravisCI|Any CPU.Build.0 = TravisCI|Any CPU + {76AFDAE6-75F7-4E68-86CD-DE19CA47246B}.Appveyor|Any CPU.ActiveCfg = Appveyor|Any CPU + {76AFDAE6-75F7-4E68-86CD-DE19CA47246B}.Appveyor|Any CPU.Build.0 = Appveyor|Any CPU {76AFDAE6-75F7-4E68-86CD-DE19CA47246B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {76AFDAE6-75F7-4E68-86CD-DE19CA47246B}.Debug|Any CPU.Build.0 = Debug|Any CPU {76AFDAE6-75F7-4E68-86CD-DE19CA47246B}.Release|Any CPU.ActiveCfg = Release|Any CPU {76AFDAE6-75F7-4E68-86CD-DE19CA47246B}.Release|Any CPU.Build.0 = Release|Any CPU + {76AFDAE6-75F7-4E68-86CD-DE19CA47246B}.TravisCI|Any CPU.ActiveCfg = TravisCI|Any CPU + {76AFDAE6-75F7-4E68-86CD-DE19CA47246B}.TravisCI|Any CPU.Build.0 = TravisCI|Any CPU + {D586FFBB-7265-47CF-AD80-77AC7ACB0FF1}.Appveyor|Any CPU.ActiveCfg = Appveyor|Any CPU + {D586FFBB-7265-47CF-AD80-77AC7ACB0FF1}.Appveyor|Any CPU.Build.0 = Appveyor|Any CPU {D586FFBB-7265-47CF-AD80-77AC7ACB0FF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D586FFBB-7265-47CF-AD80-77AC7ACB0FF1}.Debug|Any CPU.Build.0 = Debug|Any CPU {D586FFBB-7265-47CF-AD80-77AC7ACB0FF1}.Release|Any CPU.ActiveCfg = Release|Any CPU {D586FFBB-7265-47CF-AD80-77AC7ACB0FF1}.Release|Any CPU.Build.0 = Release|Any CPU + {D586FFBB-7265-47CF-AD80-77AC7ACB0FF1}.TravisCI|Any CPU.ActiveCfg = TravisCI|Any CPU + {D2E3FF57-9287-4584-B8A1-57E19D44E0AF}.Appveyor|Any CPU.ActiveCfg = Appveyor|Any CPU + {D2E3FF57-9287-4584-B8A1-57E19D44E0AF}.Appveyor|Any CPU.Build.0 = Appveyor|Any CPU {D2E3FF57-9287-4584-B8A1-57E19D44E0AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D2E3FF57-9287-4584-B8A1-57E19D44E0AF}.Debug|Any CPU.Build.0 = Debug|Any CPU {D2E3FF57-9287-4584-B8A1-57E19D44E0AF}.Release|Any CPU.ActiveCfg = Release|Any CPU {D2E3FF57-9287-4584-B8A1-57E19D44E0AF}.Release|Any CPU.Build.0 = Release|Any CPU + {D2E3FF57-9287-4584-B8A1-57E19D44E0AF}.TravisCI|Any CPU.ActiveCfg = TravisCI|Any CPU + {2974A4BE-85D2-454D-ACDE-B4BE63993B95}.Appveyor|Any CPU.ActiveCfg = Appveyor|Any CPU + {2974A4BE-85D2-454D-ACDE-B4BE63993B95}.Appveyor|Any CPU.Build.0 = Appveyor|Any CPU + {2974A4BE-85D2-454D-ACDE-B4BE63993B95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2974A4BE-85D2-454D-ACDE-B4BE63993B95}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2974A4BE-85D2-454D-ACDE-B4BE63993B95}.TravisCI|Any CPU.ActiveCfg = TravisCI|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -121,6 +178,7 @@ Global {76AFDAE6-75F7-4E68-86CD-DE19CA47246B} = {1077810B-83FF-405E-94BD-95AFC284A416} {D586FFBB-7265-47CF-AD80-77AC7ACB0FF1} = {5FE43A62-34E9-44CC-B5FF-D66EC916CFA1} {D2E3FF57-9287-4584-B8A1-57E19D44E0AF} = {5FE43A62-34E9-44CC-B5FF-D66EC916CFA1} + {2974A4BE-85D2-454D-ACDE-B4BE63993B95} = {C32ACBC4-BA67-488B-96CD-ED6CF3255767} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7AB995C3-E961-463C-8A55-3149C51761B5} diff --git a/src/docker/docker-compose.ci.build.yml b/src/docker/docker-compose.ci.build.yml new file mode 100644 index 00000000..6bdf591f --- /dev/null +++ b/src/docker/docker-compose.ci.build.yml @@ -0,0 +1 @@ +version: '3' diff --git a/src/docker/docker-compose.dcproj b/src/docker/docker-compose.dcproj new file mode 100644 index 00000000..4825502a --- /dev/null +++ b/src/docker/docker-compose.dcproj @@ -0,0 +1,33 @@ + + + + + Appveyor + AnyCPU + + + Debug + AnyCPU + + + Release + AnyCPU + + + TravisCI + AnyCPU + + + + 2.0 + Windows + 2974a4be-85d2-454d-acde-b4be63993b95 + + + + + docker-compose.yml + + + + \ No newline at end of file diff --git a/src/docker/docker-compose.override.yml b/src/docker/docker-compose.override.yml new file mode 100644 index 00000000..44a604a2 --- /dev/null +++ b/src/docker/docker-compose.override.yml @@ -0,0 +1,6 @@ +version: '3' + +networks: + default: + external: + name: nat diff --git a/src/docker/docker-compose.yml b/src/docker/docker-compose.yml new file mode 100644 index 00000000..b94a8e33 --- /dev/null +++ b/src/docker/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3' + +services: + minecase.server: + image: minecase.server + build: + context: ../MineCase.Server + dockerfile: Dockerfile + + minecase.gateway: + image: minecase.gateway + build: + context: ../MineCase.Gateway + dockerfile: Dockerfile diff --git a/tests/UnitTest/MineCase.UnitTest.csproj b/tests/UnitTest/MineCase.UnitTest.csproj index 0b26526a..f2d99a7c 100644 --- a/tests/UnitTest/MineCase.UnitTest.csproj +++ b/tests/UnitTest/MineCase.UnitTest.csproj @@ -3,6 +3,7 @@ netcoreapp2.0 ../../build/Analyzers.ruleset + Debug;Release;Appveyor;TravisCI