log creation

This commit is contained in:
arlo 2022-04-04 19:04:09 +03:00
parent 51d75b196d
commit bf6bbc6723
4 changed files with 301 additions and 1 deletions

View File

@ -113,6 +113,8 @@ MonoBehaviour:
m_EditorClassIdentifier:
stumpPrefab: {fileID: 108507113624723981, guid: eebb56c82efbd8d4bb0eb6bd925a0e9d,
type: 3}
logPrefab: {fileID: 3057085693074020240, guid: 79529cede28e9b9499885b2d83b8adcf,
type: 3}
onCut:
m_PersistentCalls:
m_Calls: []

View File

@ -0,0 +1,289 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3057085693074020240
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3057085693074115504}
- component: {fileID: 3057085693074918288}
- component: {fileID: 3057085693076015440}
- component: {fileID: 8478891420560098512}
- component: {fileID: 1868636573106052050}
- component: {fileID: -728432962252772913}
- component: {fileID: 1264022012566418942}
- component: {fileID: 759522315152862422}
m_Layer: 0
m_Name: Log
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3057085693074115504
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3057085693074020240}
m_LocalRotation: {x: 0, y: -0, z: 0.7071068, w: -0.7071068}
m_LocalPosition: {x: -0.6981036, y: 0.99629545, z: 2.16}
m_LocalScale: {x: 0.2, y: 0.5669, z: 0.2}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 270}
--- !u!33 &3057085693074918288
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3057085693074020240}
m_Mesh: {fileID: 4300000, guid: 768be665aba8b4e4aae7a973ae9616cf, type: 3}
--- !u!23 &3057085693076015440
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3057085693074020240}
m_Enabled: 1
m_CastShadows: 2
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 93caadf4359ae8143aad35b3145d31af, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
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
m_AdditionalVertexStreams: {fileID: 0}
--- !u!54 &8478891420560098512
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3057085693074020240}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!136 &1868636573106052050
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3057085693074020240}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
m_Radius: 0.3296725
m_Height: 0.8131512
m_Direction: 1
m_Center: {x: -0.04072858, y: 0.4065756, z: 0}
--- !u!114 &-728432962252772913
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3057085693074020240}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0ad34abafad169848a38072baa96cdb2, type: 3}
m_Name:
m_EditorClassIdentifier:
m_InteractionManager: {fileID: 0}
m_Colliders: []
m_InteractionLayerMask:
serializedVersion: 2
m_Bits: 4294967295
m_InteractionLayers:
m_Bits: 1
m_SelectMode: 0
m_CustomReticle: {fileID: 0}
m_FirstHoverEntered:
m_PersistentCalls:
m_Calls: []
m_LastHoverExited:
m_PersistentCalls:
m_Calls: []
m_HoverEntered:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1264022012566418942}
m_TargetAssemblyTypeName: Hover, Assembly-CSharp
m_MethodName: HoverStart
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_HoverExited:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1264022012566418942}
m_TargetAssemblyTypeName: Hover, Assembly-CSharp
m_MethodName: HoverEnd
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_FirstSelectEntered:
m_PersistentCalls:
m_Calls: []
m_LastSelectExited:
m_PersistentCalls:
m_Calls: []
m_SelectEntered:
m_PersistentCalls:
m_Calls: []
m_SelectExited:
m_PersistentCalls:
m_Calls: []
m_Activated:
m_PersistentCalls:
m_Calls: []
m_Deactivated:
m_PersistentCalls:
m_Calls: []
m_OnFirstHoverEntered:
m_PersistentCalls:
m_Calls: []
m_OnLastHoverExited:
m_PersistentCalls:
m_Calls: []
m_OnHoverEntered:
m_PersistentCalls:
m_Calls: []
m_OnHoverExited:
m_PersistentCalls:
m_Calls: []
m_OnSelectEntered:
m_PersistentCalls:
m_Calls: []
m_OnSelectExited:
m_PersistentCalls:
m_Calls: []
m_OnSelectCanceled:
m_PersistentCalls:
m_Calls: []
m_OnActivate:
m_PersistentCalls:
m_Calls: []
m_OnDeactivate:
m_PersistentCalls:
m_Calls: []
m_AttachTransform: {fileID: 0}
m_AttachEaseInTime: 0.15
m_MovementType: 2
m_VelocityDamping: 1
m_VelocityScale: 1
m_AngularVelocityDamping: 1
m_AngularVelocityScale: 1
m_TrackPosition: 1
m_SmoothPosition: 0
m_SmoothPositionAmount: 5
m_TightenPosition: 0.5
m_TrackRotation: 1
m_SmoothRotation: 0
m_SmoothRotationAmount: 5
m_TightenRotation: 0.5
m_ThrowOnDetach: 1
m_ThrowSmoothingDuration: 0.25
m_ThrowSmoothingCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_ThrowVelocityScale: 1.5
m_ThrowAngularVelocityScale: 1
m_ForceGravityOnDetach: 0
m_RetainTransformParent: 1
m_AttachPointCompatibilityMode: 0
--- !u!114 &1264022012566418942
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3057085693074020240}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c93cfeee8cd29624bae7c5203dedb433, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &759522315152862422
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3057085693074020240}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5fea29bb7c508c244a1f805a5fd3fc4d, type: 3}
m_Name:
m_EditorClassIdentifier:
outlineMode: 0
outlineColor: {r: 1, g: 1, b: 1, a: 1}
outlineWidth: 2
precomputeOutline: 0
bakeKeys: []
bakeValues: []

View File

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

View File

@ -7,6 +7,7 @@ public class CuttableTree : MonoBehaviour
{
private Quaternion rotation;
public GameObject stumpPrefab;
public GameObject logPrefab;
[SerializeField]
private UnityEvent onCut;
@ -30,8 +31,9 @@ public class CuttableTree : MonoBehaviour
rotation = transform.rotation;
rotation *= Quaternion.AngleAxis(20, Vector3.up);
Instantiate(stumpPrefab, transform.position, rotation);
Destroy(gameObject);
Instantiate(logPrefab, transform.position+new Vector3(0, 1, 0), rotation);
onCut.Invoke();
Destroy(gameObject);
}
}
}