diff --git a/Assets/Art/Materials/T_Sol_D.mat b/Assets/Art/Materials/T_Sol_D.mat new file mode 100644 index 0000000..53687db Binary files /dev/null and b/Assets/Art/Materials/T_Sol_D.mat differ diff --git a/Assets/Art/Materials/T_Sol_D.mat.meta b/Assets/Art/Materials/T_Sol_D.mat.meta new file mode 100644 index 0000000..9597ac4 --- /dev/null +++ b/Assets/Art/Materials/T_Sol_D.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9d4b1c409597959428bf32694eae2f5b +timeCreated: 1440311586 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Art/SM_Sol.FBX b/Assets/Art/SM_Sol.FBX new file mode 100644 index 0000000..09fbf74 Binary files /dev/null and b/Assets/Art/SM_Sol.FBX differ diff --git a/Assets/Art/SM_Sol.FBX.meta b/Assets/Art/SM_Sol.FBX.meta new file mode 100644 index 0000000..9fba681 --- /dev/null +++ b/Assets/Art/SM_Sol.FBX.meta @@ -0,0 +1,74 @@ +fileFormatVersion: 2 +guid: a52f33b80c0394f4d819fcf4d339242f +timeCreated: 1440311586 +licenseType: Free +ModelImporter: + serializedVersion: 18 + fileIDToRecycleName: + 100000: //RootNode + 400000: //RootNode + 2300000: //RootNode + 3300000: //RootNode + 4300000: Object001 + materials: + importMaterials: 1 + materialName: 0 + materialSearch: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + optimizeGameObjects: 0 + motionNodeName: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + animationCompression: 1 + animationRotationError: .5 + animationPositionError: .5 + animationScaleError: .5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + importBlendShapes: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + keepQuads: 0 + weldVertices: 1 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + splitTangentsAcrossUV: 1 + normalImportMode: 0 + tangentImportMode: 1 + importAnimation: 1 + copyAvatar: 0 + humanDescription: + human: [] + skeleton: [] + armTwist: .5 + foreArmTwist: .5 + upperLegTwist: .5 + legTwist: .5 + armStretch: .0500000007 + legStretch: .0500000007 + feetSpacing: 0 + rootMotionBoneName: + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Art/SM_Sol.fbm.meta b/Assets/Art/SM_Sol.fbm.meta new file mode 100644 index 0000000..c2b7f0a --- /dev/null +++ b/Assets/Art/SM_Sol.fbm.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 25a91ea54981fda439e86c33ed716868 +folderAsset: yes +timeCreated: 1440311583 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Art/SM_Sol.fbm/T_Sol_D.tga b/Assets/Art/SM_Sol.fbm/T_Sol_D.tga new file mode 100644 index 0000000..6598a32 Binary files /dev/null and b/Assets/Art/SM_Sol.fbm/T_Sol_D.tga differ diff --git a/Assets/Art/SM_Sol.fbm/T_Sol_D.tga.meta b/Assets/Art/SM_Sol.fbm/T_Sol_D.tga.meta new file mode 100644 index 0000000..05f3911 --- /dev/null +++ b/Assets/Art/SM_Sol.fbm/T_Sol_D.tga.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 690eeaab4d5368a40ae6ed11e8e8a28b +timeCreated: 1440311585 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Child.prefab b/Assets/Prefabs/Child.prefab index a844223..1093d25 100644 Binary files a/Assets/Prefabs/Child.prefab and b/Assets/Prefabs/Child.prefab differ diff --git a/Assets/Prefabs/Floor.prefab b/Assets/Prefabs/Floor.prefab index 8819686..52a2ed4 100644 Binary files a/Assets/Prefabs/Floor.prefab and b/Assets/Prefabs/Floor.prefab differ diff --git a/Assets/Prefabs/Pillow.prefab b/Assets/Prefabs/Pillow.prefab index b41c59f..8509ca1 100644 Binary files a/Assets/Prefabs/Pillow.prefab and b/Assets/Prefabs/Pillow.prefab differ diff --git a/Assets/Scenes/PatScene.unity b/Assets/Scenes/PatScene.unity index 87dd23a..7c7501c 100644 Binary files a/Assets/Scenes/PatScene.unity and b/Assets/Scenes/PatScene.unity differ diff --git a/Assets/Scripts/Floor.cs b/Assets/Scripts/Floor.cs index 49eb288..0b1fd44 100644 --- a/Assets/Scripts/Floor.cs +++ b/Assets/Scripts/Floor.cs @@ -1,31 +1,29 @@ using UnityEngine; using System.Collections; -[RequireComponent(typeof(MeshRenderer))] public class Floor : MonoBehaviour { public MomBehavior Mom; public Material NormalMaterial; public Material LavaMaterial; - private MeshRenderer _renderer; + public MeshRenderer Renderer; void Awake() { - _renderer = GetComponent(); Mom.OnEnterRoom += ChangeToNormalFloor; Mom.OnLeaveRoom += ChangeToLavaFloor; } private void ChangeToNormalFloor() { - _renderer.material = NormalMaterial; + Renderer.material = NormalMaterial; gameObject.tag = "Floor"; // Might not be necessary since the player is most likely "dead" if he touches a non-lava floor } private void ChangeToLavaFloor() { - _renderer.material = LavaMaterial; + Renderer.material = LavaMaterial; gameObject.tag = "Lava"; // Might not be necessary since the player is most likely "dead" if he touches a non-lava floor } diff --git a/Assets/Scripts/Pillow.cs b/Assets/Scripts/Pillow.cs index 5a66288..202de66 100644 --- a/Assets/Scripts/Pillow.cs +++ b/Assets/Scripts/Pillow.cs @@ -2,26 +2,41 @@ using System.Collections; public class Pillow : MonoBehaviour { - + + public Color SelectableMinColor; + public float LerpDuration = 2f; + public bool IsThrown = false; private bool IsPickable = true; private Collider _col; private Rigidbody _rb; + private MeshRenderer _renderer; private bool _isOwned; + private Color _defaultColor; + + private float _ratio = 0f; + private bool _lerpingUp = false; public bool IsOwned { get { return _isOwned; } - set { _isOwned = value; } + set + { + _isOwned = value; + _renderer.material.color = _defaultColor; + } } // Use this for initialization void Start () { _col = GetComponent(); _rb = GetComponent(); + _renderer = GetComponent(); + + _defaultColor = _renderer.material.color; } // Update is called once per frame @@ -30,6 +45,27 @@ public class Pillow : MonoBehaviour { if (transform.position.y < -1) { Destroy(this.gameObject); } + + if (!_isOwned) + { + _ratio += Time.deltaTime / LerpDuration / 2f; + + if (_lerpingUp) + { + _renderer.material.color = Color.Lerp(SelectableMinColor, _defaultColor, _ratio); + } + else + { + _renderer.material.color = Color.Lerp(_defaultColor, SelectableMinColor, _ratio); + } + + if (_ratio >= 1f) + { + _lerpingUp = !_lerpingUp; + + _ratio = 0f; + } + } } @@ -48,6 +84,7 @@ public class Pillow : MonoBehaviour { _rb.isKinematic = false; _col.enabled = true; _rb.AddForce(force, ForceMode.Impulse); + _renderer.material.color = _defaultColor; } public void MakePickable() { diff --git a/Assets/Test/Door.cs b/Assets/Test/Door.cs index 658a567..4292c4e 100644 --- a/Assets/Test/Door.cs +++ b/Assets/Test/Door.cs @@ -1,22 +1,22 @@ -using UnityEngine; +using UnityEngine; using System.Collections; -using System; - +using System; + public class Door : MonoBehaviour { public float MaxAngle = 135f; public float OpenDuration = 5f; - public float CloseDuration = 1f; - - /* - // Update is called once per frame + public float CloseDuration = 1f; + + /* + // Update is called once per frame void Update () - { + { state = Mathf.Clamp(state + goal * openingSpeed * Time.deltaTime, 0f, 1f); //transform.rotation = Quaternion.identity; //transform.Rotate(Vector3.up * state * angles); - transform.rotation = Quaternion.Euler(Vector3.up * curvature.Evaluate(state) * -angles); + transform.rotation = Quaternion.Euler(Vector3.up * curvature.Evaluate(state) * -angles); }*/ public void Open() @@ -66,5 +66,5 @@ public class Door : MonoBehaviour { ((Action)callback)(); } - } -} + } +} diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 6e63725..52c12ea 100644 Binary files a/ProjectSettings/ProjectSettings.asset and b/ProjectSettings/ProjectSettings.asset differ