aĺ5.0.0f4ţ˙˙˙s˙8-l'€Łć„hŒÎA,Œ€7€˙˙˙˙€Ś€˛€Ő€ ހ.€†€Ä€ ހ.€H€Ť€˙˙˙˙€1€1€˙˙˙˙ @ހ€ Q€j€ H€ę€˙˙˙˙ €1€1€˙˙˙˙ @ހ€Q€j€ń€(˙˙˙˙€1€1€˙˙˙˙€ހ€€j€˙˙˙˙€H€›€˙˙˙˙€1€1€˙˙˙˙@ހ€Q€j€y€ € ހ.€y€< ހ.€ހCH€T˙˙˙˙€1€1€˙˙˙˙ @ހ€!Q€j€"H€`˙˙˙˙#€1€1€˙˙˙˙$@ހ€%Q€j€&H€l˙˙˙˙'€1€1€˙˙˙˙(@ހ€)Q€j€*L€{+PPtrm_FileIDm_PathIDm_DefaultReferencesm_Iconm_ExecutionOrderm_ClassNamem_Namespacem_AssemblyNamem_IsEditorScriptČ0ĹňĂôL.`?^Ů0D7€˙˙˙˙€Ś€˛€Ѐڀڀڀ#Ś€+H€3˙˙˙˙€1€1€˙˙˙˙@ހ€ Q€j€ ™€< Ś€H H€Z˙˙˙˙ €1€1€˙˙˙˙@ހ€Q€j€Ѐgڀڀڀ#Ś€+v~ € €– €Ÿ €¨ €ą €ş €Ă €Ě €Ő €Ţ  €ç! €ń" €ű# €$ €% €&Ő€#˙˙˙˙'€1€1€˙˙˙˙(€ހ€)H€j€˙˙˙˙*€1€1€˙˙˙˙+@ހ€,Q€j€-™€*.ހ8/AssetMetaDataguiddata[0]data[1]data[2]data[3]pathNametimeCreatedoriginalChangesetoriginalNameoriginalParentHash128originalDigestbytes[0]bytes[1]bytes[2]bytes[3]bytes[4]bytes[5]bytes[6]bytes[7]bytes[8]bytes[9]bytes[10]bytes[11]bytes[12]bytes[13]bytes[14]bytes[15]labelsassetStoreReflicenseType z{ď@îČă5^(H'7€˙˙˙˙€Ś€˛€ Ő€ ހ#.€,†€Ä€ ހ#.€,H€Ť€˙˙˙˙€1€1€˙˙˙˙ @ހ€ Q€j€ Ő€5˙˙˙˙ €1€1€˙˙˙˙ €ހ€€j€˙˙˙˙€H€›€˙˙˙˙€1€1€˙˙˙˙@ހ€Q€j€y€ € ހ#.€, €I@ž€X @ހ#.€,H€]˙˙˙˙€1€1€˙˙˙˙@ހ€Q€j€H€h˙˙˙˙€1€1€˙˙˙˙ @ހ€!Q€j€"H€z˙˙˙˙#€1€1€˙˙˙˙$@ހ€%Q€j€&MonoImporterPPtrm_FileIDm_PathIDm_DefaultReferencesexecutionOrdericonm_UserDatam_AssetBundleNamem_AssetBundleVariant˙˙@  ˙˙ŕyŻĐss˙˙şžŁaęO*“˘uJPQŔ7Assets/LeapMotion/DemoResources/Scripts/FlowerGrower.cs FlowerGrowerŁ /******************************************************************************\ * Copyright (C) Leap Motion, Inc. 2011-2014. * * Leap Motion proprietary. Licensed under Apache 2.0 * * Available at http://www.apache.org/licenses/LICENSE-2.0.html * \******************************************************************************/ using UnityEngine; using System.Collections; public class FlowerGrower : MonoBehaviour { public float growthRate = 1.0f; public float deathRate = 1.0f; public float growthProgress = 0.0f; public StemMesh stem; public float stemStartGrowth = 0.0f; public float stemEndGrowth = 0.6f; public Transform flowerHead; public float flowerHeadStartGrowth = 0.5f; public float flowerHeadEndGrowth = 0.8f; public Light lightSource; public float lightSourceStartGrowth = 0.0f; public float lightSourceEndGrowth = 0.8f; public PetalMesh[] leaves; public float leavesStartGrowth = 0.4f; public float leavesEndGrowth = 0.8f; public PetalMesh[] pedals; public float pedalsStartGrowth = 0.8f; public float pedalsEndGrowth = 1.0f; public FlowerBloom flowerToBloom; private Vector3 flower_head_scale_ = Vector3.zero; private float light_source_intensity_ = 0.0f; private bool growing_ = true; private bool dieing_ = false; void Start() { flower_head_scale_ = flowerHead.localScale; light_source_intensity_ = lightSource.intensity; flowerHead.localScale = Vector3.zero; foreach (PetalMesh pedal in pedals) pedal.growthProgress = 0; foreach (PetalMesh leaf in leaves) leaf.growthProgress = 0; } float ComputeGrowthAmount(float start, float end) { return Mathf.Clamp((growthProgress - start) / (end - start), 0.0f, 1.0f); } void SetSizes() { stem.growthProgress = ComputeGrowthAmount(stemStartGrowth, stemEndGrowth); float flower_head_growth = ComputeGrowthAmount(flowerHeadStartGrowth, flowerHeadEndGrowth); flowerHead.localScale = flower_head_growth * flower_head_scale_; float light_source_growth = ComputeGrowthAmount(lightSourceStartGrowth, lightSourceEndGrowth); lightSource.intensity = light_source_growth * light_source_intensity_; float leaf_growth = ComputeGrowthAmount(leavesStartGrowth, leavesEndGrowth); foreach (PetalMesh leaf in leaves) leaf.growthProgress = leaf_growth; float pedal_growth = ComputeGrowthAmount(pedalsStartGrowth, pedalsEndGrowth); foreach (PetalMesh pedal in pedals) pedal.growthProgress = pedal_growth; } public void RemoveStump() { stem.RemoveStump(); } public bool IsStumpClear() { return stem.IsStumpClear(); } public void Die() { dieing_ = true; } public bool IsDead() { return growthProgress == 0.0f; } public bool IsBroken() { return stem.IsBroken(); } public bool IsGrabbed() { GrabbableObject[] grabbables = GetComponentsInChildren(); foreach (GrabbableObject grabbable in grabbables) { if (grabbable.IsGrabbed()) return true; } return false; } void Update() { if (dieing_) growthProgress = Mathf.Clamp(growthProgress - Time.deltaTime * deathRate, 0.0f, 1.0f); else if (growing_) growthProgress = Mathf.Clamp(growthProgress + Time.deltaTime * growthRate, 0.0f, 1.0f); SetSizes(); if (growthProgress == 1.0f && flowerToBloom != null) flowerToBloom.open = true; } } FlowerGrowerAssembly-CSharp.dll