another another variant (

This commit is contained in:
2015-02-25 02:14:37 +06:00
parent b449d7520b
commit 980e4a92cf
9 changed files with 581 additions and 105 deletions

View File

@@ -12,57 +12,129 @@ SceneSettings:
backfaceThreshold: 100
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 5
m_Fog: 0
m_FogColor: {r: .5, g: .5, b: .5, a: 1}
m_FogMode: 3
m_FogDensity: .00999999978
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientLight: {r: .200000003, g: .200000003, b: .200000003, a: 1}
m_AmbientSkyColor: {r: .200000003, g: .200000003, b: .200000003, a: 1}
m_AmbientEquatorColor: {r: .200000003, g: .200000003, b: .200000003, a: 1}
m_AmbientGroundColor: {r: .200000003, g: .200000003, b: .200000003, a: 1}
m_AmbientIntensity: 1
m_AmbientProbe:
sh[ 0]: 0
sh[ 1]: 0
sh[ 2]: 0
sh[ 3]: 0
sh[ 4]: 0
sh[ 5]: 0
sh[ 6]: 0
sh[ 7]: 0
sh[ 8]: 0
sh[ 9]: 0
sh[10]: 0
sh[11]: 0
sh[12]: 0
sh[13]: 0
sh[14]: 0
sh[15]: 0
sh[16]: 0
sh[17]: 0
sh[18]: 0
sh[19]: 0
sh[20]: 0
sh[21]: 0
sh[22]: 0
sh[23]: 0
sh[24]: 0
sh[25]: 0
sh[26]: 0
m_AmbientProbeInGamma:
sh[ 0]: 0
sh[ 1]: 0
sh[ 2]: 0
sh[ 3]: 0
sh[ 4]: 0
sh[ 5]: 0
sh[ 6]: 0
sh[ 7]: 0
sh[ 8]: 0
sh[ 9]: 0
sh[10]: 0
sh[11]: 0
sh[12]: 0
sh[13]: 0
sh[14]: 0
sh[15]: 0
sh[16]: 0
sh[17]: 0
sh[18]: 0
sh[19]: 0
sh[20]: 0
sh[21]: 0
sh[22]: 0
sh[23]: 0
sh[24]: 0
sh[25]: 0
sh[26]: 0
m_AmbientMode: 3
m_SkyboxMaterial: {fileID: 0}
m_HaloStrength: .5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 0}
m_ObjectHideFlags: 0
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_GeneratedSkyboxReflection: {fileID: 0}
m_Sun: {fileID: 0}
--- !u!127 &3
LevelGameManager:
m_ObjectHideFlags: 0
--- !u!157 &4
LightmapSettings:
m_ObjectHideFlags: 0
m_LightProbes: {fileID: 0}
m_Lightmaps: []
serializedVersion: 4
m_GIWorkflowMode: 1
m_LightmapsModeLegacy: 1
m_LightmapsMode: 1
m_BakedColorSpace: 0
m_UseDualLightmapsInForward: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 0
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
m_Resolution: 50
m_LastUsedResolution: 0
serializedVersion: 3
m_Resolution: 2
m_BakeResolution: 50
m_TextureWidth: 1024
m_TextureHeight: 1024
m_BounceBoost: 1
m_BounceIntensity: 1
m_SkyLightColor: {r: .860000014, g: .930000007, b: 1, a: 1}
m_SkyLightIntensity: 0
m_Quality: 0
m_Bounces: 1
m_FinalGatherRays: 1000
m_FinalGatherContrastThreshold: .0500000007
m_FinalGatherGradientThreshold: 0
m_FinalGatherInterpolationPoints: 15
m_AOAmount: 0
m_AOMaxDistance: .100000001
m_AOContrast: 1
m_LODSurfaceMappingDistance: 1
m_Padding: 0
m_AOMaxDistance: 1
m_Padding: 2
m_CompAOExponent: 0
m_LightmapParameters: {fileID: 0}
m_TextureCompression: 0
m_LockAtlas: 0
m_FinalGather: 0
m_FinalGatherRayCount: 1024
m_LightmapSnapshot: {fileID: 0}
m_RuntimeCPUUsage: 25
--- !u!196 &5
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentRadius: .5
agentHeight: 2
agentSlope: 45
@@ -71,9 +143,167 @@ NavMeshSettings:
maxJumpAcrossDistance: 0
accuratePlacement: 0
minRegionArea: 2
widthInaccuracy: 16.666666
heightInaccuracy: 10
m_NavMesh: {fileID: 0}
cellSize: .166666657
manualCellSize: 0
m_NavMeshData: {fileID: 0}
--- !u!1001 &373824665
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: m_LocalPosition.x
value: 96
objectReference: {fileID: 0}
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: m_LocalPosition.y
value: 16
objectReference: {fileID: 0}
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: m_LocalPosition.z
value: 800
objectReference: {fileID: 0}
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 11453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: _position.x
value: 4
objectReference: {fileID: 0}
- target: {fileID: 11453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: _position.y
value: -2
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
m_IsPrefabParent: 0
--- !u!1001 &616856651
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: m_LocalPosition.x
value: 80
objectReference: {fileID: 0}
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: m_LocalPosition.y
value: -8
objectReference: {fileID: 0}
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: m_LocalPosition.z
value: 200
objectReference: {fileID: 0}
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
- target: {fileID: 11462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: _position.x
value: 2
objectReference: {fileID: 0}
- target: {fileID: 11462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: _position.y
value: -3
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
m_IsPrefabParent: 0
--- !u!1001 &870804156
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: m_LocalPosition.x
value: 80
objectReference: {fileID: 0}
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: m_LocalPosition.y
value: 8
objectReference: {fileID: 0}
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 11462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: _position.x
value: 2
objectReference: {fileID: 0}
- target: {fileID: 11462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: _position.y
value: -3
objectReference: {fileID: 0}
- target: {fileID: 162204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: m_Name
value: Cube_3x1x4
objectReference: {fileID: 0}
- target: {fileID: 11462204, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
propertyPath: _position.z
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: fb3806e9ed7ada045b1b57419ac1ee53, type: 2}
m_IsPrefabParent: 0
--- !u!1 &897463912
GameObject:
m_ObjectHideFlags: 0
@@ -146,8 +376,8 @@ Camera:
y: 0
width: 1
height: 1
near clip plane: .300000012
far clip plane: 1000
near clip plane: -.300000012
far clip plane: 500
field of view: 60
orthographic: 1
orthographic size: 150
@@ -173,4 +403,128 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_RootOrder: 5
--- !u!1001 &1535022648
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 463702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
propertyPath: m_LocalPosition.x
value: 64
objectReference: {fileID: 0}
- target: {fileID: 463702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
propertyPath: m_LocalPosition.z
value: 400
objectReference: {fileID: 0}
- target: {fileID: 463702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 463702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 11463702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
propertyPath: _position.x
value: 2
objectReference: {fileID: 0}
- target: {fileID: 11463702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
propertyPath: _position.y
value: -2
objectReference: {fileID: 0}
- target: {fileID: 21263702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
propertyPath: m_Color.r
value: .53103447
objectReference: {fileID: 0}
- target: {fileID: 21263702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
propertyPath: m_Color.g
value: 1
objectReference: {fileID: 0}
- target: {fileID: 21263702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
propertyPath: m_Color.b
value: 0
objectReference: {fileID: 0}
- target: {fileID: 21263702, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
propertyPath: m_Color.a
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 6dac6372d911f0646a34e2e83f03c30c, type: 2}
m_IsPrefabParent: 0
--- !u!1001 &1696404621
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: m_LocalPosition.x
value: 96
objectReference: {fileID: 0}
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: m_LocalPosition.y
value: 32
objectReference: {fileID: 0}
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: m_LocalPosition.z
value: 600
objectReference: {fileID: 0}
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: _position.x
value: 4
objectReference: {fileID: 0}
- target: {fileID: 11453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: _position.y
value: -2
objectReference: {fileID: 0}
- target: {fileID: 153620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: m_Name
value: Cube_1x3x9
objectReference: {fileID: 0}
- target: {fileID: 11453620, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
propertyPath: _position.z
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: dbd21aa1b9a2cdf4a944f50e64d145a1, type: 2}
m_IsPrefabParent: 0

View File

@@ -145,7 +145,6 @@ namespace IsoTools {
if ( !Mathf.Approximately(_lastTransform.x, transform.position.x) ||
!Mathf.Approximately(_lastTransform.y, transform.position.y))
{
Debug.Log("Change pos: " + gameObject.name);
FixIsoPosition();
}
if ( _lastPosition != _position ) Position = _position;

View File

@@ -1,5 +1,6 @@
using UnityEngine;
using System.Linq;
using System;
using System.Collections.Generic;
namespace IsoTools {
@@ -98,6 +99,9 @@ namespace IsoTools {
// ------------------------------------------------------------------------
public void MarkDirty(IsoObject obj) {
_dirtyObjects.Add(obj);
if ( !_dirty ) {
//ManualSort(obj, Scan)
}
}
// ------------------------------------------------------------------------
@@ -202,10 +206,16 @@ namespace IsoTools {
}
IList<ObjectInfo> ScanObjects() {
return ScanObjects(p => true);
}
IList<ObjectInfo> ScanObjects(Func<IsoObject, bool> filter) {
var iso_objects = GameObject.FindObjectsOfType<IsoObject>();
var objects = new List<ObjectInfo>(iso_objects.Length);
foreach ( var iso_object in iso_objects ) {
objects.Add(new ObjectInfo(iso_object));
if ( filter(iso_object) ) {
objects.Add(new ObjectInfo(iso_object));
}
}
return objects;
}
@@ -255,7 +265,7 @@ namespace IsoTools {
}
//TODO: magic number
var min_depth_step = 0.01f;
if ( Mathf.Abs(max_depth - min_depth) < min_depth_step ) {
if ( max_depth < min_depth || Mathf.Abs(max_depth - min_depth) < min_depth_step ) {
MarkDirty();
} else {
PlaceObject(obj, (min_depth + max_depth) / 2.0f);
@@ -280,47 +290,24 @@ namespace IsoTools {
}
}
/*
void StepSort() {
if ( _dirty || _dirtyObjects.Count > 0 ) {
var objects = ScanObjects().Where(p => p.IsoObject.Sorting).ToList();
if ( _dirty ) {
ManualSort(objects);
Debug.Log("Resort!");
} else {
foreach ( var obj in _dirtyObjects ) {
ManualSort(obj, objects);
if ( _dirty ) {
ManualSort(objects);
Debug.Log("Need Resort!");
break;
}
}
}
while ( !_dirty && _dirtyObjects.Count > 0 ) {
var objects = ScanObjects(p => p.Sorting && !_dirtyObjects.Contains(p));
var obj = _dirtyObjects.First();
ManualSort(obj, objects);
_dirtyObjects.Remove(obj);
}
if ( _dirty ) {
ManualSort(ScanObjects(p => p.Sorting));
_dirty = false;
_dirtyObjects.Clear();
}
}*/
void StepSort() {
while ( _dirty || _dirtyObjects.Count > 0 ) {
if ( _dirty ) {
var objects = ScanObjects().Where(p => p.IsoObject.Sorting).ToList();
ManualSort(objects);
_dirty = false;
Debug.Log("Resort!");
} else {
var objects = ScanObjects().Where(p => p.IsoObject.Sorting).ToList();
var obj = _dirtyObjects.First();
ManualSort(obj, objects);
_dirtyObjects.Remove(obj);
}
Debug.Log("Resort!");
}
}
void Start() {
ChangeSortingProperty();
ManualSort(ScanObjects());
StepSort();
}
void LateUpdate() {