Add floating Zs

This commit is contained in:
Sofia 2020-04-20 06:11:10 +03:00
parent 26e3a57dcc
commit 988bc076c9
13 changed files with 542 additions and 0 deletions

77
Assets/Materials/Z.mat Normal file
View File

@ -0,0 +1,77 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Z
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _EMISSION
m_LightmapFlags: 2
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.9150943, g: 0.8691873, b: 0.18560876, a: 1}
- _EmissionColor: {r: 0.41467717, g: 0.39538318, b: 0.10758135, a: 1}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b90a37cb40d595a4fa3275ee8805f27f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/Models/Z.fbx Normal file

Binary file not shown.

96
Assets/Models/Z.fbx.meta Normal file
View File

@ -0,0 +1,96 @@
fileFormatVersion: 2
guid: 6889b6842a2f4cc448eb3b0315b4f4be
ModelImporter:
serializedVersion: 19300
internalIDToNameTable: []
externalObjects: {}
materials:
materialImportMode: 1
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,200 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3375252215933663693
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3375252215933663694}
- component: {fileID: 3375252215933663695}
m_Layer: 0
m_Name: FloatingZ
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3375252215933663694
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3375252215933663693}
m_LocalRotation: {x: -0, y: 0.84750676, z: -0, w: 0.5307846}
m_LocalPosition: {x: -1.625, y: 0.699, z: -0.612}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 7759133500645062025}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 115.883, z: 0}
--- !u!114 &3375252215933663695
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3375252215933663693}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b36e0aab45e887948aa1f98de348feef, type: 3}
m_Name:
m_EditorClassIdentifier:
Curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 2
outSlope: 2
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
SizeCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: -0.016773224
value: 1.0023499
inSlope: -0.16098775
outSlope: -0.16098775
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0.2946443
- serializedVersion: 3
time: 0.7930833
value: 0.6539621
inSlope: -1.271648
outSlope: -1.271648
tangentMode: 0
weightedMode: 0
inWeight: 0.09865745
outWeight: 0.16542284
- serializedVersion: 3
time: 1.0041656
value: 0.007080078
inSlope: -0.55703604
outSlope: -0.55703604
tangentMode: 0
weightedMode: 0
inWeight: 0.91936946
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
Player: {fileID: 0}
TimeToLive: 5
--- !u!1001 &3375252214746554003
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 3375252215933663694}
m_Modifications:
- target: {fileID: -4216859302048453862, guid: 6889b6842a2f4cc448eb3b0315b4f4be,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 6889b6842a2f4cc448eb3b0315b4f4be,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 6889b6842a2f4cc448eb3b0315b4f4be,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 6889b6842a2f4cc448eb3b0315b4f4be,
type: 3}
propertyPath: m_LocalRotation.x
value: 0.000000021855694
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 6889b6842a2f4cc448eb3b0315b4f4be,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 6889b6842a2f4cc448eb3b0315b4f4be,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 6889b6842a2f4cc448eb3b0315b4f4be,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 6889b6842a2f4cc448eb3b0315b4f4be,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 6889b6842a2f4cc448eb3b0315b4f4be,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 6889b6842a2f4cc448eb3b0315b4f4be,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 6889b6842a2f4cc448eb3b0315b4f4be,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 6889b6842a2f4cc448eb3b0315b4f4be,
type: 3}
propertyPath: m_LocalScale.x
value: 200
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 6889b6842a2f4cc448eb3b0315b4f4be,
type: 3}
propertyPath: m_LocalScale.y
value: 200
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: 6889b6842a2f4cc448eb3b0315b4f4be,
type: 3}
propertyPath: m_LocalScale.z
value: 200
objectReference: {fileID: 0}
- target: {fileID: -1504981713932161579, guid: 6889b6842a2f4cc448eb3b0315b4f4be,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: b90a37cb40d595a4fa3275ee8805f27f, type: 2}
- target: {fileID: -927199367670048503, guid: 6889b6842a2f4cc448eb3b0315b4f4be,
type: 3}
propertyPath: m_Name
value: Z
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6889b6842a2f4cc448eb3b0315b4f4be, type: 3}
--- !u!4 &7759133500645062025 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -4216859302048453862, guid: 6889b6842a2f4cc448eb3b0315b4f4be,
type: 3}
m_PrefabInstance: {fileID: 3375252214746554003}
m_PrefabAsset: {fileID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: fa73f411ad43b4b4f952cfe2290d878c
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -3637,6 +3637,12 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 1475581714}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1484782755 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6125707630481988399, guid: 558201eae20fa5540a826edb23937665,
type: 3}
m_PrefabInstance: {fileID: 6125707629521091122}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1512016787
PrefabInstance:
m_ObjectHideFlags: 0
@ -4199,6 +4205,7 @@ Transform:
- {fileID: 1519600967}
- {fileID: 1138615643}
- {fileID: 2718555727500931745}
- {fileID: 2009628691}
m_Father: {fileID: 0}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -4994,6 +5001,53 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!1 &2009628690
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2009628691}
- component: {fileID: 2009628692}
m_Layer: 0
m_Name: ZSpawner
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2009628691
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2009628690}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -3.787, y: 1.728, z: -2.173}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1660514110}
m_RootOrder: 15
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2009628692
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2009628690}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 848826cb11b3a26499f91a2dce13d107, type: 3}
m_Name:
m_EditorClassIdentifier:
FloatingZ: {fileID: 3375252215933663693, guid: fa73f411ad43b4b4f952cfe2290d878c,
type: 3}
Player: {fileID: 1484782755}
Frequency: 8
--- !u!1 &2038862783
GameObject:
m_ObjectHideFlags: 0

View File

@ -0,0 +1,44 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FloatingZ : MonoBehaviour {
public AnimationCurve Curve;
public AnimationCurve SizeCurve;
public GameObject Player;
private float Clock = 0;
private float y = 0;
public float TimeToLive = 6f;
void Start() {
y = transform.position.y;
}
void Update() {
var position = transform.position;
Clock += Time.deltaTime;
TimeToLive -= Time.deltaTime;
if (TimeToLive <= 0) {
Destroy(gameObject);
}
if (Clock > 1) {
Clock = 0;
y += 0.5f;
}
position.y = y + Curve.Evaluate(Clock) * 0.5f;
position.x -= 0.4f * Time.deltaTime;
position.z += 0.4f * Time.deltaTime;
transform.position = position;
var rot = transform.rotation;
rot.SetLookRotation(Player.transform.position - position);
transform.rotation = rot;
var scale = transform.localScale;
var size = SizeCurve.Evaluate((6 - TimeToLive) / 6);
scale.Set(size, size, size);
transform.localScale = scale;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b36e0aab45e887948aa1f98de348feef
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,34 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ZSpawner : MonoBehaviour {
public GameObject FloatingZ;
public GameObject Player;
public float Frequency = 5f;
private float TimeUntilSpawn = 8f;
private float spawned = 0;
void Start() {
}
void Update() {
TimeUntilSpawn -= Time.deltaTime;
if (TimeUntilSpawn <= 0) {
if (spawned < 2) {
TimeUntilSpawn = 1f;
spawned++;
} else {
spawned = 0;
TimeUntilSpawn = Frequency;
}
var z = GameObject.Instantiate(FloatingZ, transform.position, new Quaternion());
z.GetComponent<FloatingZ>().Player = Player;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 848826cb11b3a26499f91a2dce13d107
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

BIN
Raw Assets/Models/Z.blend Normal file

Binary file not shown.

BIN
Raw Assets/Models/Z.blend1 Normal file

Binary file not shown.