diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta new file mode 100644 index 0000000..feaeb1a --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a0a84254a5c99014baef47c424915bba +timeCreated: 1572212834 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta new file mode 100644 index 0000000..feaeb1a --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a0a84254a5c99014baef47c424915bba +timeCreated: 1572212834 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree.prefab b/FallUnity/Assets/Trees/Tree.prefab new file mode 100644 index 0000000..9ace761 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab @@ -0,0 +1,166 @@ +%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: 1138802500347032} + m_IsPrefabParent: 1 +--- !u!1 &1138802500347032 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4129064820502644} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1950375439190738 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4741674135191680} + - component: {fileID: 33832939875228066} + - component: {fileID: 23611646918467892} + - component: {fileID: 114012811021287998} + - component: {fileID: 136388466304859462} + - component: {fileID: 135889288384560452} + m_Layer: 11 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4129064820502644 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138802500347032} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5.16, y: 3.67, z: 4.72} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4741674135191680} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4741674135191680 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3.02, z: 0} + m_LocalScale: {x: 2.8154705, y: 5.9054947, z: 2.6366587} + m_Children: [] + m_Father: {fileID: 4129064820502644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23611646918467892 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: d76887554d5b2e441b3ecb5e4e52b392, 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: 1 + 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 &33832939875228066 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &114012811021287998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b34189096d561ef48859c46a7d8eac3b, type: 3} + m_Name: + m_EditorClassIdentifier: + CameraSpace: {x: 0, y: 0, z: 0} + SetDepth: 0 + LinkedImage: {fileID: 0} + lastPos: {x: 0, y: 0, z: 0} + IsoRadius: 0 + IsoPerspective: 0 + AllowMovedFlag: 0 + ObjectManualDepth: 10 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 + Custom: 0 + IsoType: 1 +--- !u!135 &135889288384560452 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.38 + m_Center: {x: 0, y: 0.21, z: -0.00000011920929} +--- !u!136 &136388466304859462 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.23 + m_Height: 0.7 + m_Direction: 1 + m_Center: {x: -0.00000023841858, y: -0.3, z: -0.000000059604645} diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta new file mode 100644 index 0000000..feaeb1a --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a0a84254a5c99014baef47c424915bba +timeCreated: 1572212834 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree.prefab b/FallUnity/Assets/Trees/Tree.prefab new file mode 100644 index 0000000..9ace761 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab @@ -0,0 +1,166 @@ +%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: 1138802500347032} + m_IsPrefabParent: 1 +--- !u!1 &1138802500347032 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4129064820502644} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1950375439190738 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4741674135191680} + - component: {fileID: 33832939875228066} + - component: {fileID: 23611646918467892} + - component: {fileID: 114012811021287998} + - component: {fileID: 136388466304859462} + - component: {fileID: 135889288384560452} + m_Layer: 11 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4129064820502644 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138802500347032} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5.16, y: 3.67, z: 4.72} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4741674135191680} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4741674135191680 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3.02, z: 0} + m_LocalScale: {x: 2.8154705, y: 5.9054947, z: 2.6366587} + m_Children: [] + m_Father: {fileID: 4129064820502644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23611646918467892 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: d76887554d5b2e441b3ecb5e4e52b392, 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: 1 + 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 &33832939875228066 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &114012811021287998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b34189096d561ef48859c46a7d8eac3b, type: 3} + m_Name: + m_EditorClassIdentifier: + CameraSpace: {x: 0, y: 0, z: 0} + SetDepth: 0 + LinkedImage: {fileID: 0} + lastPos: {x: 0, y: 0, z: 0} + IsoRadius: 0 + IsoPerspective: 0 + AllowMovedFlag: 0 + ObjectManualDepth: 10 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 + Custom: 0 + IsoType: 1 +--- !u!135 &135889288384560452 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.38 + m_Center: {x: 0, y: 0.21, z: -0.00000011920929} +--- !u!136 &136388466304859462 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.23 + m_Height: 0.7 + m_Direction: 1 + m_Center: {x: -0.00000023841858, y: -0.3, z: -0.000000059604645} diff --git a/FallUnity/Assets/Trees/Tree.prefab.meta b/FallUnity/Assets/Trees/Tree.prefab.meta new file mode 100644 index 0000000..523f02e --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 989a13a51252a6446b729edc777df00f +timeCreated: 1572212652 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta new file mode 100644 index 0000000..feaeb1a --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a0a84254a5c99014baef47c424915bba +timeCreated: 1572212834 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree.prefab b/FallUnity/Assets/Trees/Tree.prefab new file mode 100644 index 0000000..9ace761 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab @@ -0,0 +1,166 @@ +%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: 1138802500347032} + m_IsPrefabParent: 1 +--- !u!1 &1138802500347032 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4129064820502644} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1950375439190738 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4741674135191680} + - component: {fileID: 33832939875228066} + - component: {fileID: 23611646918467892} + - component: {fileID: 114012811021287998} + - component: {fileID: 136388466304859462} + - component: {fileID: 135889288384560452} + m_Layer: 11 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4129064820502644 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138802500347032} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5.16, y: 3.67, z: 4.72} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4741674135191680} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4741674135191680 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3.02, z: 0} + m_LocalScale: {x: 2.8154705, y: 5.9054947, z: 2.6366587} + m_Children: [] + m_Father: {fileID: 4129064820502644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23611646918467892 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: d76887554d5b2e441b3ecb5e4e52b392, 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: 1 + 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 &33832939875228066 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &114012811021287998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b34189096d561ef48859c46a7d8eac3b, type: 3} + m_Name: + m_EditorClassIdentifier: + CameraSpace: {x: 0, y: 0, z: 0} + SetDepth: 0 + LinkedImage: {fileID: 0} + lastPos: {x: 0, y: 0, z: 0} + IsoRadius: 0 + IsoPerspective: 0 + AllowMovedFlag: 0 + ObjectManualDepth: 10 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 + Custom: 0 + IsoType: 1 +--- !u!135 &135889288384560452 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.38 + m_Center: {x: 0, y: 0.21, z: -0.00000011920929} +--- !u!136 &136388466304859462 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.23 + m_Height: 0.7 + m_Direction: 1 + m_Center: {x: -0.00000023841858, y: -0.3, z: -0.000000059604645} diff --git a/FallUnity/Assets/Trees/Tree.prefab.meta b/FallUnity/Assets/Trees/Tree.prefab.meta new file mode 100644 index 0000000..523f02e --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 989a13a51252a6446b729edc777df00f +timeCreated: 1572212652 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png new file mode 100644 index 0000000..2819eda --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png Binary files differ diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta new file mode 100644 index 0000000..feaeb1a --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a0a84254a5c99014baef47c424915bba +timeCreated: 1572212834 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree.prefab b/FallUnity/Assets/Trees/Tree.prefab new file mode 100644 index 0000000..9ace761 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab @@ -0,0 +1,166 @@ +%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: 1138802500347032} + m_IsPrefabParent: 1 +--- !u!1 &1138802500347032 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4129064820502644} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1950375439190738 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4741674135191680} + - component: {fileID: 33832939875228066} + - component: {fileID: 23611646918467892} + - component: {fileID: 114012811021287998} + - component: {fileID: 136388466304859462} + - component: {fileID: 135889288384560452} + m_Layer: 11 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4129064820502644 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138802500347032} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5.16, y: 3.67, z: 4.72} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4741674135191680} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4741674135191680 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3.02, z: 0} + m_LocalScale: {x: 2.8154705, y: 5.9054947, z: 2.6366587} + m_Children: [] + m_Father: {fileID: 4129064820502644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23611646918467892 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: d76887554d5b2e441b3ecb5e4e52b392, 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: 1 + 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 &33832939875228066 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &114012811021287998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b34189096d561ef48859c46a7d8eac3b, type: 3} + m_Name: + m_EditorClassIdentifier: + CameraSpace: {x: 0, y: 0, z: 0} + SetDepth: 0 + LinkedImage: {fileID: 0} + lastPos: {x: 0, y: 0, z: 0} + IsoRadius: 0 + IsoPerspective: 0 + AllowMovedFlag: 0 + ObjectManualDepth: 10 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 + Custom: 0 + IsoType: 1 +--- !u!135 &135889288384560452 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.38 + m_Center: {x: 0, y: 0.21, z: -0.00000011920929} +--- !u!136 &136388466304859462 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.23 + m_Height: 0.7 + m_Direction: 1 + m_Center: {x: -0.00000023841858, y: -0.3, z: -0.000000059604645} diff --git a/FallUnity/Assets/Trees/Tree.prefab.meta b/FallUnity/Assets/Trees/Tree.prefab.meta new file mode 100644 index 0000000..523f02e --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 989a13a51252a6446b729edc777df00f +timeCreated: 1572212652 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png new file mode 100644 index 0000000..2819eda --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta new file mode 100644 index 0000000..51fc711 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 00d2204e385a5594a902ef411b6fcbd6 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta new file mode 100644 index 0000000..feaeb1a --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a0a84254a5c99014baef47c424915bba +timeCreated: 1572212834 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree.prefab b/FallUnity/Assets/Trees/Tree.prefab new file mode 100644 index 0000000..9ace761 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab @@ -0,0 +1,166 @@ +%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: 1138802500347032} + m_IsPrefabParent: 1 +--- !u!1 &1138802500347032 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4129064820502644} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1950375439190738 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4741674135191680} + - component: {fileID: 33832939875228066} + - component: {fileID: 23611646918467892} + - component: {fileID: 114012811021287998} + - component: {fileID: 136388466304859462} + - component: {fileID: 135889288384560452} + m_Layer: 11 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4129064820502644 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138802500347032} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5.16, y: 3.67, z: 4.72} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4741674135191680} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4741674135191680 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3.02, z: 0} + m_LocalScale: {x: 2.8154705, y: 5.9054947, z: 2.6366587} + m_Children: [] + m_Father: {fileID: 4129064820502644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23611646918467892 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: d76887554d5b2e441b3ecb5e4e52b392, 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: 1 + 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 &33832939875228066 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &114012811021287998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b34189096d561ef48859c46a7d8eac3b, type: 3} + m_Name: + m_EditorClassIdentifier: + CameraSpace: {x: 0, y: 0, z: 0} + SetDepth: 0 + LinkedImage: {fileID: 0} + lastPos: {x: 0, y: 0, z: 0} + IsoRadius: 0 + IsoPerspective: 0 + AllowMovedFlag: 0 + ObjectManualDepth: 10 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 + Custom: 0 + IsoType: 1 +--- !u!135 &135889288384560452 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.38 + m_Center: {x: 0, y: 0.21, z: -0.00000011920929} +--- !u!136 &136388466304859462 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.23 + m_Height: 0.7 + m_Direction: 1 + m_Center: {x: -0.00000023841858, y: -0.3, z: -0.000000059604645} diff --git a/FallUnity/Assets/Trees/Tree.prefab.meta b/FallUnity/Assets/Trees/Tree.prefab.meta new file mode 100644 index 0000000..523f02e --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 989a13a51252a6446b729edc777df00f +timeCreated: 1572212652 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png new file mode 100644 index 0000000..2819eda --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta new file mode 100644 index 0000000..51fc711 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 00d2204e385a5594a902ef411b6fcbd6 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree2_FallingLeaves.png b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png new file mode 100644 index 0000000..a6532fc --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png Binary files differ diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta new file mode 100644 index 0000000..feaeb1a --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a0a84254a5c99014baef47c424915bba +timeCreated: 1572212834 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree.prefab b/FallUnity/Assets/Trees/Tree.prefab new file mode 100644 index 0000000..9ace761 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab @@ -0,0 +1,166 @@ +%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: 1138802500347032} + m_IsPrefabParent: 1 +--- !u!1 &1138802500347032 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4129064820502644} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1950375439190738 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4741674135191680} + - component: {fileID: 33832939875228066} + - component: {fileID: 23611646918467892} + - component: {fileID: 114012811021287998} + - component: {fileID: 136388466304859462} + - component: {fileID: 135889288384560452} + m_Layer: 11 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4129064820502644 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138802500347032} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5.16, y: 3.67, z: 4.72} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4741674135191680} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4741674135191680 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3.02, z: 0} + m_LocalScale: {x: 2.8154705, y: 5.9054947, z: 2.6366587} + m_Children: [] + m_Father: {fileID: 4129064820502644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23611646918467892 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: d76887554d5b2e441b3ecb5e4e52b392, 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: 1 + 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 &33832939875228066 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &114012811021287998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b34189096d561ef48859c46a7d8eac3b, type: 3} + m_Name: + m_EditorClassIdentifier: + CameraSpace: {x: 0, y: 0, z: 0} + SetDepth: 0 + LinkedImage: {fileID: 0} + lastPos: {x: 0, y: 0, z: 0} + IsoRadius: 0 + IsoPerspective: 0 + AllowMovedFlag: 0 + ObjectManualDepth: 10 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 + Custom: 0 + IsoType: 1 +--- !u!135 &135889288384560452 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.38 + m_Center: {x: 0, y: 0.21, z: -0.00000011920929} +--- !u!136 &136388466304859462 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.23 + m_Height: 0.7 + m_Direction: 1 + m_Center: {x: -0.00000023841858, y: -0.3, z: -0.000000059604645} diff --git a/FallUnity/Assets/Trees/Tree.prefab.meta b/FallUnity/Assets/Trees/Tree.prefab.meta new file mode 100644 index 0000000..523f02e --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 989a13a51252a6446b729edc777df00f +timeCreated: 1572212652 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png new file mode 100644 index 0000000..2819eda --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta new file mode 100644 index 0000000..51fc711 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 00d2204e385a5594a902ef411b6fcbd6 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree2_FallingLeaves.png b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png new file mode 100644 index 0000000..a6532fc --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta new file mode 100644 index 0000000..73c01e2 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: ec6a3c37d8e09de4090956ce8c52c261 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta new file mode 100644 index 0000000..feaeb1a --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a0a84254a5c99014baef47c424915bba +timeCreated: 1572212834 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree.prefab b/FallUnity/Assets/Trees/Tree.prefab new file mode 100644 index 0000000..9ace761 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab @@ -0,0 +1,166 @@ +%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: 1138802500347032} + m_IsPrefabParent: 1 +--- !u!1 &1138802500347032 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4129064820502644} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1950375439190738 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4741674135191680} + - component: {fileID: 33832939875228066} + - component: {fileID: 23611646918467892} + - component: {fileID: 114012811021287998} + - component: {fileID: 136388466304859462} + - component: {fileID: 135889288384560452} + m_Layer: 11 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4129064820502644 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138802500347032} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5.16, y: 3.67, z: 4.72} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4741674135191680} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4741674135191680 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3.02, z: 0} + m_LocalScale: {x: 2.8154705, y: 5.9054947, z: 2.6366587} + m_Children: [] + m_Father: {fileID: 4129064820502644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23611646918467892 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: d76887554d5b2e441b3ecb5e4e52b392, 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: 1 + 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 &33832939875228066 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &114012811021287998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b34189096d561ef48859c46a7d8eac3b, type: 3} + m_Name: + m_EditorClassIdentifier: + CameraSpace: {x: 0, y: 0, z: 0} + SetDepth: 0 + LinkedImage: {fileID: 0} + lastPos: {x: 0, y: 0, z: 0} + IsoRadius: 0 + IsoPerspective: 0 + AllowMovedFlag: 0 + ObjectManualDepth: 10 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 + Custom: 0 + IsoType: 1 +--- !u!135 &135889288384560452 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.38 + m_Center: {x: 0, y: 0.21, z: -0.00000011920929} +--- !u!136 &136388466304859462 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.23 + m_Height: 0.7 + m_Direction: 1 + m_Center: {x: -0.00000023841858, y: -0.3, z: -0.000000059604645} diff --git a/FallUnity/Assets/Trees/Tree.prefab.meta b/FallUnity/Assets/Trees/Tree.prefab.meta new file mode 100644 index 0000000..523f02e --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 989a13a51252a6446b729edc777df00f +timeCreated: 1572212652 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png new file mode 100644 index 0000000..2819eda --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta new file mode 100644 index 0000000..51fc711 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 00d2204e385a5594a902ef411b6fcbd6 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree2_FallingLeaves.png b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png new file mode 100644 index 0000000..a6532fc --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta new file mode 100644 index 0000000..73c01e2 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: ec6a3c37d8e09de4090956ce8c52c261 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree3_FallingLeaves.png b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png new file mode 100644 index 0000000..d5e9cf4 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png Binary files differ diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta new file mode 100644 index 0000000..feaeb1a --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a0a84254a5c99014baef47c424915bba +timeCreated: 1572212834 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree.prefab b/FallUnity/Assets/Trees/Tree.prefab new file mode 100644 index 0000000..9ace761 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab @@ -0,0 +1,166 @@ +%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: 1138802500347032} + m_IsPrefabParent: 1 +--- !u!1 &1138802500347032 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4129064820502644} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1950375439190738 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4741674135191680} + - component: {fileID: 33832939875228066} + - component: {fileID: 23611646918467892} + - component: {fileID: 114012811021287998} + - component: {fileID: 136388466304859462} + - component: {fileID: 135889288384560452} + m_Layer: 11 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4129064820502644 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138802500347032} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5.16, y: 3.67, z: 4.72} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4741674135191680} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4741674135191680 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3.02, z: 0} + m_LocalScale: {x: 2.8154705, y: 5.9054947, z: 2.6366587} + m_Children: [] + m_Father: {fileID: 4129064820502644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23611646918467892 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: d76887554d5b2e441b3ecb5e4e52b392, 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: 1 + 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 &33832939875228066 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &114012811021287998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b34189096d561ef48859c46a7d8eac3b, type: 3} + m_Name: + m_EditorClassIdentifier: + CameraSpace: {x: 0, y: 0, z: 0} + SetDepth: 0 + LinkedImage: {fileID: 0} + lastPos: {x: 0, y: 0, z: 0} + IsoRadius: 0 + IsoPerspective: 0 + AllowMovedFlag: 0 + ObjectManualDepth: 10 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 + Custom: 0 + IsoType: 1 +--- !u!135 &135889288384560452 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.38 + m_Center: {x: 0, y: 0.21, z: -0.00000011920929} +--- !u!136 &136388466304859462 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.23 + m_Height: 0.7 + m_Direction: 1 + m_Center: {x: -0.00000023841858, y: -0.3, z: -0.000000059604645} diff --git a/FallUnity/Assets/Trees/Tree.prefab.meta b/FallUnity/Assets/Trees/Tree.prefab.meta new file mode 100644 index 0000000..523f02e --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 989a13a51252a6446b729edc777df00f +timeCreated: 1572212652 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png new file mode 100644 index 0000000..2819eda --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta new file mode 100644 index 0000000..51fc711 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 00d2204e385a5594a902ef411b6fcbd6 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree2_FallingLeaves.png b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png new file mode 100644 index 0000000..a6532fc --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta new file mode 100644 index 0000000..73c01e2 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: ec6a3c37d8e09de4090956ce8c52c261 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree3_FallingLeaves.png b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png new file mode 100644 index 0000000..d5e9cf4 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta new file mode 100644 index 0000000..56b5ec9 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 3a8f753df3e300844ad45aeb726ad989 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta new file mode 100644 index 0000000..feaeb1a --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a0a84254a5c99014baef47c424915bba +timeCreated: 1572212834 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree.prefab b/FallUnity/Assets/Trees/Tree.prefab new file mode 100644 index 0000000..9ace761 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab @@ -0,0 +1,166 @@ +%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: 1138802500347032} + m_IsPrefabParent: 1 +--- !u!1 &1138802500347032 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4129064820502644} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1950375439190738 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4741674135191680} + - component: {fileID: 33832939875228066} + - component: {fileID: 23611646918467892} + - component: {fileID: 114012811021287998} + - component: {fileID: 136388466304859462} + - component: {fileID: 135889288384560452} + m_Layer: 11 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4129064820502644 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138802500347032} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5.16, y: 3.67, z: 4.72} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4741674135191680} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4741674135191680 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3.02, z: 0} + m_LocalScale: {x: 2.8154705, y: 5.9054947, z: 2.6366587} + m_Children: [] + m_Father: {fileID: 4129064820502644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23611646918467892 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: d76887554d5b2e441b3ecb5e4e52b392, 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: 1 + 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 &33832939875228066 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &114012811021287998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b34189096d561ef48859c46a7d8eac3b, type: 3} + m_Name: + m_EditorClassIdentifier: + CameraSpace: {x: 0, y: 0, z: 0} + SetDepth: 0 + LinkedImage: {fileID: 0} + lastPos: {x: 0, y: 0, z: 0} + IsoRadius: 0 + IsoPerspective: 0 + AllowMovedFlag: 0 + ObjectManualDepth: 10 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 + Custom: 0 + IsoType: 1 +--- !u!135 &135889288384560452 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.38 + m_Center: {x: 0, y: 0.21, z: -0.00000011920929} +--- !u!136 &136388466304859462 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.23 + m_Height: 0.7 + m_Direction: 1 + m_Center: {x: -0.00000023841858, y: -0.3, z: -0.000000059604645} diff --git a/FallUnity/Assets/Trees/Tree.prefab.meta b/FallUnity/Assets/Trees/Tree.prefab.meta new file mode 100644 index 0000000..523f02e --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 989a13a51252a6446b729edc777df00f +timeCreated: 1572212652 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png new file mode 100644 index 0000000..2819eda --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta new file mode 100644 index 0000000..51fc711 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 00d2204e385a5594a902ef411b6fcbd6 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree2_FallingLeaves.png b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png new file mode 100644 index 0000000..a6532fc --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta new file mode 100644 index 0000000..73c01e2 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: ec6a3c37d8e09de4090956ce8c52c261 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree3_FallingLeaves.png b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png new file mode 100644 index 0000000..d5e9cf4 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta new file mode 100644 index 0000000..56b5ec9 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 3a8f753df3e300844ad45aeb726ad989 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree4_FallingLeaves.png b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png new file mode 100644 index 0000000..ea30067 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png Binary files differ diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta new file mode 100644 index 0000000..feaeb1a --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a0a84254a5c99014baef47c424915bba +timeCreated: 1572212834 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree.prefab b/FallUnity/Assets/Trees/Tree.prefab new file mode 100644 index 0000000..9ace761 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab @@ -0,0 +1,166 @@ +%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: 1138802500347032} + m_IsPrefabParent: 1 +--- !u!1 &1138802500347032 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4129064820502644} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1950375439190738 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4741674135191680} + - component: {fileID: 33832939875228066} + - component: {fileID: 23611646918467892} + - component: {fileID: 114012811021287998} + - component: {fileID: 136388466304859462} + - component: {fileID: 135889288384560452} + m_Layer: 11 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4129064820502644 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138802500347032} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5.16, y: 3.67, z: 4.72} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4741674135191680} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4741674135191680 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3.02, z: 0} + m_LocalScale: {x: 2.8154705, y: 5.9054947, z: 2.6366587} + m_Children: [] + m_Father: {fileID: 4129064820502644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23611646918467892 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: d76887554d5b2e441b3ecb5e4e52b392, 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: 1 + 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 &33832939875228066 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &114012811021287998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b34189096d561ef48859c46a7d8eac3b, type: 3} + m_Name: + m_EditorClassIdentifier: + CameraSpace: {x: 0, y: 0, z: 0} + SetDepth: 0 + LinkedImage: {fileID: 0} + lastPos: {x: 0, y: 0, z: 0} + IsoRadius: 0 + IsoPerspective: 0 + AllowMovedFlag: 0 + ObjectManualDepth: 10 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 + Custom: 0 + IsoType: 1 +--- !u!135 &135889288384560452 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.38 + m_Center: {x: 0, y: 0.21, z: -0.00000011920929} +--- !u!136 &136388466304859462 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.23 + m_Height: 0.7 + m_Direction: 1 + m_Center: {x: -0.00000023841858, y: -0.3, z: -0.000000059604645} diff --git a/FallUnity/Assets/Trees/Tree.prefab.meta b/FallUnity/Assets/Trees/Tree.prefab.meta new file mode 100644 index 0000000..523f02e --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 989a13a51252a6446b729edc777df00f +timeCreated: 1572212652 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png new file mode 100644 index 0000000..2819eda --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta new file mode 100644 index 0000000..51fc711 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 00d2204e385a5594a902ef411b6fcbd6 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree2_FallingLeaves.png b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png new file mode 100644 index 0000000..a6532fc --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta new file mode 100644 index 0000000..73c01e2 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: ec6a3c37d8e09de4090956ce8c52c261 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree3_FallingLeaves.png b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png new file mode 100644 index 0000000..d5e9cf4 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta new file mode 100644 index 0000000..56b5ec9 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 3a8f753df3e300844ad45aeb726ad989 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree4_FallingLeaves.png b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png new file mode 100644 index 0000000..ea30067 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta new file mode 100644 index 0000000..af49cf8 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: d8405aa078e010a4c81716b9bae1d194 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta new file mode 100644 index 0000000..feaeb1a --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a0a84254a5c99014baef47c424915bba +timeCreated: 1572212834 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree.prefab b/FallUnity/Assets/Trees/Tree.prefab new file mode 100644 index 0000000..9ace761 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab @@ -0,0 +1,166 @@ +%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: 1138802500347032} + m_IsPrefabParent: 1 +--- !u!1 &1138802500347032 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4129064820502644} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1950375439190738 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4741674135191680} + - component: {fileID: 33832939875228066} + - component: {fileID: 23611646918467892} + - component: {fileID: 114012811021287998} + - component: {fileID: 136388466304859462} + - component: {fileID: 135889288384560452} + m_Layer: 11 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4129064820502644 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138802500347032} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5.16, y: 3.67, z: 4.72} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4741674135191680} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4741674135191680 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3.02, z: 0} + m_LocalScale: {x: 2.8154705, y: 5.9054947, z: 2.6366587} + m_Children: [] + m_Father: {fileID: 4129064820502644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23611646918467892 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: d76887554d5b2e441b3ecb5e4e52b392, 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: 1 + 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 &33832939875228066 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &114012811021287998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b34189096d561ef48859c46a7d8eac3b, type: 3} + m_Name: + m_EditorClassIdentifier: + CameraSpace: {x: 0, y: 0, z: 0} + SetDepth: 0 + LinkedImage: {fileID: 0} + lastPos: {x: 0, y: 0, z: 0} + IsoRadius: 0 + IsoPerspective: 0 + AllowMovedFlag: 0 + ObjectManualDepth: 10 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 + Custom: 0 + IsoType: 1 +--- !u!135 &135889288384560452 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.38 + m_Center: {x: 0, y: 0.21, z: -0.00000011920929} +--- !u!136 &136388466304859462 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.23 + m_Height: 0.7 + m_Direction: 1 + m_Center: {x: -0.00000023841858, y: -0.3, z: -0.000000059604645} diff --git a/FallUnity/Assets/Trees/Tree.prefab.meta b/FallUnity/Assets/Trees/Tree.prefab.meta new file mode 100644 index 0000000..523f02e --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 989a13a51252a6446b729edc777df00f +timeCreated: 1572212652 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png new file mode 100644 index 0000000..2819eda --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta new file mode 100644 index 0000000..51fc711 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 00d2204e385a5594a902ef411b6fcbd6 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree2_FallingLeaves.png b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png new file mode 100644 index 0000000..a6532fc --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta new file mode 100644 index 0000000..73c01e2 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: ec6a3c37d8e09de4090956ce8c52c261 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree3_FallingLeaves.png b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png new file mode 100644 index 0000000..d5e9cf4 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta new file mode 100644 index 0000000..56b5ec9 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 3a8f753df3e300844ad45aeb726ad989 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree4_FallingLeaves.png b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png new file mode 100644 index 0000000..ea30067 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta new file mode 100644 index 0000000..af49cf8 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: d8405aa078e010a4c81716b9bae1d194 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/TreeQuad1.prefab b/FallUnity/Assets/Trees/TreeQuad1.prefab new file mode 100644 index 0000000..8ead7f2 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad1.prefab @@ -0,0 +1,113 @@ +%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: 1027882708039166} + m_IsPrefabParent: 1 +--- !u!1 &1027882708039166 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4118268950586024} + m_Layer: 0 + m_Name: TreeQuad1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1326343496170094 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4984921038777816} + - component: {fileID: 33240180516579374} + - component: {fileID: 23905922308612562} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4118268950586024 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1027882708039166} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 3.98, y: 1.8499991, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4984921038777816} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4984921038777816 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4118268950586024} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23905922308612562 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 60e080a8fb34bf049a366e711cf7f310, 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: 1 + 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 &33240180516579374 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta new file mode 100644 index 0000000..feaeb1a --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a0a84254a5c99014baef47c424915bba +timeCreated: 1572212834 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree.prefab b/FallUnity/Assets/Trees/Tree.prefab new file mode 100644 index 0000000..9ace761 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab @@ -0,0 +1,166 @@ +%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: 1138802500347032} + m_IsPrefabParent: 1 +--- !u!1 &1138802500347032 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4129064820502644} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1950375439190738 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4741674135191680} + - component: {fileID: 33832939875228066} + - component: {fileID: 23611646918467892} + - component: {fileID: 114012811021287998} + - component: {fileID: 136388466304859462} + - component: {fileID: 135889288384560452} + m_Layer: 11 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4129064820502644 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138802500347032} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5.16, y: 3.67, z: 4.72} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4741674135191680} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4741674135191680 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3.02, z: 0} + m_LocalScale: {x: 2.8154705, y: 5.9054947, z: 2.6366587} + m_Children: [] + m_Father: {fileID: 4129064820502644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23611646918467892 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: d76887554d5b2e441b3ecb5e4e52b392, 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: 1 + 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 &33832939875228066 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &114012811021287998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b34189096d561ef48859c46a7d8eac3b, type: 3} + m_Name: + m_EditorClassIdentifier: + CameraSpace: {x: 0, y: 0, z: 0} + SetDepth: 0 + LinkedImage: {fileID: 0} + lastPos: {x: 0, y: 0, z: 0} + IsoRadius: 0 + IsoPerspective: 0 + AllowMovedFlag: 0 + ObjectManualDepth: 10 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 + Custom: 0 + IsoType: 1 +--- !u!135 &135889288384560452 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.38 + m_Center: {x: 0, y: 0.21, z: -0.00000011920929} +--- !u!136 &136388466304859462 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.23 + m_Height: 0.7 + m_Direction: 1 + m_Center: {x: -0.00000023841858, y: -0.3, z: -0.000000059604645} diff --git a/FallUnity/Assets/Trees/Tree.prefab.meta b/FallUnity/Assets/Trees/Tree.prefab.meta new file mode 100644 index 0000000..523f02e --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 989a13a51252a6446b729edc777df00f +timeCreated: 1572212652 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png new file mode 100644 index 0000000..2819eda --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta new file mode 100644 index 0000000..51fc711 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 00d2204e385a5594a902ef411b6fcbd6 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree2_FallingLeaves.png b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png new file mode 100644 index 0000000..a6532fc --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta new file mode 100644 index 0000000..73c01e2 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: ec6a3c37d8e09de4090956ce8c52c261 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree3_FallingLeaves.png b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png new file mode 100644 index 0000000..d5e9cf4 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta new file mode 100644 index 0000000..56b5ec9 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 3a8f753df3e300844ad45aeb726ad989 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree4_FallingLeaves.png b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png new file mode 100644 index 0000000..ea30067 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta new file mode 100644 index 0000000..af49cf8 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: d8405aa078e010a4c81716b9bae1d194 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/TreeQuad1.prefab b/FallUnity/Assets/Trees/TreeQuad1.prefab new file mode 100644 index 0000000..8ead7f2 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad1.prefab @@ -0,0 +1,113 @@ +%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: 1027882708039166} + m_IsPrefabParent: 1 +--- !u!1 &1027882708039166 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4118268950586024} + m_Layer: 0 + m_Name: TreeQuad1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1326343496170094 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4984921038777816} + - component: {fileID: 33240180516579374} + - component: {fileID: 23905922308612562} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4118268950586024 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1027882708039166} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 3.98, y: 1.8499991, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4984921038777816} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4984921038777816 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4118268950586024} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23905922308612562 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 60e080a8fb34bf049a366e711cf7f310, 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: 1 + 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 &33240180516579374 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/FallUnity/Assets/Trees/TreeQuad1.prefab.meta b/FallUnity/Assets/Trees/TreeQuad1.prefab.meta new file mode 100644 index 0000000..c8bda78 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad1.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 712fe55a4862fcb4ca196a49721569cd +timeCreated: 1572212689 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta new file mode 100644 index 0000000..feaeb1a --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a0a84254a5c99014baef47c424915bba +timeCreated: 1572212834 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree.prefab b/FallUnity/Assets/Trees/Tree.prefab new file mode 100644 index 0000000..9ace761 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab @@ -0,0 +1,166 @@ +%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: 1138802500347032} + m_IsPrefabParent: 1 +--- !u!1 &1138802500347032 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4129064820502644} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1950375439190738 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4741674135191680} + - component: {fileID: 33832939875228066} + - component: {fileID: 23611646918467892} + - component: {fileID: 114012811021287998} + - component: {fileID: 136388466304859462} + - component: {fileID: 135889288384560452} + m_Layer: 11 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4129064820502644 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138802500347032} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5.16, y: 3.67, z: 4.72} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4741674135191680} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4741674135191680 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3.02, z: 0} + m_LocalScale: {x: 2.8154705, y: 5.9054947, z: 2.6366587} + m_Children: [] + m_Father: {fileID: 4129064820502644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23611646918467892 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: d76887554d5b2e441b3ecb5e4e52b392, 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: 1 + 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 &33832939875228066 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &114012811021287998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b34189096d561ef48859c46a7d8eac3b, type: 3} + m_Name: + m_EditorClassIdentifier: + CameraSpace: {x: 0, y: 0, z: 0} + SetDepth: 0 + LinkedImage: {fileID: 0} + lastPos: {x: 0, y: 0, z: 0} + IsoRadius: 0 + IsoPerspective: 0 + AllowMovedFlag: 0 + ObjectManualDepth: 10 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 + Custom: 0 + IsoType: 1 +--- !u!135 &135889288384560452 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.38 + m_Center: {x: 0, y: 0.21, z: -0.00000011920929} +--- !u!136 &136388466304859462 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.23 + m_Height: 0.7 + m_Direction: 1 + m_Center: {x: -0.00000023841858, y: -0.3, z: -0.000000059604645} diff --git a/FallUnity/Assets/Trees/Tree.prefab.meta b/FallUnity/Assets/Trees/Tree.prefab.meta new file mode 100644 index 0000000..523f02e --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 989a13a51252a6446b729edc777df00f +timeCreated: 1572212652 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png new file mode 100644 index 0000000..2819eda --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta new file mode 100644 index 0000000..51fc711 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 00d2204e385a5594a902ef411b6fcbd6 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree2_FallingLeaves.png b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png new file mode 100644 index 0000000..a6532fc --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta new file mode 100644 index 0000000..73c01e2 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: ec6a3c37d8e09de4090956ce8c52c261 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree3_FallingLeaves.png b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png new file mode 100644 index 0000000..d5e9cf4 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta new file mode 100644 index 0000000..56b5ec9 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 3a8f753df3e300844ad45aeb726ad989 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree4_FallingLeaves.png b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png new file mode 100644 index 0000000..ea30067 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta new file mode 100644 index 0000000..af49cf8 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: d8405aa078e010a4c81716b9bae1d194 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/TreeQuad1.prefab b/FallUnity/Assets/Trees/TreeQuad1.prefab new file mode 100644 index 0000000..8ead7f2 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad1.prefab @@ -0,0 +1,113 @@ +%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: 1027882708039166} + m_IsPrefabParent: 1 +--- !u!1 &1027882708039166 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4118268950586024} + m_Layer: 0 + m_Name: TreeQuad1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1326343496170094 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4984921038777816} + - component: {fileID: 33240180516579374} + - component: {fileID: 23905922308612562} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4118268950586024 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1027882708039166} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 3.98, y: 1.8499991, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4984921038777816} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4984921038777816 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4118268950586024} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23905922308612562 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 60e080a8fb34bf049a366e711cf7f310, 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: 1 + 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 &33240180516579374 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/FallUnity/Assets/Trees/TreeQuad1.prefab.meta b/FallUnity/Assets/Trees/TreeQuad1.prefab.meta new file mode 100644 index 0000000..c8bda78 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad1.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 712fe55a4862fcb4ca196a49721569cd +timeCreated: 1572212689 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/TreeQuad2.prefab b/FallUnity/Assets/Trees/TreeQuad2.prefab new file mode 100644 index 0000000..ebc0262 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad2.prefab @@ -0,0 +1,113 @@ +%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: 1844362587011774} + m_IsPrefabParent: 1 +--- !u!1 &1542388951510036 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4576435325976702} + - component: {fileID: 33024941969327044} + - component: {fileID: 23420394653622474} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1844362587011774 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4233244327696728} + m_Layer: 0 + m_Name: TreeQuad2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4233244327696728 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1844362587011774} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.59, y: 4.22, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4576435325976702} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4576435325976702 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4233244327696728} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23420394653622474 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 103724ad34e037d4e8926b72a2059dd5, 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: 1 + 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 &33024941969327044 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta new file mode 100644 index 0000000..feaeb1a --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a0a84254a5c99014baef47c424915bba +timeCreated: 1572212834 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree.prefab b/FallUnity/Assets/Trees/Tree.prefab new file mode 100644 index 0000000..9ace761 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab @@ -0,0 +1,166 @@ +%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: 1138802500347032} + m_IsPrefabParent: 1 +--- !u!1 &1138802500347032 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4129064820502644} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1950375439190738 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4741674135191680} + - component: {fileID: 33832939875228066} + - component: {fileID: 23611646918467892} + - component: {fileID: 114012811021287998} + - component: {fileID: 136388466304859462} + - component: {fileID: 135889288384560452} + m_Layer: 11 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4129064820502644 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138802500347032} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5.16, y: 3.67, z: 4.72} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4741674135191680} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4741674135191680 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3.02, z: 0} + m_LocalScale: {x: 2.8154705, y: 5.9054947, z: 2.6366587} + m_Children: [] + m_Father: {fileID: 4129064820502644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23611646918467892 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: d76887554d5b2e441b3ecb5e4e52b392, 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: 1 + 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 &33832939875228066 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &114012811021287998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b34189096d561ef48859c46a7d8eac3b, type: 3} + m_Name: + m_EditorClassIdentifier: + CameraSpace: {x: 0, y: 0, z: 0} + SetDepth: 0 + LinkedImage: {fileID: 0} + lastPos: {x: 0, y: 0, z: 0} + IsoRadius: 0 + IsoPerspective: 0 + AllowMovedFlag: 0 + ObjectManualDepth: 10 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 + Custom: 0 + IsoType: 1 +--- !u!135 &135889288384560452 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.38 + m_Center: {x: 0, y: 0.21, z: -0.00000011920929} +--- !u!136 &136388466304859462 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.23 + m_Height: 0.7 + m_Direction: 1 + m_Center: {x: -0.00000023841858, y: -0.3, z: -0.000000059604645} diff --git a/FallUnity/Assets/Trees/Tree.prefab.meta b/FallUnity/Assets/Trees/Tree.prefab.meta new file mode 100644 index 0000000..523f02e --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 989a13a51252a6446b729edc777df00f +timeCreated: 1572212652 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png new file mode 100644 index 0000000..2819eda --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta new file mode 100644 index 0000000..51fc711 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 00d2204e385a5594a902ef411b6fcbd6 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree2_FallingLeaves.png b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png new file mode 100644 index 0000000..a6532fc --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta new file mode 100644 index 0000000..73c01e2 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: ec6a3c37d8e09de4090956ce8c52c261 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree3_FallingLeaves.png b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png new file mode 100644 index 0000000..d5e9cf4 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta new file mode 100644 index 0000000..56b5ec9 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 3a8f753df3e300844ad45aeb726ad989 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree4_FallingLeaves.png b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png new file mode 100644 index 0000000..ea30067 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta new file mode 100644 index 0000000..af49cf8 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: d8405aa078e010a4c81716b9bae1d194 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/TreeQuad1.prefab b/FallUnity/Assets/Trees/TreeQuad1.prefab new file mode 100644 index 0000000..8ead7f2 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad1.prefab @@ -0,0 +1,113 @@ +%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: 1027882708039166} + m_IsPrefabParent: 1 +--- !u!1 &1027882708039166 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4118268950586024} + m_Layer: 0 + m_Name: TreeQuad1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1326343496170094 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4984921038777816} + - component: {fileID: 33240180516579374} + - component: {fileID: 23905922308612562} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4118268950586024 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1027882708039166} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 3.98, y: 1.8499991, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4984921038777816} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4984921038777816 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4118268950586024} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23905922308612562 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 60e080a8fb34bf049a366e711cf7f310, 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: 1 + 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 &33240180516579374 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/FallUnity/Assets/Trees/TreeQuad1.prefab.meta b/FallUnity/Assets/Trees/TreeQuad1.prefab.meta new file mode 100644 index 0000000..c8bda78 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad1.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 712fe55a4862fcb4ca196a49721569cd +timeCreated: 1572212689 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/TreeQuad2.prefab b/FallUnity/Assets/Trees/TreeQuad2.prefab new file mode 100644 index 0000000..ebc0262 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad2.prefab @@ -0,0 +1,113 @@ +%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: 1844362587011774} + m_IsPrefabParent: 1 +--- !u!1 &1542388951510036 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4576435325976702} + - component: {fileID: 33024941969327044} + - component: {fileID: 23420394653622474} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1844362587011774 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4233244327696728} + m_Layer: 0 + m_Name: TreeQuad2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4233244327696728 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1844362587011774} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.59, y: 4.22, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4576435325976702} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4576435325976702 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4233244327696728} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23420394653622474 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 103724ad34e037d4e8926b72a2059dd5, 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: 1 + 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 &33024941969327044 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/FallUnity/Assets/Trees/TreeQuad2.prefab.meta b/FallUnity/Assets/Trees/TreeQuad2.prefab.meta new file mode 100644 index 0000000..7ea0054 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad2.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 751795bd59093194e926dc7d64434292 +timeCreated: 1572212756 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta new file mode 100644 index 0000000..feaeb1a --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a0a84254a5c99014baef47c424915bba +timeCreated: 1572212834 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree.prefab b/FallUnity/Assets/Trees/Tree.prefab new file mode 100644 index 0000000..9ace761 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab @@ -0,0 +1,166 @@ +%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: 1138802500347032} + m_IsPrefabParent: 1 +--- !u!1 &1138802500347032 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4129064820502644} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1950375439190738 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4741674135191680} + - component: {fileID: 33832939875228066} + - component: {fileID: 23611646918467892} + - component: {fileID: 114012811021287998} + - component: {fileID: 136388466304859462} + - component: {fileID: 135889288384560452} + m_Layer: 11 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4129064820502644 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138802500347032} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5.16, y: 3.67, z: 4.72} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4741674135191680} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4741674135191680 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3.02, z: 0} + m_LocalScale: {x: 2.8154705, y: 5.9054947, z: 2.6366587} + m_Children: [] + m_Father: {fileID: 4129064820502644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23611646918467892 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: d76887554d5b2e441b3ecb5e4e52b392, 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: 1 + 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 &33832939875228066 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &114012811021287998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b34189096d561ef48859c46a7d8eac3b, type: 3} + m_Name: + m_EditorClassIdentifier: + CameraSpace: {x: 0, y: 0, z: 0} + SetDepth: 0 + LinkedImage: {fileID: 0} + lastPos: {x: 0, y: 0, z: 0} + IsoRadius: 0 + IsoPerspective: 0 + AllowMovedFlag: 0 + ObjectManualDepth: 10 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 + Custom: 0 + IsoType: 1 +--- !u!135 &135889288384560452 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.38 + m_Center: {x: 0, y: 0.21, z: -0.00000011920929} +--- !u!136 &136388466304859462 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.23 + m_Height: 0.7 + m_Direction: 1 + m_Center: {x: -0.00000023841858, y: -0.3, z: -0.000000059604645} diff --git a/FallUnity/Assets/Trees/Tree.prefab.meta b/FallUnity/Assets/Trees/Tree.prefab.meta new file mode 100644 index 0000000..523f02e --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 989a13a51252a6446b729edc777df00f +timeCreated: 1572212652 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png new file mode 100644 index 0000000..2819eda --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta new file mode 100644 index 0000000..51fc711 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 00d2204e385a5594a902ef411b6fcbd6 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree2_FallingLeaves.png b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png new file mode 100644 index 0000000..a6532fc --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta new file mode 100644 index 0000000..73c01e2 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: ec6a3c37d8e09de4090956ce8c52c261 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree3_FallingLeaves.png b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png new file mode 100644 index 0000000..d5e9cf4 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta new file mode 100644 index 0000000..56b5ec9 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 3a8f753df3e300844ad45aeb726ad989 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree4_FallingLeaves.png b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png new file mode 100644 index 0000000..ea30067 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta new file mode 100644 index 0000000..af49cf8 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: d8405aa078e010a4c81716b9bae1d194 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/TreeQuad1.prefab b/FallUnity/Assets/Trees/TreeQuad1.prefab new file mode 100644 index 0000000..8ead7f2 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad1.prefab @@ -0,0 +1,113 @@ +%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: 1027882708039166} + m_IsPrefabParent: 1 +--- !u!1 &1027882708039166 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4118268950586024} + m_Layer: 0 + m_Name: TreeQuad1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1326343496170094 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4984921038777816} + - component: {fileID: 33240180516579374} + - component: {fileID: 23905922308612562} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4118268950586024 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1027882708039166} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 3.98, y: 1.8499991, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4984921038777816} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4984921038777816 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4118268950586024} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23905922308612562 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 60e080a8fb34bf049a366e711cf7f310, 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: 1 + 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 &33240180516579374 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/FallUnity/Assets/Trees/TreeQuad1.prefab.meta b/FallUnity/Assets/Trees/TreeQuad1.prefab.meta new file mode 100644 index 0000000..c8bda78 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad1.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 712fe55a4862fcb4ca196a49721569cd +timeCreated: 1572212689 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/TreeQuad2.prefab b/FallUnity/Assets/Trees/TreeQuad2.prefab new file mode 100644 index 0000000..ebc0262 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad2.prefab @@ -0,0 +1,113 @@ +%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: 1844362587011774} + m_IsPrefabParent: 1 +--- !u!1 &1542388951510036 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4576435325976702} + - component: {fileID: 33024941969327044} + - component: {fileID: 23420394653622474} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1844362587011774 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4233244327696728} + m_Layer: 0 + m_Name: TreeQuad2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4233244327696728 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1844362587011774} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.59, y: 4.22, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4576435325976702} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4576435325976702 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4233244327696728} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23420394653622474 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 103724ad34e037d4e8926b72a2059dd5, 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: 1 + 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 &33024941969327044 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/FallUnity/Assets/Trees/TreeQuad2.prefab.meta b/FallUnity/Assets/Trees/TreeQuad2.prefab.meta new file mode 100644 index 0000000..7ea0054 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad2.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 751795bd59093194e926dc7d64434292 +timeCreated: 1572212756 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/TreeQuad3.prefab b/FallUnity/Assets/Trees/TreeQuad3.prefab new file mode 100644 index 0000000..fcb701f --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad3.prefab @@ -0,0 +1,113 @@ +%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: 1282832270522612} + m_IsPrefabParent: 1 +--- !u!1 &1282832270522612 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4976538238949254} + m_Layer: 0 + m_Name: TreeQuad3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1519097940120952 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4928438865331662} + - component: {fileID: 33199549818419366} + - component: {fileID: 23128653822381904} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4928438865331662 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1519097940120952} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4976538238949254} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4976538238949254 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1282832270522612} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 2.6, y: 3.82, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4928438865331662} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23128653822381904 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1519097940120952} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: c95165dd85a28f847842c3beb341bebf, 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: 1 + 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 &33199549818419366 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1519097940120952} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta new file mode 100644 index 0000000..feaeb1a --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a0a84254a5c99014baef47c424915bba +timeCreated: 1572212834 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree.prefab b/FallUnity/Assets/Trees/Tree.prefab new file mode 100644 index 0000000..9ace761 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab @@ -0,0 +1,166 @@ +%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: 1138802500347032} + m_IsPrefabParent: 1 +--- !u!1 &1138802500347032 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4129064820502644} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1950375439190738 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4741674135191680} + - component: {fileID: 33832939875228066} + - component: {fileID: 23611646918467892} + - component: {fileID: 114012811021287998} + - component: {fileID: 136388466304859462} + - component: {fileID: 135889288384560452} + m_Layer: 11 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4129064820502644 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138802500347032} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5.16, y: 3.67, z: 4.72} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4741674135191680} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4741674135191680 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3.02, z: 0} + m_LocalScale: {x: 2.8154705, y: 5.9054947, z: 2.6366587} + m_Children: [] + m_Father: {fileID: 4129064820502644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23611646918467892 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: d76887554d5b2e441b3ecb5e4e52b392, 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: 1 + 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 &33832939875228066 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &114012811021287998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b34189096d561ef48859c46a7d8eac3b, type: 3} + m_Name: + m_EditorClassIdentifier: + CameraSpace: {x: 0, y: 0, z: 0} + SetDepth: 0 + LinkedImage: {fileID: 0} + lastPos: {x: 0, y: 0, z: 0} + IsoRadius: 0 + IsoPerspective: 0 + AllowMovedFlag: 0 + ObjectManualDepth: 10 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 + Custom: 0 + IsoType: 1 +--- !u!135 &135889288384560452 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.38 + m_Center: {x: 0, y: 0.21, z: -0.00000011920929} +--- !u!136 &136388466304859462 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.23 + m_Height: 0.7 + m_Direction: 1 + m_Center: {x: -0.00000023841858, y: -0.3, z: -0.000000059604645} diff --git a/FallUnity/Assets/Trees/Tree.prefab.meta b/FallUnity/Assets/Trees/Tree.prefab.meta new file mode 100644 index 0000000..523f02e --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 989a13a51252a6446b729edc777df00f +timeCreated: 1572212652 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png new file mode 100644 index 0000000..2819eda --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta new file mode 100644 index 0000000..51fc711 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 00d2204e385a5594a902ef411b6fcbd6 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree2_FallingLeaves.png b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png new file mode 100644 index 0000000..a6532fc --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta new file mode 100644 index 0000000..73c01e2 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: ec6a3c37d8e09de4090956ce8c52c261 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree3_FallingLeaves.png b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png new file mode 100644 index 0000000..d5e9cf4 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta new file mode 100644 index 0000000..56b5ec9 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 3a8f753df3e300844ad45aeb726ad989 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree4_FallingLeaves.png b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png new file mode 100644 index 0000000..ea30067 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta new file mode 100644 index 0000000..af49cf8 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: d8405aa078e010a4c81716b9bae1d194 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/TreeQuad1.prefab b/FallUnity/Assets/Trees/TreeQuad1.prefab new file mode 100644 index 0000000..8ead7f2 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad1.prefab @@ -0,0 +1,113 @@ +%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: 1027882708039166} + m_IsPrefabParent: 1 +--- !u!1 &1027882708039166 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4118268950586024} + m_Layer: 0 + m_Name: TreeQuad1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1326343496170094 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4984921038777816} + - component: {fileID: 33240180516579374} + - component: {fileID: 23905922308612562} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4118268950586024 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1027882708039166} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 3.98, y: 1.8499991, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4984921038777816} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4984921038777816 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4118268950586024} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23905922308612562 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 60e080a8fb34bf049a366e711cf7f310, 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: 1 + 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 &33240180516579374 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/FallUnity/Assets/Trees/TreeQuad1.prefab.meta b/FallUnity/Assets/Trees/TreeQuad1.prefab.meta new file mode 100644 index 0000000..c8bda78 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad1.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 712fe55a4862fcb4ca196a49721569cd +timeCreated: 1572212689 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/TreeQuad2.prefab b/FallUnity/Assets/Trees/TreeQuad2.prefab new file mode 100644 index 0000000..ebc0262 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad2.prefab @@ -0,0 +1,113 @@ +%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: 1844362587011774} + m_IsPrefabParent: 1 +--- !u!1 &1542388951510036 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4576435325976702} + - component: {fileID: 33024941969327044} + - component: {fileID: 23420394653622474} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1844362587011774 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4233244327696728} + m_Layer: 0 + m_Name: TreeQuad2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4233244327696728 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1844362587011774} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.59, y: 4.22, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4576435325976702} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4576435325976702 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4233244327696728} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23420394653622474 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 103724ad34e037d4e8926b72a2059dd5, 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: 1 + 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 &33024941969327044 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/FallUnity/Assets/Trees/TreeQuad2.prefab.meta b/FallUnity/Assets/Trees/TreeQuad2.prefab.meta new file mode 100644 index 0000000..7ea0054 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad2.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 751795bd59093194e926dc7d64434292 +timeCreated: 1572212756 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/TreeQuad3.prefab b/FallUnity/Assets/Trees/TreeQuad3.prefab new file mode 100644 index 0000000..fcb701f --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad3.prefab @@ -0,0 +1,113 @@ +%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: 1282832270522612} + m_IsPrefabParent: 1 +--- !u!1 &1282832270522612 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4976538238949254} + m_Layer: 0 + m_Name: TreeQuad3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1519097940120952 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4928438865331662} + - component: {fileID: 33199549818419366} + - component: {fileID: 23128653822381904} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4928438865331662 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1519097940120952} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4976538238949254} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4976538238949254 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1282832270522612} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 2.6, y: 3.82, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4928438865331662} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23128653822381904 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1519097940120952} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: c95165dd85a28f847842c3beb341bebf, 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: 1 + 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 &33199549818419366 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1519097940120952} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/FallUnity/Assets/Trees/TreeQuad3.prefab.meta b/FallUnity/Assets/Trees/TreeQuad3.prefab.meta new file mode 100644 index 0000000..fb2c3c3 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad3.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b3adf7a6d1bd20d49aed6d5149440b99 +timeCreated: 1572212815 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta new file mode 100644 index 0000000..feaeb1a --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a0a84254a5c99014baef47c424915bba +timeCreated: 1572212834 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree.prefab b/FallUnity/Assets/Trees/Tree.prefab new file mode 100644 index 0000000..9ace761 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab @@ -0,0 +1,166 @@ +%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: 1138802500347032} + m_IsPrefabParent: 1 +--- !u!1 &1138802500347032 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4129064820502644} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1950375439190738 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4741674135191680} + - component: {fileID: 33832939875228066} + - component: {fileID: 23611646918467892} + - component: {fileID: 114012811021287998} + - component: {fileID: 136388466304859462} + - component: {fileID: 135889288384560452} + m_Layer: 11 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4129064820502644 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138802500347032} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5.16, y: 3.67, z: 4.72} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4741674135191680} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4741674135191680 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3.02, z: 0} + m_LocalScale: {x: 2.8154705, y: 5.9054947, z: 2.6366587} + m_Children: [] + m_Father: {fileID: 4129064820502644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23611646918467892 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: d76887554d5b2e441b3ecb5e4e52b392, 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: 1 + 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 &33832939875228066 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &114012811021287998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b34189096d561ef48859c46a7d8eac3b, type: 3} + m_Name: + m_EditorClassIdentifier: + CameraSpace: {x: 0, y: 0, z: 0} + SetDepth: 0 + LinkedImage: {fileID: 0} + lastPos: {x: 0, y: 0, z: 0} + IsoRadius: 0 + IsoPerspective: 0 + AllowMovedFlag: 0 + ObjectManualDepth: 10 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 + Custom: 0 + IsoType: 1 +--- !u!135 &135889288384560452 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.38 + m_Center: {x: 0, y: 0.21, z: -0.00000011920929} +--- !u!136 &136388466304859462 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.23 + m_Height: 0.7 + m_Direction: 1 + m_Center: {x: -0.00000023841858, y: -0.3, z: -0.000000059604645} diff --git a/FallUnity/Assets/Trees/Tree.prefab.meta b/FallUnity/Assets/Trees/Tree.prefab.meta new file mode 100644 index 0000000..523f02e --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 989a13a51252a6446b729edc777df00f +timeCreated: 1572212652 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png new file mode 100644 index 0000000..2819eda --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta new file mode 100644 index 0000000..51fc711 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 00d2204e385a5594a902ef411b6fcbd6 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree2_FallingLeaves.png b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png new file mode 100644 index 0000000..a6532fc --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta new file mode 100644 index 0000000..73c01e2 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: ec6a3c37d8e09de4090956ce8c52c261 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree3_FallingLeaves.png b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png new file mode 100644 index 0000000..d5e9cf4 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta new file mode 100644 index 0000000..56b5ec9 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 3a8f753df3e300844ad45aeb726ad989 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree4_FallingLeaves.png b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png new file mode 100644 index 0000000..ea30067 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta new file mode 100644 index 0000000..af49cf8 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: d8405aa078e010a4c81716b9bae1d194 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/TreeQuad1.prefab b/FallUnity/Assets/Trees/TreeQuad1.prefab new file mode 100644 index 0000000..8ead7f2 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad1.prefab @@ -0,0 +1,113 @@ +%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: 1027882708039166} + m_IsPrefabParent: 1 +--- !u!1 &1027882708039166 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4118268950586024} + m_Layer: 0 + m_Name: TreeQuad1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1326343496170094 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4984921038777816} + - component: {fileID: 33240180516579374} + - component: {fileID: 23905922308612562} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4118268950586024 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1027882708039166} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 3.98, y: 1.8499991, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4984921038777816} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4984921038777816 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4118268950586024} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23905922308612562 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 60e080a8fb34bf049a366e711cf7f310, 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: 1 + 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 &33240180516579374 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/FallUnity/Assets/Trees/TreeQuad1.prefab.meta b/FallUnity/Assets/Trees/TreeQuad1.prefab.meta new file mode 100644 index 0000000..c8bda78 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad1.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 712fe55a4862fcb4ca196a49721569cd +timeCreated: 1572212689 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/TreeQuad2.prefab b/FallUnity/Assets/Trees/TreeQuad2.prefab new file mode 100644 index 0000000..ebc0262 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad2.prefab @@ -0,0 +1,113 @@ +%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: 1844362587011774} + m_IsPrefabParent: 1 +--- !u!1 &1542388951510036 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4576435325976702} + - component: {fileID: 33024941969327044} + - component: {fileID: 23420394653622474} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1844362587011774 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4233244327696728} + m_Layer: 0 + m_Name: TreeQuad2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4233244327696728 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1844362587011774} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.59, y: 4.22, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4576435325976702} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4576435325976702 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4233244327696728} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23420394653622474 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 103724ad34e037d4e8926b72a2059dd5, 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: 1 + 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 &33024941969327044 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/FallUnity/Assets/Trees/TreeQuad2.prefab.meta b/FallUnity/Assets/Trees/TreeQuad2.prefab.meta new file mode 100644 index 0000000..7ea0054 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad2.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 751795bd59093194e926dc7d64434292 +timeCreated: 1572212756 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/TreeQuad3.prefab b/FallUnity/Assets/Trees/TreeQuad3.prefab new file mode 100644 index 0000000..fcb701f --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad3.prefab @@ -0,0 +1,113 @@ +%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: 1282832270522612} + m_IsPrefabParent: 1 +--- !u!1 &1282832270522612 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4976538238949254} + m_Layer: 0 + m_Name: TreeQuad3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1519097940120952 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4928438865331662} + - component: {fileID: 33199549818419366} + - component: {fileID: 23128653822381904} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4928438865331662 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1519097940120952} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4976538238949254} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4976538238949254 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1282832270522612} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 2.6, y: 3.82, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4928438865331662} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23128653822381904 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1519097940120952} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: c95165dd85a28f847842c3beb341bebf, 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: 1 + 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 &33199549818419366 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1519097940120952} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/FallUnity/Assets/Trees/TreeQuad3.prefab.meta b/FallUnity/Assets/Trees/TreeQuad3.prefab.meta new file mode 100644 index 0000000..fb2c3c3 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad3.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b3adf7a6d1bd20d49aed6d5149440b99 +timeCreated: 1572212815 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/TreeQuad4.prefab b/FallUnity/Assets/Trees/TreeQuad4.prefab new file mode 100644 index 0000000..44f1a40 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad4.prefab @@ -0,0 +1,113 @@ +%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: 1585444000422512} + m_IsPrefabParent: 1 +--- !u!1 &1408944717371544 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4282872345166704} + - component: {fileID: 33875972963851106} + - component: {fileID: 23488616418628322} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1585444000422512 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4722715507293232} + m_Layer: 0 + m_Name: TreeQuad4 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4282872345166704 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1408944717371544} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4722715507293232} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4722715507293232 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1585444000422512} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 6.6, y: 4.21, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4282872345166704} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23488616418628322 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1408944717371544} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: a0a84254a5c99014baef47c424915bba, 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: 1 + 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 &33875972963851106 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1408944717371544} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta new file mode 100644 index 0000000..feaeb1a --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a0a84254a5c99014baef47c424915bba +timeCreated: 1572212834 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree.prefab b/FallUnity/Assets/Trees/Tree.prefab new file mode 100644 index 0000000..9ace761 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab @@ -0,0 +1,166 @@ +%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: 1138802500347032} + m_IsPrefabParent: 1 +--- !u!1 &1138802500347032 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4129064820502644} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1950375439190738 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4741674135191680} + - component: {fileID: 33832939875228066} + - component: {fileID: 23611646918467892} + - component: {fileID: 114012811021287998} + - component: {fileID: 136388466304859462} + - component: {fileID: 135889288384560452} + m_Layer: 11 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4129064820502644 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138802500347032} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5.16, y: 3.67, z: 4.72} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4741674135191680} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4741674135191680 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3.02, z: 0} + m_LocalScale: {x: 2.8154705, y: 5.9054947, z: 2.6366587} + m_Children: [] + m_Father: {fileID: 4129064820502644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23611646918467892 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: d76887554d5b2e441b3ecb5e4e52b392, 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: 1 + 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 &33832939875228066 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &114012811021287998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b34189096d561ef48859c46a7d8eac3b, type: 3} + m_Name: + m_EditorClassIdentifier: + CameraSpace: {x: 0, y: 0, z: 0} + SetDepth: 0 + LinkedImage: {fileID: 0} + lastPos: {x: 0, y: 0, z: 0} + IsoRadius: 0 + IsoPerspective: 0 + AllowMovedFlag: 0 + ObjectManualDepth: 10 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 + Custom: 0 + IsoType: 1 +--- !u!135 &135889288384560452 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.38 + m_Center: {x: 0, y: 0.21, z: -0.00000011920929} +--- !u!136 &136388466304859462 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.23 + m_Height: 0.7 + m_Direction: 1 + m_Center: {x: -0.00000023841858, y: -0.3, z: -0.000000059604645} diff --git a/FallUnity/Assets/Trees/Tree.prefab.meta b/FallUnity/Assets/Trees/Tree.prefab.meta new file mode 100644 index 0000000..523f02e --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 989a13a51252a6446b729edc777df00f +timeCreated: 1572212652 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png new file mode 100644 index 0000000..2819eda --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta new file mode 100644 index 0000000..51fc711 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 00d2204e385a5594a902ef411b6fcbd6 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree2_FallingLeaves.png b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png new file mode 100644 index 0000000..a6532fc --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta new file mode 100644 index 0000000..73c01e2 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: ec6a3c37d8e09de4090956ce8c52c261 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree3_FallingLeaves.png b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png new file mode 100644 index 0000000..d5e9cf4 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta new file mode 100644 index 0000000..56b5ec9 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 3a8f753df3e300844ad45aeb726ad989 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree4_FallingLeaves.png b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png new file mode 100644 index 0000000..ea30067 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta new file mode 100644 index 0000000..af49cf8 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: d8405aa078e010a4c81716b9bae1d194 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/TreeQuad1.prefab b/FallUnity/Assets/Trees/TreeQuad1.prefab new file mode 100644 index 0000000..8ead7f2 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad1.prefab @@ -0,0 +1,113 @@ +%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: 1027882708039166} + m_IsPrefabParent: 1 +--- !u!1 &1027882708039166 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4118268950586024} + m_Layer: 0 + m_Name: TreeQuad1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1326343496170094 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4984921038777816} + - component: {fileID: 33240180516579374} + - component: {fileID: 23905922308612562} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4118268950586024 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1027882708039166} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 3.98, y: 1.8499991, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4984921038777816} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4984921038777816 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4118268950586024} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23905922308612562 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 60e080a8fb34bf049a366e711cf7f310, 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: 1 + 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 &33240180516579374 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/FallUnity/Assets/Trees/TreeQuad1.prefab.meta b/FallUnity/Assets/Trees/TreeQuad1.prefab.meta new file mode 100644 index 0000000..c8bda78 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad1.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 712fe55a4862fcb4ca196a49721569cd +timeCreated: 1572212689 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/TreeQuad2.prefab b/FallUnity/Assets/Trees/TreeQuad2.prefab new file mode 100644 index 0000000..ebc0262 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad2.prefab @@ -0,0 +1,113 @@ +%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: 1844362587011774} + m_IsPrefabParent: 1 +--- !u!1 &1542388951510036 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4576435325976702} + - component: {fileID: 33024941969327044} + - component: {fileID: 23420394653622474} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1844362587011774 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4233244327696728} + m_Layer: 0 + m_Name: TreeQuad2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4233244327696728 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1844362587011774} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.59, y: 4.22, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4576435325976702} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4576435325976702 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4233244327696728} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23420394653622474 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 103724ad34e037d4e8926b72a2059dd5, 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: 1 + 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 &33024941969327044 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/FallUnity/Assets/Trees/TreeQuad2.prefab.meta b/FallUnity/Assets/Trees/TreeQuad2.prefab.meta new file mode 100644 index 0000000..7ea0054 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad2.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 751795bd59093194e926dc7d64434292 +timeCreated: 1572212756 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/TreeQuad3.prefab b/FallUnity/Assets/Trees/TreeQuad3.prefab new file mode 100644 index 0000000..fcb701f --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad3.prefab @@ -0,0 +1,113 @@ +%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: 1282832270522612} + m_IsPrefabParent: 1 +--- !u!1 &1282832270522612 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4976538238949254} + m_Layer: 0 + m_Name: TreeQuad3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1519097940120952 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4928438865331662} + - component: {fileID: 33199549818419366} + - component: {fileID: 23128653822381904} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4928438865331662 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1519097940120952} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4976538238949254} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4976538238949254 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1282832270522612} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 2.6, y: 3.82, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4928438865331662} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23128653822381904 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1519097940120952} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: c95165dd85a28f847842c3beb341bebf, 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: 1 + 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 &33199549818419366 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1519097940120952} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/FallUnity/Assets/Trees/TreeQuad3.prefab.meta b/FallUnity/Assets/Trees/TreeQuad3.prefab.meta new file mode 100644 index 0000000..fb2c3c3 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad3.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b3adf7a6d1bd20d49aed6d5149440b99 +timeCreated: 1572212815 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/TreeQuad4.prefab b/FallUnity/Assets/Trees/TreeQuad4.prefab new file mode 100644 index 0000000..44f1a40 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad4.prefab @@ -0,0 +1,113 @@ +%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: 1585444000422512} + m_IsPrefabParent: 1 +--- !u!1 &1408944717371544 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4282872345166704} + - component: {fileID: 33875972963851106} + - component: {fileID: 23488616418628322} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1585444000422512 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4722715507293232} + m_Layer: 0 + m_Name: TreeQuad4 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4282872345166704 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1408944717371544} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4722715507293232} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4722715507293232 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1585444000422512} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 6.6, y: 4.21, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4282872345166704} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23488616418628322 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1408944717371544} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: a0a84254a5c99014baef47c424915bba, 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: 1 + 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 &33875972963851106 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1408944717371544} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/FallUnity/Assets/Trees/TreeQuad4.prefab.meta b/FallUnity/Assets/Trees/TreeQuad4.prefab.meta new file mode 100644 index 0000000..887bfa7 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad4.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 63f33181f13463347b259afc54dd1bbe +timeCreated: 1572212822 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Build/fall_Data/Managed/Assembly-CSharp.dll b/Build/fall_Data/Managed/Assembly-CSharp.dll index 2bff3bc..473b708 100644 --- a/Build/fall_Data/Managed/Assembly-CSharp.dll +++ b/Build/fall_Data/Managed/Assembly-CSharp.dll Binary files differ diff --git a/Build/fall_Data/globalgamemanagers b/Build/fall_Data/globalgamemanagers index 23f4679..4e34461 100644 --- a/Build/fall_Data/globalgamemanagers +++ b/Build/fall_Data/globalgamemanagers Binary files differ diff --git a/Build/fall_Data/globalgamemanagers.assets b/Build/fall_Data/globalgamemanagers.assets index e6931d7..f90a19e 100644 --- a/Build/fall_Data/globalgamemanagers.assets +++ b/Build/fall_Data/globalgamemanagers.assets Binary files differ diff --git a/Build/fall_Data/level0 b/Build/fall_Data/level0 index 7f77ffb..f49aed1 100644 --- a/Build/fall_Data/level0 +++ b/Build/fall_Data/level0 Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets b/Build/fall_Data/sharedassets0.assets index c37ec5a..da4c84e 100644 --- a/Build/fall_Data/sharedassets0.assets +++ b/Build/fall_Data/sharedassets0.assets Binary files differ diff --git a/Build/fall_Data/sharedassets0.assets.resS b/Build/fall_Data/sharedassets0.assets.resS index fff4e67..811ed41 100644 --- a/Build/fall_Data/sharedassets0.assets.resS +++ b/Build/fall_Data/sharedassets0.assets.resS Binary files differ diff --git a/FallUnity/Assets/Game/LeafSpawner.cs b/FallUnity/Assets/Game/LeafSpawner.cs index 8429f73..dd7cba9 100644 --- a/FallUnity/Assets/Game/LeafSpawner.cs +++ b/FallUnity/Assets/Game/LeafSpawner.cs @@ -6,9 +6,10 @@ public float Radius = 3; public float Rate = 5; public LeafPhysics[] Leafs; - // Use this for initialization + // Use this for initialization + private LeafHandler leafHandler; void Start () { - + leafHandler = GameObject.FindObjectOfType(); } private List leaves = new List(); @@ -21,16 +22,19 @@ time += Time.deltaTime; while (time > interval) { - time -= interval; - Vector2 offset = Random.insideUnitCircle; - Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); - LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); - leaves.Add(leaf); - leaf.transform.position = point; - leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); + if (leafHandler != null && leafHandler.NumLeaves < leafHandler.MaxLeaves) + { + time -= interval; + Vector2 offset = Random.insideUnitCircle; + Vector3 point = transform.position + new Vector3(offset.x * Radius, 0, offset.y * Radius); + LeafPhysics leaf = GameObject.Instantiate(Leafs[Random.Range(0, Leafs.Length)]); + leaves.Add(leaf); + leaf.transform.position = point; + leaf.transform.rotation = Quaternion.Euler(new Vector3((Random.value - 0.5f) * 25, Random.value * 360, (Random.value - 0.5f) * 25)); - float scale = Random.Range(0.9f, 1.3f); - leaf.transform.localScale = new Vector3(scale, scale, scale); + float scale = Random.Range(0.9f, 1.3f); + leaf.transform.localScale = new Vector3(scale, scale, scale); + } } } diff --git a/FallUnity/Assets/Leaves/DebugLeaf.mat b/FallUnity/Assets/Leaves/DebugLeaf.mat index 0490aa8..aea4b1f 100644 --- a/FallUnity/Assets/Leaves/DebugLeaf.mat +++ b/FallUnity/Assets/Leaves/DebugLeaf.mat @@ -72,5 +72,5 @@ - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 0, b: 0.68275833, a: 1} + - _Color: {r: 1, g: 0, b: 0.68275833, a: 0.9800389} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/FallUnity/Assets/Leaves/LeafHandler.cs b/FallUnity/Assets/Leaves/LeafHandler.cs index 505c300..f931ce3 100644 --- a/FallUnity/Assets/Leaves/LeafHandler.cs +++ b/FallUnity/Assets/Leaves/LeafHandler.cs @@ -3,9 +3,21 @@ using UnityEngine; public class LeafHandler : MonoBehaviour { + private int numLeaves = 0; + public int NumLeaves { get { return numLeaves; } } + public int MaxLeaves = 700; - // Use this for initialization - void Start () { + public void AddLeaf() + { + numLeaves++; + } + + public void RemoveLeaf() + { + numLeaves--; + } + // Use this for initialization + void Start () { } diff --git a/FallUnity/Assets/Leaves/LeafPhysics.cs b/FallUnity/Assets/Leaves/LeafPhysics.cs index 8328ab8..3355523 100755 --- a/FallUnity/Assets/Leaves/LeafPhysics.cs +++ b/FallUnity/Assets/Leaves/LeafPhysics.cs @@ -7,6 +7,8 @@ public class LeafPhysics : MonoBehaviour { private Rigidbody body; public Rigidbody Body { get { return body; } } + + private LeafHandler leafHandler; // Use this for initialization void Start () { body = GetComponentInChildren(); @@ -17,6 +19,23 @@ TorqueX = new TweeningForce(-1, 1, 0.5f, 2); TorqueZ = new TweeningForce(-1, 1, 0.5f, 2); + + leafHandler = GameObject.FindObjectOfType(); + if (leafHandler != null) + { + leafHandler.AddLeaf(); + } + + deadLifeSpan = UnityEngine.Random.Range(20, 40); + deadLife = deadLifeSpan; + } + + void OnDestroy() + { + if (leafHandler != null) + { + leafHandler.RemoveLeaf(); + } } //public float TorqueForceUpScale = 0.3f; @@ -85,10 +104,16 @@ public float BaseWindForce = 10; public float AnglePow = 2; + private float deadLife = 0; + private float deadLifeSpan = 1; + + private bool isFading = false; + // Update is called once per frame void Update () { if (!body.isKinematic && body.velocity.sqrMagnitude > 0.01f) { + deadLife = deadLifeSpan; float baseForceUp = Mathf.Max(BaseWindForce * Mathf.Pow(Mathf.Abs(transform.up.y), AnglePow) * -body.velocity.y) * Time.deltaTime * 60; body.AddForceAtPosition(Vector3.up * baseForceUp * (1 + PlusX.Current), transform.position + Vector3.right * 0.4f); @@ -118,10 +143,39 @@ body.AddForce(new Vector3(-body.velocity.x, 0, -body.velocity.z) * SideRestitution * Time.deltaTime * 60); } + else + { + deadLife -= Time.deltaTime; + if (deadLife <= 0 && !isFading) + { + isFading = true; + SimpleTween tweenOut = new SimpleTween(); + HashSet mats = new HashSet(); + foreach (MeshRenderer mr in GetComponentsInChildren()) + { + mats.Add(mr.material); + } + tweenOut.Init(v => + { + foreach (Material m in mats) + { + Color c = m.color; + c.a = v; + m.color = c; + } + }, SimpleTween.EaseLinear, 1, 0, 2); + GameObject t = this.gameObject; + tweenOut.OnFinish = () => + { + Destroy(t); + }; + Destroy(this); + } + } if (transform.position.y < -5) { - Destroy(this); + Destroy(gameObject); } } } \ No newline at end of file diff --git a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat index dc52de1..b1a473b 100644 --- a/FallUnity/Assets/Leaves/Materials/Leaf_2.mat +++ b/FallUnity/Assets/Leaves/Materials/Leaf_2.mat @@ -30,6 +30,6 @@ - PixelSnap: 0 - _EnableExternalAlpha: 0 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 0.6385175} - _Flip: {r: 1, g: 1, b: 1, a: 1} - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Player/Player.prefab b/FallUnity/Assets/Player/Player.prefab index 0958e8b..c9796b0 100644 --- a/FallUnity/Assets/Player/Player.prefab +++ b/FallUnity/Assets/Player/Player.prefab @@ -256,6 +256,10 @@ IsoPerspective: 1 AllowMovedFlag: 0 ObjectManualDepth: 0 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 Custom: 1 IsoType: 0 --- !u!136 &136032829821990682 diff --git a/FallUnity/Assets/Player/PlayerController.cs b/FallUnity/Assets/Player/PlayerController.cs index f050f76..a463e36 100755 --- a/FallUnity/Assets/Player/PlayerController.cs +++ b/FallUnity/Assets/Player/PlayerController.cs @@ -116,29 +116,26 @@ { velY = 0; } - } - Vector3 moved = transform.position - oldPos; - if (moved.magnitude > 0.7f * Time.deltaTime) - { - int layer = LayerMask.GetMask("leaf"); - foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) + Vector3 moved = transform.position - oldPos; + if (moved.magnitude > 0.7f * Time.deltaTime) { - LeafPhysics leaf = c.GetComponentInParent(); - if (leaf != null) + int layer = LayerMask.GetMask("leaf"); + foreach (Collider c in Physics.OverlapSphere(transform.position, PushRadius, layer)) { - Vector3 toLeaf = leaf.transform.position - transform.position; - float dist = toLeaf.magnitude; - float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; - //toLeaf.Normalize(); - toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); - leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + LeafPhysics leaf = c.GetComponentInParent(); + if (leaf != null) + { + Vector3 toLeaf = leaf.transform.position - transform.position; + float dist = toLeaf.magnitude; + float power = Mathf.Pow(1.0f - dist / PushRadius, PushPower) * Time.deltaTime * PushForce; + //toLeaf.Normalize(); + toLeaf.y += UnityEngine.Random.Range(0.4f, 1.0f); + leaf.Body.AddForce(toLeaf * (9.0f + UnityEngine.Random.Range(0, 9.0f)) * power * Time.deltaTime * 60); + } } } - } - if (state == State.Walking) - { rakeDir = new Vector3(input.Axis(InputSource.InputAxis.RakeX), 0, input.Axis(InputSource.InputAxis.RakeY)); if (rakeDir.magnitude < 0.2f) { @@ -203,6 +200,8 @@ rakeBackTween.Init(UpdateRakeBack, SimpleTween.QuadEaseInOut, 0, 1, RakeBackTime); rakeBackTween.OnFinish = FinishedRake; + rakeTimer.Start(RakeBackTime * 1.5f, CheckPile); + List leafs = new List(); int layer = LayerMask.GetMask("leaf"); @@ -219,11 +218,12 @@ { float rand = UnityEngine.Random.Range(0, 1); Vector3 startPos = leaf.transform.position; - float dist = Vector3.Dot(startPos - transform.position, -rakeDir); + Vector3 toLeaf = startPos - transform.position; + float dist = Vector3.Dot(toLeaf, -rakeDir); dist += UnityEngine.Random.Range(-0.1f, 0.1f); Vector3 pull = rakeDir * dist; - if (rand < 0.8f) + if (rand < 0.6f) { // pull the leaf back, and then destroy @@ -232,6 +232,8 @@ pull.x += UnityEngine.Random.Range(-0.05f, 0.05f); pull.z += UnityEngine.Random.Range(-0.05f, 0.05f); + pull = pull * 0.5f + toLeaf.normalized * -0.5f * dist; + float pullTime = RakeBackTime + UnityEngine.Random.Range(-0.04f, 0.04f); SimpleTween tween = new SimpleTween(v => @@ -240,19 +242,32 @@ }, SimpleTween.TweenType.EaseLinear, 0, 1, pullTime); tween.OnFinish = () => { - GameObject.Destroy(leaf.gameObject); + leaf.Body.isKinematic = false; + //GameObject.Destroy(leaf.gameObject); }; } - else + else if (rand < 0.8f) { pull.Normalize(); pull = Quaternion.Euler(UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30), UnityEngine.Random.Range(-30, 30)) * pull; pull.y += 0.3f; + leaf.Body.AddForce(pull * RakeFlyForce, ForceMode.Impulse); } + else + { + + } } } + public GameObject PilePrefab; + + private void CheckPile() + { + + } + private void FinishedRake() { state = State.Walking; diff --git a/FallUnity/Assets/Player/PlayerRake.png.meta b/FallUnity/Assets/Player/PlayerRake.png.meta index 0b6f090..b9f15a2 100644 --- a/FallUnity/Assets/Player/PlayerRake.png.meta +++ b/FallUnity/Assets/Player/PlayerRake.png.meta @@ -8,7 +8,7 @@ serializedVersion: 4 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 diff --git a/FallUnity/Assets/Trees.meta b/FallUnity/Assets/Trees.meta new file mode 100644 index 0000000..ffa2efc --- /dev/null +++ b/FallUnity/Assets/Trees.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9bb8b7e3b72f1bb46a171d3ddd65b778 +folderAsset: yes +timeCreated: 1572211856 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials.meta b/FallUnity/Assets/Trees/Materials.meta new file mode 100644 index 0000000..567ed1e --- /dev/null +++ b/FallUnity/Assets/Trees/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 895a3e08a490d0345b5decf65f12f249 +folderAsset: yes +timeCreated: 1572212288 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat new file mode 100644 index 0000000..8451f45 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree1_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 00d2204e385a5594a902ef411b6fcbd6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta new file mode 100644 index 0000000..7a372eb --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree1_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60e080a8fb34bf049a366e711cf7f310 +timeCreated: 1572212288 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat new file mode 100644 index 0000000..386c1ab --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree2_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ec6a3c37d8e09de4090956ce8c52c261, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta new file mode 100644 index 0000000..9c1bd43 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree2_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 103724ad34e037d4e8926b72a2059dd5 +timeCreated: 1572212730 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat new file mode 100644 index 0000000..8817f5d --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree3_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 3a8f753df3e300844ad45aeb726ad989, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta new file mode 100644 index 0000000..465c317 --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree3_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c95165dd85a28f847842c3beb341bebf +timeCreated: 1572212767 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat new file mode 100644 index 0000000..4ff767c --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Tree4_FallingLeaves + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d8405aa078e010a4c81716b9bae1d194, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _EnableExternalAlpha: 0 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta new file mode 100644 index 0000000..feaeb1a --- /dev/null +++ b/FallUnity/Assets/Trees/Materials/Tree4_FallingLeaves.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a0a84254a5c99014baef47c424915bba +timeCreated: 1572212834 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree.prefab b/FallUnity/Assets/Trees/Tree.prefab new file mode 100644 index 0000000..9ace761 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab @@ -0,0 +1,166 @@ +%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: 1138802500347032} + m_IsPrefabParent: 1 +--- !u!1 &1138802500347032 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4129064820502644} + m_Layer: 0 + m_Name: Tree + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1950375439190738 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4741674135191680} + - component: {fileID: 33832939875228066} + - component: {fileID: 23611646918467892} + - component: {fileID: 114012811021287998} + - component: {fileID: 136388466304859462} + - component: {fileID: 135889288384560452} + m_Layer: 11 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4129064820502644 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1138802500347032} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 5.16, y: 3.67, z: 4.72} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4741674135191680} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4741674135191680 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 3.02, z: 0} + m_LocalScale: {x: 2.8154705, y: 5.9054947, z: 2.6366587} + m_Children: [] + m_Father: {fileID: 4129064820502644} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23611646918467892 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: d76887554d5b2e441b3ecb5e4e52b392, 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: 1 + 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 &33832939875228066 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &114012811021287998 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b34189096d561ef48859c46a7d8eac3b, type: 3} + m_Name: + m_EditorClassIdentifier: + CameraSpace: {x: 0, y: 0, z: 0} + SetDepth: 0 + LinkedImage: {fileID: 0} + lastPos: {x: 0, y: 0, z: 0} + IsoRadius: 0 + IsoPerspective: 0 + AllowMovedFlag: 0 + ObjectManualDepth: 10 + CustomCapsuleHeight: 1.4 + CustomSphereRadius: 1 + CustomSphereHeight: 1 + Thickness: 0 + Custom: 0 + IsoType: 1 +--- !u!135 &135889288384560452 +SphereCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.38 + m_Center: {x: 0, y: 0.21, z: -0.00000011920929} +--- !u!136 &136388466304859462 +CapsuleCollider: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1950375439190738} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.23 + m_Height: 0.7 + m_Direction: 1 + m_Center: {x: -0.00000023841858, y: -0.3, z: -0.000000059604645} diff --git a/FallUnity/Assets/Trees/Tree.prefab.meta b/FallUnity/Assets/Trees/Tree.prefab.meta new file mode 100644 index 0000000..523f02e --- /dev/null +++ b/FallUnity/Assets/Trees/Tree.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 989a13a51252a6446b729edc777df00f +timeCreated: 1572212652 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png new file mode 100644 index 0000000..2819eda --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta new file mode 100644 index 0000000..51fc711 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree1_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 00d2204e385a5594a902ef411b6fcbd6 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree2_FallingLeaves.png b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png new file mode 100644 index 0000000..a6532fc --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta new file mode 100644 index 0000000..73c01e2 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree2_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: ec6a3c37d8e09de4090956ce8c52c261 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree3_FallingLeaves.png b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png new file mode 100644 index 0000000..d5e9cf4 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta new file mode 100644 index 0000000..56b5ec9 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree3_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: 3a8f753df3e300844ad45aeb726ad989 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/Tree4_FallingLeaves.png b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png new file mode 100644 index 0000000..ea30067 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png Binary files differ diff --git a/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta new file mode 100644 index 0000000..af49cf8 --- /dev/null +++ b/FallUnity/Assets/Trees/Tree4_FallingLeaves.png.meta @@ -0,0 +1,103 @@ +fileFormatVersion: 2 +guid: d8405aa078e010a4c81716b9bae1d194 +timeCreated: 1572211856 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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: 0 + 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: 0 + 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/FallUnity/Assets/Trees/TreeQuad1.prefab b/FallUnity/Assets/Trees/TreeQuad1.prefab new file mode 100644 index 0000000..8ead7f2 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad1.prefab @@ -0,0 +1,113 @@ +%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: 1027882708039166} + m_IsPrefabParent: 1 +--- !u!1 &1027882708039166 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4118268950586024} + m_Layer: 0 + m_Name: TreeQuad1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1326343496170094 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4984921038777816} + - component: {fileID: 33240180516579374} + - component: {fileID: 23905922308612562} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4118268950586024 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1027882708039166} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 3.98, y: 1.8499991, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4984921038777816} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4984921038777816 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4118268950586024} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23905922308612562 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 60e080a8fb34bf049a366e711cf7f310, 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: 1 + 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 &33240180516579374 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1326343496170094} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/FallUnity/Assets/Trees/TreeQuad1.prefab.meta b/FallUnity/Assets/Trees/TreeQuad1.prefab.meta new file mode 100644 index 0000000..c8bda78 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad1.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 712fe55a4862fcb4ca196a49721569cd +timeCreated: 1572212689 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/TreeQuad2.prefab b/FallUnity/Assets/Trees/TreeQuad2.prefab new file mode 100644 index 0000000..ebc0262 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad2.prefab @@ -0,0 +1,113 @@ +%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: 1844362587011774} + m_IsPrefabParent: 1 +--- !u!1 &1542388951510036 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4576435325976702} + - component: {fileID: 33024941969327044} + - component: {fileID: 23420394653622474} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1844362587011774 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4233244327696728} + m_Layer: 0 + m_Name: TreeQuad2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4233244327696728 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1844362587011774} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.59, y: 4.22, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4576435325976702} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4576435325976702 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4233244327696728} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23420394653622474 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 103724ad34e037d4e8926b72a2059dd5, 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: 1 + 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 &33024941969327044 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1542388951510036} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/FallUnity/Assets/Trees/TreeQuad2.prefab.meta b/FallUnity/Assets/Trees/TreeQuad2.prefab.meta new file mode 100644 index 0000000..7ea0054 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad2.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 751795bd59093194e926dc7d64434292 +timeCreated: 1572212756 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/TreeQuad3.prefab b/FallUnity/Assets/Trees/TreeQuad3.prefab new file mode 100644 index 0000000..fcb701f --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad3.prefab @@ -0,0 +1,113 @@ +%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: 1282832270522612} + m_IsPrefabParent: 1 +--- !u!1 &1282832270522612 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4976538238949254} + m_Layer: 0 + m_Name: TreeQuad3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1519097940120952 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4928438865331662} + - component: {fileID: 33199549818419366} + - component: {fileID: 23128653822381904} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4928438865331662 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1519097940120952} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4976538238949254} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4976538238949254 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1282832270522612} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 2.6, y: 3.82, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4928438865331662} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23128653822381904 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1519097940120952} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: c95165dd85a28f847842c3beb341bebf, 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: 1 + 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 &33199549818419366 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1519097940120952} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/FallUnity/Assets/Trees/TreeQuad3.prefab.meta b/FallUnity/Assets/Trees/TreeQuad3.prefab.meta new file mode 100644 index 0000000..fb2c3c3 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad3.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b3adf7a6d1bd20d49aed6d5149440b99 +timeCreated: 1572212815 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/Trees/TreeQuad4.prefab b/FallUnity/Assets/Trees/TreeQuad4.prefab new file mode 100644 index 0000000..44f1a40 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad4.prefab @@ -0,0 +1,113 @@ +%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: 1585444000422512} + m_IsPrefabParent: 1 +--- !u!1 &1408944717371544 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4282872345166704} + - component: {fileID: 33875972963851106} + - component: {fileID: 23488616418628322} + m_Layer: 0 + m_Name: Quad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!1 &1585444000422512 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4722715507293232} + m_Layer: 0 + m_Name: TreeQuad4 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4282872345166704 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1408944717371544} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.41, y: 3.13, z: -0} + m_LocalScale: {x: 3.71, y: 4.52, z: 1} + m_Children: [] + m_Father: {fileID: 4722715507293232} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4722715507293232 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1585444000422512} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 6.6, y: 4.21, z: 6.09} + m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} + m_Children: + - {fileID: 4282872345166704} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &23488616418628322 +MeshRenderer: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1408944717371544} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: a0a84254a5c99014baef47c424915bba, 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: 1 + 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 &33875972963851106 +MeshFilter: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1408944717371544} + m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} diff --git a/FallUnity/Assets/Trees/TreeQuad4.prefab.meta b/FallUnity/Assets/Trees/TreeQuad4.prefab.meta new file mode 100644 index 0000000..887bfa7 --- /dev/null +++ b/FallUnity/Assets/Trees/TreeQuad4.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 63f33181f13463347b259afc54dd1bbe +timeCreated: 1572212822 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/FallUnity/Assets/level.unity b/FallUnity/Assets/level.unity index a94dfa7..ffb84bb 100755 --- a/FallUnity/Assets/level.unity +++ b/FallUnity/Assets/level.unity @@ -254,6 +254,75 @@ m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 11289495} m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1001 &38316720 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 257733089} + m_Modifications: + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.x + value: -10.57 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.y + value: -1.07 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.z + value: 8.84 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_RootOrder + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: LinkedImage + value: + objectReference: {fileID: 1946758200} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_Name + value: Tree5 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.y + value: 0.9237 + objectReference: {fileID: 0} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: ObjectManualDepth + value: 30 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 989a13a51252a6446b729edc777df00f, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &38316721 stripped +Transform: + m_PrefabParentObject: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + m_PrefabInternal: {fileID: 38316720} --- !u!1 &38669029 GameObject: m_ObjectHideFlags: 0 @@ -281,7 +350,7 @@ m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 5 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &38669031 MonoBehaviour: @@ -296,6 +365,126 @@ m_EditorClassIdentifier: ChunksX: 80 ChunksY: 80 +--- !u!1001 &51397014 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1529148493} + m_Modifications: + - target: {fileID: 4976538238949254, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_LocalPosition.x + value: 2.5 + objectReference: {fileID: 0} + - target: {fileID: 4976538238949254, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_LocalPosition.y + value: 3.06 + objectReference: {fileID: 0} + - target: {fileID: 4976538238949254, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_LocalPosition.z + value: 5.25 + objectReference: {fileID: 0} + - target: {fileID: 4976538238949254, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4976538238949254, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4976538238949254, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4976538238949254, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4976538238949254, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_RootOrder + value: 7 + objectReference: {fileID: 0} + - target: {fileID: 1282832270522612, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_Name + value: Tree3 + objectReference: {fileID: 0} + - target: {fileID: 1282832270522612, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &51397015 stripped +Transform: + m_PrefabParentObject: {fileID: 4976538238949254, guid: b3adf7a6d1bd20d49aed6d5149440b99, + type: 2} + m_PrefabInternal: {fileID: 51397014} +--- !u!1 &51397016 stripped +GameObject: + m_PrefabParentObject: {fileID: 1282832270522612, guid: b3adf7a6d1bd20d49aed6d5149440b99, + type: 2} + m_PrefabInternal: {fileID: 51397014} +--- !u!1001 &95326007 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1529148493} + m_Modifications: + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalPosition.x + value: 5.84 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalPosition.y + value: 3.01 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalPosition.z + value: 6.93 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_RootOrder + value: 8 + objectReference: {fileID: 0} + - target: {fileID: 1585444000422512, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_Name + value: Tree4 + objectReference: {fileID: 0} + - target: {fileID: 1585444000422512, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &95326008 stripped +Transform: + m_PrefabParentObject: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, + type: 2} + m_PrefabInternal: {fileID: 95326007} +--- !u!1 &95326009 stripped +GameObject: + m_PrefabParentObject: {fileID: 1585444000422512, guid: 63f33181f13463347b259afc54dd1bbe, + type: 2} + m_PrefabInternal: {fileID: 95326007} --- !u!1 &112555810 GameObject: m_ObjectHideFlags: 0 @@ -354,6 +543,128 @@ m_Father: {fileID: 257733089} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &147964966 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 257733089} + m_Modifications: + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.x + value: -14.79 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.y + value: -1.16 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.z + value: 7.11 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_RootOrder + value: 12 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: LinkedImage + value: + objectReference: {fileID: 2106554100} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_Name + value: Tree7 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.y + value: 0.8947798 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.x + value: 0.96868914 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.z + value: 0.96868914 + objectReference: {fileID: 0} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: ObjectManualDepth + value: 40 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 989a13a51252a6446b729edc777df00f, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &147964967 stripped +Transform: + m_PrefabParentObject: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + m_PrefabInternal: {fileID: 147964966} +--- !u!1 &217087128 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 217087130} + - component: {fileID: 217087129} + m_Layer: 0 + m_Name: GeneratorYard + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &217087129 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 217087128} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1edfc6f3905730c449618c44081c09e1, type: 3} + m_Name: + m_EditorClassIdentifier: + Radius: 5 + Num: 400 + Leafs: + - {fileID: 114579094665962866, guid: 1701be1f15e160d4d904862548ae69de, type: 2} + - {fileID: 114512182666289016, guid: 9f2c90804e5745a4da348dc7b5713e22, type: 2} +--- !u!4 &217087130 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 217087128} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.53, y: 7.22, z: 3.71} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &257733088 GameObject: m_ObjectHideFlags: 0 @@ -385,8 +696,19 @@ - {fileID: 112555811} - {fileID: 1580745278} - {fileID: 763199061} + - {fileID: 312038926} + - {fileID: 1935321918} + - {fileID: 610919780} + - {fileID: 1631162022} + - {fileID: 38316721} + - {fileID: 1672436106} + - {fileID: 147964967} + - {fileID: 1361725926} + - {fileID: 354365766} + - {fileID: 971715428} + - {fileID: 2013353733} m_Father: {fileID: 0} - m_RootOrder: 3 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 45, z: 0} --- !u!1 &277372078 GameObject: @@ -513,6 +835,56 @@ Thickness: 0 Custom: 0 IsoType: 1 +--- !u!1001 &280700961 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1529148493} + m_Modifications: + - target: {fileID: 4118268950586024, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + propertyPath: m_LocalPosition.x + value: 3.76 + objectReference: {fileID: 0} + - target: {fileID: 4118268950586024, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + propertyPath: m_LocalPosition.y + value: 1.73 + objectReference: {fileID: 0} + - target: {fileID: 4118268950586024, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + propertyPath: m_LocalPosition.z + value: 3.47 + objectReference: {fileID: 0} + - target: {fileID: 4118268950586024, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4118268950586024, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4118268950586024, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4118268950586024, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4118268950586024, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + propertyPath: m_RootOrder + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 1027882708039166, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + propertyPath: m_Name + value: Tree1 + objectReference: {fileID: 0} + - target: {fileID: 1027882708039166, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + m_IsPrefabParent: 0 --- !u!1 &300082919 GameObject: m_ObjectHideFlags: 0 @@ -535,13 +907,219 @@ m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 300082919} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 3.98, y: 1.8499991, z: 6.09} + m_LocalPosition: {x: 3.54, y: 1.55, z: 6.09} m_LocalScale: {x: 0.9999978, y: 0.9999975, z: 1.0531754} m_Children: - {fileID: 11233825} m_Father: {fileID: 1529148493} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &312038925 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 257733089} + m_Modifications: + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.x + value: 0.81 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.y + value: -1.1 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.z + value: 8.89 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_RootOrder + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: LinkedImage + value: + objectReference: {fileID: 2142796953} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_Name + value: Tree1 + objectReference: {fileID: 0} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: ObjectManualDepth + value: 16 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 989a13a51252a6446b729edc777df00f, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &312038926 stripped +Transform: + m_PrefabParentObject: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + m_PrefabInternal: {fileID: 312038925} +--- !u!1001 &354365765 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 257733089} + m_Modifications: + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.x + value: -15.06 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.y + value: -1.16 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.z + value: -2.55 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_RootOrder + value: 14 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: LinkedImage + value: + objectReference: {fileID: 1649869454} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_Name + value: Tree9 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.y + value: 0.98490196 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.x + value: 1.063897 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.z + value: 1.0638971 + objectReference: {fileID: 0} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: ObjectManualDepth + value: 11 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 989a13a51252a6446b729edc777df00f, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &354365766 stripped +Transform: + m_PrefabParentObject: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + m_PrefabInternal: {fileID: 354365765} +--- !u!1001 &407708539 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1529148493} + m_Modifications: + - target: {fileID: 4976538238949254, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_LocalPosition.x + value: -3.74 + objectReference: {fileID: 0} + - target: {fileID: 4976538238949254, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_LocalPosition.y + value: 5.24 + objectReference: {fileID: 0} + - target: {fileID: 4976538238949254, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_LocalPosition.z + value: 12.99 + objectReference: {fileID: 0} + - target: {fileID: 4976538238949254, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4976538238949254, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4976538238949254, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4976538238949254, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4976538238949254, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_RootOrder + value: 12 + objectReference: {fileID: 0} + - target: {fileID: 4976538238949254, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_LocalScale.y + value: 1.3249965 + objectReference: {fileID: 0} + - target: {fileID: 1282832270522612, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_Name + value: Tree8 + objectReference: {fileID: 0} + - target: {fileID: 1282832270522612, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: b3adf7a6d1bd20d49aed6d5149440b99, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &407708540 stripped +Transform: + m_PrefabParentObject: {fileID: 4976538238949254, guid: b3adf7a6d1bd20d49aed6d5149440b99, + type: 2} + m_PrefabInternal: {fileID: 407708539} +--- !u!1 &407708541 stripped +GameObject: + m_PrefabParentObject: {fileID: 1282832270522612, guid: b3adf7a6d1bd20d49aed6d5149440b99, + type: 2} + m_PrefabInternal: {fileID: 407708539} --- !u!1 &418505720 GameObject: m_ObjectHideFlags: 0 @@ -631,7 +1209,7 @@ m_Component: - component: {fileID: 468371543} m_Layer: 0 - m_Name: PFence + m_Name: PFence1 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -754,6 +1332,75 @@ m_SpriteTileMode: 0 m_WasSpriteAssigned: 0 m_MaskInteraction: 0 +--- !u!1001 &610919779 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 257733089} + m_Modifications: + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.x + value: -3.02 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.y + value: -1.1 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.z + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_RootOrder + value: 8 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: LinkedImage + value: + objectReference: {fileID: 51397016} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_Name + value: Tree3 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.y + value: 0.9237016 + objectReference: {fileID: 0} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: ObjectManualDepth + value: 18 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 989a13a51252a6446b729edc777df00f, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &610919780 stripped +Transform: + m_PrefabParentObject: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + m_PrefabInternal: {fileID: 610919779} --- !u!1 &628129805 GameObject: m_ObjectHideFlags: 0 @@ -851,7 +1498,7 @@ m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 747280841} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -7.8, y: 3.41, z: 0} + m_LocalPosition: {x: -8.68, y: 3.93, z: -0} m_LocalScale: {x: 6.52, y: 6.36, z: 1} m_Children: [] m_Father: {fileID: 495847331} @@ -926,7 +1573,7 @@ - {fileID: 418505721} - {fileID: 1464748117} m_Father: {fileID: 0} - m_RootOrder: 2 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &763199060 GameObject: @@ -993,6 +1640,138 @@ m_UseColorTemperature: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 +--- !u!1001 &770623798 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1529148493} + m_Modifications: + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalPosition.x + value: 0.59 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalPosition.y + value: 4.22 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalPosition.z + value: 6.09 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_RootOrder + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 1844362587011774, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_Name + value: Tree2 + objectReference: {fileID: 0} + - target: {fileID: 1844362587011774, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 751795bd59093194e926dc7d64434292, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &770623799 stripped +Transform: + m_PrefabParentObject: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, + type: 2} + m_PrefabInternal: {fileID: 770623798} +--- !u!1 &770623800 stripped +GameObject: + m_PrefabParentObject: {fileID: 1844362587011774, guid: 751795bd59093194e926dc7d64434292, + type: 2} + m_PrefabInternal: {fileID: 770623798} +--- !u!1001 &772802586 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1529148493} + m_Modifications: + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalPosition.x + value: -9.43 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalPosition.y + value: 3.32 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalPosition.z + value: 10.4 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_RootOrder + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalScale.x + value: 1.3279942 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalScale.y + value: 1.3279938 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalScale.z + value: 1.3986139 + objectReference: {fileID: 0} + - target: {fileID: 1844362587011774, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_Name + value: Tree6 + objectReference: {fileID: 0} + - target: {fileID: 1844362587011774, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 751795bd59093194e926dc7d64434292, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &772802587 stripped +Transform: + m_PrefabParentObject: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, + type: 2} + m_PrefabInternal: {fileID: 772802586} +--- !u!1 &772802588 stripped +GameObject: + m_PrefabParentObject: {fileID: 1844362587011774, guid: 751795bd59093194e926dc7d64434292, + type: 2} + m_PrefabInternal: {fileID: 772802586} --- !u!1 &864402134 GameObject: m_ObjectHideFlags: 0 @@ -1064,48 +1843,155 @@ m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 864402134} m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1001 &870309816 +--- !u!1001 &935798408 Prefab: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: - m_TransformParent: {fileID: 0} + m_TransformParent: {fileID: 1529148493} m_Modifications: - - target: {fileID: 4028432306176728, guid: d6cf61ddfecafa14991e99ec6f1e33f0, type: 2} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} propertyPath: m_LocalPosition.x - value: -0.6 + value: -5.49 objectReference: {fileID: 0} - - target: {fileID: 4028432306176728, guid: d6cf61ddfecafa14991e99ec6f1e33f0, type: 2} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} propertyPath: m_LocalPosition.y - value: -1.1 + value: -4.61 objectReference: {fileID: 0} - - target: {fileID: 4028432306176728, guid: d6cf61ddfecafa14991e99ec6f1e33f0, type: 2} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} propertyPath: m_LocalPosition.z - value: 4.45 + value: 3.2 objectReference: {fileID: 0} - - target: {fileID: 4028432306176728, guid: d6cf61ddfecafa14991e99ec6f1e33f0, type: 2} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - - target: {fileID: 4028432306176728, guid: d6cf61ddfecafa14991e99ec6f1e33f0, type: 2} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} propertyPath: m_LocalRotation.y value: -0 objectReference: {fileID: 0} - - target: {fileID: 4028432306176728, guid: d6cf61ddfecafa14991e99ec6f1e33f0, type: 2} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} propertyPath: m_LocalRotation.z value: -0 objectReference: {fileID: 0} - - target: {fileID: 4028432306176728, guid: d6cf61ddfecafa14991e99ec6f1e33f0, type: 2} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 4028432306176728, guid: d6cf61ddfecafa14991e99ec6f1e33f0, type: 2} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} propertyPath: m_RootOrder + value: 15 + objectReference: {fileID: 0} + - target: {fileID: 1585444000422512, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_Name + value: Tree11 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalScale.x + value: 1.2757621 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalScale.y + value: 1.2757615 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalScale.z + value: 1.3436041 + objectReference: {fileID: 0} + - target: {fileID: 1585444000422512, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_IsActive value: 1 objectReference: {fileID: 0} m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: d6cf61ddfecafa14991e99ec6f1e33f0, type: 2} + m_ParentPrefab: {fileID: 100100000, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} m_IsPrefabParent: 0 +--- !u!4 &935798409 stripped +Transform: + m_PrefabParentObject: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, + type: 2} + m_PrefabInternal: {fileID: 935798408} +--- !u!1 &935798410 stripped +GameObject: + m_PrefabParentObject: {fileID: 1585444000422512, guid: 63f33181f13463347b259afc54dd1bbe, + type: 2} + m_PrefabInternal: {fileID: 935798408} +--- !u!1001 &971715427 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 257733089} + m_Modifications: + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.x + value: -0.11 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.y + value: -1.2 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.z + value: 17.01 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_RootOrder + value: 15 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: LinkedImage + value: + objectReference: {fileID: 1864863094} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_Name + value: Tree10 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.y + value: 0.70265865 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.x + value: 0.75901973 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.z + value: 0.75901973 + objectReference: {fileID: 0} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: ObjectManualDepth + value: 20 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 989a13a51252a6446b729edc777df00f, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &971715428 stripped +Transform: + m_PrefabParentObject: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + m_PrefabInternal: {fileID: 971715427} --- !u!1 &984610442 GameObject: m_ObjectHideFlags: 0 @@ -1132,8 +2018,8 @@ m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 984610442} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -8.91, y: 1.88, z: 1.15} - m_LocalScale: {x: 4.4490304, y: 5.9054947, z: 6.1547694} + m_LocalPosition: {x: -10.56, y: 1.88, z: 1.94} + m_LocalScale: {x: 4.4490304, y: 5.9054947, z: 7.243156} m_Children: [] m_Father: {fileID: 1580745278} m_RootOrder: 0 @@ -1503,7 +2389,7 @@ IsoRadius: 0 IsoPerspective: 0 AllowMovedFlag: 0 - ObjectManualDepth: 0 + ObjectManualDepth: 2 CustomCapsuleHeight: 1.4 CustomSphereRadius: 1 CustomSphereHeight: 1 @@ -1606,11 +2492,11 @@ m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1206131915} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -0.42, y: 11.6, z: -0.41} + m_LocalPosition: {x: -0.36, y: 11.6, z: 3.77} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 4 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1206131918 MonoBehaviour: @@ -1623,8 +2509,8 @@ m_Script: {fileID: 11500000, guid: 540cb6c0be5490d4687e3eb9c06ab209, type: 3} m_Name: m_EditorClassIdentifier: - Radius: 15 - Rate: 3 + Radius: 6.5 + Rate: 7.33 Leafs: - {fileID: 114579094665962866, guid: 1701be1f15e160d4d904862548ae69de, type: 2} - {fileID: 114512182666289016, guid: 9f2c90804e5745a4da348dc7b5713e22, type: 2} @@ -1708,6 +2594,83 @@ m_Father: {fileID: 1832090302} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1361725925 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 257733089} + m_Modifications: + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.x + value: -13.17 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.y + value: -1.12 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.z + value: 9.4 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_RootOrder + value: 13 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: LinkedImage + value: + objectReference: {fileID: 407708541} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_Name + value: Tree8 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.y + value: 1.0040123 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.x + value: 0.96869004 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.z + value: 0.96869004 + objectReference: {fileID: 0} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: ObjectManualDepth + value: 50 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 989a13a51252a6446b729edc777df00f, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &1361725926 stripped +Transform: + m_PrefabParentObject: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + m_PrefabInternal: {fileID: 1361725925} --- !u!1 &1394804103 GameObject: m_ObjectHideFlags: 0 @@ -1748,6 +2711,47 @@ m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1421785355 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1421785357} + - component: {fileID: 1421785356} + m_Layer: 0 + m_Name: LeafManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1421785356 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1421785355} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7c526b2c54a6cc841aca85a6cf4cca83, type: 3} + m_Name: + m_EditorClassIdentifier: + MaxLeaves: 1200 +--- !u!4 &1421785357 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1421785355} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -3.3688889, y: 3.63, z: -1.544} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} m_RootOrder: 9 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1424407409 @@ -1776,7 +2780,7 @@ m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1424407409} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -3.92, y: -0.57, z: 7.73} + m_LocalPosition: {x: -3.8, y: -0.57, z: 6.67} m_LocalScale: {x: 12.078303, y: 1.157091, z: 0.1687698} m_Children: [] m_Father: {fileID: 112555811} @@ -2035,6 +3039,17 @@ - {fileID: 1546830602} - {fileID: 300082920} - {fileID: 495847331} + - {fileID: 2142796954} + - {fileID: 770623799} + - {fileID: 51397015} + - {fileID: 95326008} + - {fileID: 1946758199} + - {fileID: 772802587} + - {fileID: 2106554099} + - {fileID: 407708540} + - {fileID: 1649869453} + - {fileID: 1864863093} + - {fileID: 935798409} m_Father: {fileID: 1832090302} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -2076,7 +3091,7 @@ m_Component: - component: {fileID: 1548969794} m_Layer: 0 - m_Name: FenceSprite + m_Name: FenceSprite1 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -2125,6 +3140,224 @@ m_Father: {fileID: 257733089} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1631162021 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 257733089} + m_Modifications: + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.x + value: 0.25 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.y + value: -1.07 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.z + value: 12.4 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_RootOrder + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: LinkedImage + value: + objectReference: {fileID: 95326009} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_Name + value: Tree4 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.y + value: 0.9237 + objectReference: {fileID: 0} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: ObjectManualDepth + value: 17 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 989a13a51252a6446b729edc777df00f, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &1631162022 stripped +Transform: + m_PrefabParentObject: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + m_PrefabInternal: {fileID: 1631162021} +--- !u!1001 &1649869452 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1529148493} + m_Modifications: + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalPosition.x + value: -11.39 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalPosition.y + value: 2.42 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalPosition.z + value: 6.09 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_RootOrder + value: 13 + objectReference: {fileID: 0} + - target: {fileID: 1585444000422512, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_Name + value: Tree9 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalScale.x + value: 1.2788607 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalScale.y + value: 1.2788603 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalScale.z + value: 1.3468677 + objectReference: {fileID: 0} + - target: {fileID: 1585444000422512, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &1649869453 stripped +Transform: + m_PrefabParentObject: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, + type: 2} + m_PrefabInternal: {fileID: 1649869452} +--- !u!1 &1649869454 stripped +GameObject: + m_PrefabParentObject: {fileID: 1585444000422512, guid: 63f33181f13463347b259afc54dd1bbe, + type: 2} + m_PrefabInternal: {fileID: 1649869452} +--- !u!1001 &1672436105 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 257733089} + m_Modifications: + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.x + value: -14.78 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.y + value: -1.2 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.z + value: 0.61 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_RootOrder + value: 11 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: LinkedImage + value: + objectReference: {fileID: 772802588} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_Name + value: Tree6 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.y + value: 1.0383704 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.x + value: 1.1241422 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.z + value: 1.1241424 + objectReference: {fileID: 0} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: ObjectManualDepth + value: 19 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 989a13a51252a6446b729edc777df00f, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &1672436106 stripped +Transform: + m_PrefabParentObject: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + m_PrefabInternal: {fileID: 1672436105} --- !u!1 &1681390669 GameObject: m_ObjectHideFlags: 0 @@ -2378,7 +3611,7 @@ m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 7 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1777425976 GameObject: @@ -2402,7 +3635,7 @@ m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1777425976} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 2.58, z: 7.66} + m_LocalPosition: {x: 0, y: 2.58, z: 17.12} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 11289496} @@ -2476,11 +3709,231 @@ objectReference: {fileID: 0} - target: {fileID: 4968172230546488, guid: 9f3dd22cf8fe21a43a067ab4b4ab708f, type: 2} propertyPath: m_RootOrder - value: 6 + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 114770286734950254, guid: 9f3dd22cf8fe21a43a067ab4b4ab708f, + type: 2} + propertyPath: PilePrefab + value: + objectReference: {fileID: 1430576817403556, guid: d6cf61ddfecafa14991e99ec6f1e33f0, + type: 2} + - target: {fileID: 114770286734950254, guid: 9f3dd22cf8fe21a43a067ab4b4ab708f, + type: 2} + propertyPath: RakeFlyForce + value: 33 objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 9f3dd22cf8fe21a43a067ab4b4ab708f, type: 2} m_IsPrefabParent: 0 +--- !u!1001 &1864863092 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1529148493} + m_Modifications: + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalPosition.x + value: 8.59 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalPosition.y + value: 4.66 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalPosition.z + value: 14.37 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_RootOrder + value: 14 + objectReference: {fileID: 0} + - target: {fileID: 1844362587011774, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_Name + value: Tree10 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalScale.x + value: 0.7004243 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalScale.y + value: 0.70042413 + objectReference: {fileID: 0} + - target: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_LocalScale.z + value: 0.7376713 + objectReference: {fileID: 0} + - target: {fileID: 1844362587011774, guid: 751795bd59093194e926dc7d64434292, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 751795bd59093194e926dc7d64434292, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &1864863093 stripped +Transform: + m_PrefabParentObject: {fileID: 4233244327696728, guid: 751795bd59093194e926dc7d64434292, + type: 2} + m_PrefabInternal: {fileID: 1864863092} +--- !u!1 &1864863094 stripped +GameObject: + m_PrefabParentObject: {fileID: 1844362587011774, guid: 751795bd59093194e926dc7d64434292, + type: 2} + m_PrefabInternal: {fileID: 1864863092} +--- !u!1001 &1935321917 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 257733089} + m_Modifications: + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.x + value: -6.38 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.y + value: -1.14 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.z + value: 9.48 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_RootOrder + value: 7 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: LinkedImage + value: + objectReference: {fileID: 770623800} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_Name + value: Tree2 + objectReference: {fileID: 0} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: ObjectManualDepth + value: 25 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 989a13a51252a6446b729edc777df00f, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &1935321918 stripped +Transform: + m_PrefabParentObject: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + m_PrefabInternal: {fileID: 1935321917} +--- !u!1001 &1946758198 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1529148493} + m_Modifications: + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalPosition.x + value: -2.45 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalPosition.y + value: 4.9 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalPosition.z + value: 11.22 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_RootOrder + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalScale.x + value: 1.1831794 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalScale.y + value: 1.1831791 + objectReference: {fileID: 0} + - target: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_LocalScale.z + value: 1.2460983 + objectReference: {fileID: 0} + - target: {fileID: 1585444000422512, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_Name + value: Tree5 + objectReference: {fileID: 0} + - target: {fileID: 1585444000422512, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 63f33181f13463347b259afc54dd1bbe, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &1946758199 stripped +Transform: + m_PrefabParentObject: {fileID: 4722715507293232, guid: 63f33181f13463347b259afc54dd1bbe, + type: 2} + m_PrefabInternal: {fileID: 1946758198} +--- !u!1 &1946758200 stripped +GameObject: + m_PrefabParentObject: {fileID: 1585444000422512, guid: 63f33181f13463347b259afc54dd1bbe, + type: 2} + m_PrefabInternal: {fileID: 1946758198} --- !u!1 &1982272371 GameObject: m_ObjectHideFlags: 0 @@ -2508,8 +3961,8 @@ m_Script: {fileID: 11500000, guid: 1edfc6f3905730c449618c44081c09e1, type: 3} m_Name: m_EditorClassIdentifier: - Radius: 15 - Num: 500 + Radius: 10 + Num: 100 Leafs: - {fileID: 114579094665962866, guid: 1701be1f15e160d4d904862548ae69de, type: 2} - {fileID: 114512182666289016, guid: 9f2c90804e5745a4da348dc7b5713e22, type: 2} @@ -2520,9 +3973,156 @@ m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1982272371} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -0.23, y: 7.22, z: 0.07} + m_LocalPosition: {x: -0.53, y: 7.22, z: 3.71} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 8 + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &2013353732 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 257733089} + m_Modifications: + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.x + value: 1.49 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.y + value: -1.16 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalPosition.z + value: -8.41 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_RootOrder + value: 16 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: LinkedImage + value: + objectReference: {fileID: 935798410} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_Name + value: Tree11 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.y + value: 1.0165026 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.x + value: 1.0980362 + objectReference: {fileID: 0} + - target: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_LocalScale.z + value: 1.0980357 + objectReference: {fileID: 0} + - target: {fileID: 1138802500347032, guid: 989a13a51252a6446b729edc777df00f, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114012811021287998, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + propertyPath: ObjectManualDepth + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 989a13a51252a6446b729edc777df00f, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &2013353733 stripped +Transform: + m_PrefabParentObject: {fileID: 4129064820502644, guid: 989a13a51252a6446b729edc777df00f, + type: 2} + m_PrefabInternal: {fileID: 2013353732} +--- !u!1001 &2106554098 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1529148493} + m_Modifications: + - target: {fileID: 4118268950586024, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + propertyPath: m_LocalPosition.x + value: -5.94 + objectReference: {fileID: 0} + - target: {fileID: 4118268950586024, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + propertyPath: m_LocalPosition.y + value: 5.87 + objectReference: {fileID: 0} + - target: {fileID: 4118268950586024, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + propertyPath: m_LocalPosition.z + value: 11.03 + objectReference: {fileID: 0} + - target: {fileID: 4118268950586024, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4118268950586024, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4118268950586024, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 4118268950586024, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4118268950586024, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + propertyPath: m_RootOrder + value: 11 + objectReference: {fileID: 0} + - target: {fileID: 1027882708039166, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + propertyPath: m_Name + value: Tree7 + objectReference: {fileID: 0} + - target: {fileID: 1027882708039166, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: 712fe55a4862fcb4ca196a49721569cd, type: 2} + m_IsPrefabParent: 0 +--- !u!4 &2106554099 stripped +Transform: + m_PrefabParentObject: {fileID: 4118268950586024, guid: 712fe55a4862fcb4ca196a49721569cd, + type: 2} + m_PrefabInternal: {fileID: 2106554098} +--- !u!1 &2106554100 stripped +GameObject: + m_PrefabParentObject: {fileID: 1027882708039166, guid: 712fe55a4862fcb4ca196a49721569cd, + type: 2} + m_PrefabInternal: {fileID: 2106554098} +--- !u!1 &2142796953 stripped +GameObject: + m_PrefabParentObject: {fileID: 1027882708039166, guid: 712fe55a4862fcb4ca196a49721569cd, + type: 2} + m_PrefabInternal: {fileID: 280700961} +--- !u!4 &2142796954 stripped +Transform: + m_PrefabParentObject: {fileID: 4118268950586024, guid: 712fe55a4862fcb4ca196a49721569cd, + type: 2} + m_PrefabInternal: {fileID: 280700961}