Disabled Saves, moved Folders adn renamed Data files, and added a state machine to the cookie puzzle

This commit is contained in:
2025-11-25 16:02:55 +01:00
parent 57be1a941c
commit c5736f836a
113 changed files with 1414 additions and 25 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2ad6e1dc7d83d164ca43792751384223
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,168 @@
using UnityEngine;
using System.Collections;
using Core;
using Pathfinding;
// TODO: Remove movement based logic
public class AnneLiseBehaviour : MonoBehaviour
{
[SerializeField] public float moveSpeed;
private Animator animator;
private AIPath aiPath;
private bool hasArrived = false;
private LureSpot currentLureSpot;
private SpriteRenderer spriteRenderer; // Cached reference
private bool allowFacingByVelocity = true; // New flag
private Coroutine walkingCoroutine;
private bool annaLiseIsReady = false; // Flag to know if Anna Lise is ready to take the picture
private void Awake()
{
animator = GetComponentInChildren<Animator>();
aiPath = GetComponent<AIPath>();
spriteRenderer = GetComponentInChildren<SpriteRenderer>(); // Cache the reference
if (aiPath != null)
{
aiPath.maxSpeed = moveSpeed;
aiPath.OnTargetReachedEvent += HandleArriveAtSpot;
}
}
private void OnDestroy()
{
if (aiPath != null)
{
aiPath.OnTargetReachedEvent -= HandleArriveAtSpot;
}
}
public void TeleportJustOutOfView(Camera cam, float offset = 2f)
{
if (aiPath == null || cam == null || currentLureSpot == null || currentLureSpot.annaLiseSpot == null) return;
// Calculate direction from the target spot to Anna Lise's current position
Vector3 from = currentLureSpot.annaLiseSpot.transform.position;
Vector3 to = transform.position;
Vector3 direction = (to - from).normalized;
// Project the target spot to screen space
Vector3 targetScreen = cam.WorldToScreenPoint(from);
// Find the screen edge in the direction
Vector2 dir2D = new Vector2(direction.x, direction.y);
if (dir2D == Vector2.zero) dir2D = Vector2.right; // fallback
dir2D.Normalize();
// Calculate intersection with screen bounds
float tX = dir2D.x > 0 ? (Screen.width - targetScreen.x) / dir2D.x : (0 - targetScreen.x) / dir2D.x;
float tY = dir2D.y > 0 ? (Screen.height - targetScreen.y) / dir2D.y : (0 - targetScreen.y) / dir2D.y;
float t = Mathf.Min(Mathf.Abs(tX), Mathf.Abs(tY));
Vector2 edgeScreen = new Vector2(targetScreen.x, targetScreen.y) + dir2D * t;
edgeScreen += dir2D * offset; // Move outside the screen by offset
// Convert back to world position
Vector3 teleportWorld = cam.ScreenToWorldPoint(new Vector3(edgeScreen.x, edgeScreen.y, cam.WorldToScreenPoint(from).z));
teleportWorld.z = transform.position.z; // Keep original Z
aiPath.Teleport(teleportWorld, true);
}
public void GotoSpot(GameObject lurespot)
{
currentLureSpot = lurespot.GetComponent<LureSpot>();
// Teleport Anna Lise just out of view before moving
TeleportJustOutOfView(Camera.main, 2f);
if (aiPath == null) return;
aiPath.destination = currentLureSpot.annaLiseSpot.transform.position;
aiPath.canMove = true;
aiPath.SearchPath();
hasArrived = false;
allowFacingByVelocity = true;
if (walkingCoroutine != null)
{
StopCoroutine(walkingCoroutine);
}
walkingCoroutine = StartCoroutine(UpdateSpeedWhenWalking());
}
private IEnumerator UpdateSpeedWhenWalking()
{
while (!hasArrived && aiPath != null && animator != null)
{
float currentSpeed = aiPath.velocity.magnitude;
animator.SetFloat("speed", currentSpeed);
// Only allow facing by velocity if not arrived
if (allowFacingByVelocity && currentSpeed > 0.01f && spriteRenderer != null)
{
Vector3 velocity = aiPath.velocity;
if (velocity.x != 0)
{
Vector3 scale = spriteRenderer.transform.localScale;
scale.x = Mathf.Abs(scale.x) * (velocity.x > 0 ? 1 : -1);
spriteRenderer.transform.localScale = scale;
}
}
yield return null;
}
}
private void HandleArriveAtSpot()
{
if (hasArrived) return;
hasArrived = true;
allowFacingByVelocity = false; // Disable facing by velocity after arrival
aiPath.canMove = false;
if (walkingCoroutine != null)
{
StopCoroutine(walkingCoroutine);
walkingCoroutine = null;
}
// Face the "luredBird" of the current lurespot, if available
if (currentLureSpot != null)
{
if (currentLureSpot.luredBird != null)
{
FaceTarget(currentLureSpot.luredBird);
annaLiseIsReady = true; // Now Anna Lise is ready to take the picture
}
}
if (animator != null && currentLureSpot.name != "LureSpotB")// Horrible way to not take the photo if its Wolter
{
animator.SetTrigger("TakePhoto");
annaLiseIsReady = false; // Reset the flag after taking the photo
}
animator.SetFloat("speed", 0);
}
public void FaceTarget(GameObject target)
{
if (target == null || spriteRenderer == null) return;
// Compare X positions to determine facing direction
float direction = target.transform.position.x - transform.position.x;
if (Mathf.Abs(direction) > 0.01f) // Avoid flipping if almost aligned
{
Vector3 scale = spriteRenderer.transform.localScale;
scale.x = Mathf.Abs(scale.x) * (direction > 0 ? 1 : -1);
spriteRenderer.transform.localScale = scale;
}
}
public void TrafalgarTouchedAnnaLise()
{
if (annaLiseIsReady == true && currentLureSpot.name == "LureSpotB") // Only allow if Anna Lise is ready and it's the correct lure spot
{
// Trigger the photo taken animation
if (animator != null)
{
currentLureSpot.GetComponentInChildren<BirdEyesBehavior>().BirdReveal();
animator.SetTrigger("TakePhoto");
}
annaLiseIsReady = false; // Reset the flag after taking the photo
}
Logging.Debug("Trafalgar touched Anna Lise");
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: d0d1761ee6769c243b110122f5e17b73

View File

@@ -0,0 +1,56 @@
using UnityEngine;
using System.Collections;
using Pixelplacement;
public class AnneLiseBushPopBehaviour : MonoBehaviour
{
public Spline popSpline;
public Transform bushObject;
public float popDuration = 1f;
public float popDelay = 0f;
void Start()
{
StartCoroutine(BushPeak());
}
void PopOutOfBush()
{
// Example: Move bushObject along the spline from start (0) to end (1)
Tween.Spline(
popSpline,
bushObject,
1f,
0f,
false, // Do not orient to path
popDuration,
popDelay,
Tween.EaseInOut,
Tween.LoopType.None
);
}
void HideInBush()
{
// Example: Move bushObject along the spline from start (0) to end (1)
Tween.Spline(
popSpline,
bushObject,
0f,
1f,
false, // Do not orient to path
popDuration,
popDelay,
Tween.EaseInOut,
Tween.LoopType.None
);
}
IEnumerator BushPeak()
{
PopOutOfBush();
yield return new WaitForSeconds(5);
HideInBush();
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 116af68fa272dc64ba6e58bd5e277631

View File

@@ -0,0 +1,35 @@
using UnityEngine;
public class Distancemeasurer : MonoBehaviour
{
public float playerToPlaceDistance;
public BirdEyesBehavior birdEyes;
private Vector2 placePosition;
private Vector2 playerPosition;
private float distance;
private GameObject player;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
placePosition = transform.position;
player = GameObject.FindWithTag("Player");
playerPosition = player.transform.position;
distance = Vector2.Distance(placePosition, playerPosition);
}
// Update is called once per frame
// TODO: Make this less expensive by not doing it every frame
void Update()
{
playerPosition = player.transform.position;
distance = Vector2.Distance(placePosition, playerPosition);
//Logging.Debug("Distance to player: " + distance);
if (distance > playerToPlaceDistance && birdEyes.correctItemIsIn == true)
{
birdEyes.BirdReveal();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 2226aecbed4b1f143a5a5c5be4236957

View File

@@ -0,0 +1,8 @@
using UnityEngine;
// TODO: Remove this
public class LureSpot : MonoBehaviour
{
[SerializeField] public GameObject luredBird;
[SerializeField] public GameObject annaLiseSpot;
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 78f015ca3cba1d54382afba790601471

View File

@@ -0,0 +1,54 @@
using Pixelplacement;
using UnityEngine;
using Core.SaveLoad;
public class ButterFlyBehaviour : MonoBehaviour
{
public AppleMachine butterStateMachine;
public Spline butterflightSpline;
public Transform butterflyObject;
public float flightDuration = 2f;
public float flightDelay = 0f;
private const float AnchorThreshold = 0.05f;
private Animator butterflyAnimator;
// Called when entering the butterfly flight state
public void OnEnable()
{
if (butterflightSpline == null || butterflyObject == null)
{
Debug.LogWarning("ButterFlyBehaviour: Missing spline or butterfly object reference.");
return;
}
if (butterflyObject != null )
{
butterflyAnimator = butterflyObject.GetComponentInChildren<Animator>();
}
butterflyAnimator.SetTrigger("BrokeOut");
GetComponent<AppleAudioSource>().Play(0);
Tween.Spline(
butterflightSpline,
butterflyObject,
0,
1,
false,
flightDuration,
flightDelay,
Tween.EaseInOut,
Tween.LoopType.None, HandleTweenStarted, HandleTweenFinished
);
}
public void HandleTweenStarted()
{
}
public void HandleTweenFinished()
{
butterStateMachine.ChangeState("Free");
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: f8cd0ca91dab0404daaa3fa1dc722658

View File

@@ -0,0 +1,13 @@
using Core.SaveLoad;
using Core;
using UnityEngine;
public class ButterFlyState : AppleMachine
{
public void stateSwitch(string StateName)
{
Logging.Debug("State Switch to: " + StateName);
ChangeState(StateName);
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: b889d915f28f8ac4ebeb12013bcaa4ce

View File

@@ -0,0 +1,21 @@
using Pixelplacement;
using UnityEngine;
using Core.SaveLoad;
public class ButterflyFreeBehaviour : MonoBehaviour
{
public GameObject butterflyRef;
private Animator butterflyAnimator;
public PicnicBehaviour picnicRef;
public void OnEnable()
{
if (butterflyRef != null)
{
butterflyAnimator = butterflyRef.GetComponentInChildren<Animator>();
}
butterflyAnimator.SetTrigger("IsFree");
picnicRef.EnterDistractedState();
Debug.Log("ButterflyFreeBehaviour enabled");
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6821f70f6ac4b85418b15ce068ddc6da

View File

@@ -0,0 +1,131 @@
using System.Collections;
using Unity.Cinemachine;
using UnityEngine;
namespace DamianExperiments
{
public class EagleEyeBehaviour : MonoBehaviour
{
// Serialized backing fields allow manual assignment in the inspector
private GameObject _cinecameraObject;
private CinemachineCamera _virtualCamera;
private CinemachineConfiner2D _confiner2D;
// Lazy-fetched properties: if null, try to find the GameObject tagged "MainCinemachineCamera"
private CinemachineCamera VirtualCamera
{
get
{
if (_virtualCamera == null)
{
if (_cinecameraObject == null)
_cinecameraObject = GameObject.FindWithTag("MainCinemachineCamera");
if (_cinecameraObject != null)
{
_virtualCamera = _cinecameraObject.GetComponent<CinemachineCamera>();
if (_virtualCamera == null)
Debug.LogWarning("EagleEyeBehaviour: Found object with tag 'MainCinemachineCamera' " +
"but couldn't find a CinemachineCamera component.");
}
else
{
Debug.LogWarning("EagleEyeBehaviour: No GameObject found with tag 'MainCinemachineCamera'.");
}
}
return _virtualCamera;
}
set => _virtualCamera = value;
}
private CinemachineConfiner2D Confiner2D
{
get
{
if (_confiner2D == null)
{
// If a virtual camera exists, try to pull the confiner from it
if (VirtualCamera != null)
{
_confiner2D = VirtualCamera.GetComponent<CinemachineConfiner2D>();
}
if (_confiner2D == null)
{
Debug.LogWarning("EagleEyeBehaviour: CinemachineConfiner2D not found on the MainCinemachineCamera object.");
}
}
return _confiner2D;
}
set => _confiner2D = value;
}
[SerializeField] private float zoomOutOrthoSize = 30f;
[SerializeField] private float normalOrthoSize = 15f;
[SerializeField] private float transitionDuration = 0.5f; // Duration of the transition
[SerializeField] private float eagleEyeDuration = 3f; // Duration to stay zoomed out
[SerializeField] private UnityEngine.UI.Button eagleEyeButton; // Reference to the UI button
private Coroutine _zoomCoroutine;
private Coroutine _smoothOrthoCoroutine;
private float _currentOrthoSize;
public void ResetEagleEye()
{
if (_zoomCoroutine != null)
StopCoroutine(_zoomCoroutine);
if (_smoothOrthoCoroutine != null)
StopCoroutine(_smoothOrthoCoroutine);
if (eagleEyeButton != null)
eagleEyeButton.interactable = true;
}
public void ActivateEagleEye()
{
if (eagleEyeButton != null)
{
eagleEyeButton.interactable = false;
}
if (_zoomCoroutine != null) StopCoroutine(_zoomCoroutine);
_zoomCoroutine = StartCoroutine(EagleEyeSequence());
}
private IEnumerator EagleEyeSequence()
{
_smoothOrthoCoroutine = StartCoroutine(SmoothOrthoSize(VirtualCamera, zoomOutOrthoSize, transitionDuration));
yield return _smoothOrthoCoroutine;
yield return new WaitForSeconds(eagleEyeDuration);
float zoomInTarget = normalOrthoSize;
_smoothOrthoCoroutine = StartCoroutine(SmoothOrthoSize(VirtualCamera, zoomInTarget, transitionDuration));;
yield return _smoothOrthoCoroutine;
if (eagleEyeButton != null)
{
eagleEyeButton.interactable = true;
}
}
private IEnumerator SmoothOrthoSize(CinemachineCamera cam, float targetSize, float duration)
{
float startSize = cam.Lens.OrthographicSize;
float elapsed = 0f;
while (elapsed < duration)
{
elapsed += Time.deltaTime;
cam.Lens.OrthographicSize = Mathf.Lerp(startSize, targetSize, elapsed / duration);
if (Confiner2D != null)
{
Confiner2D.InvalidateBoundingShapeCache();
}
yield return null;
}
cam.Lens.OrthographicSize = targetSize;
if (Confiner2D != null)
{
Confiner2D.InvalidateBoundingShapeCache();
}
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: f5a0fae2a16515d46aca1e6cc631cee0

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 84222101ff72f434b8e5e49754305f5d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c6fd0683cee159c4f899a794af80c7ce
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,84 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: LawnMowerMowing
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- serializedVersion: 2
curve:
- time: 0
value: {fileID: -4444670910754578914, guid: 464f70d7647a22a4aa688ffc2b6654cc, type: 3}
- time: 0.18333334
value: {fileID: 5233908553689211412, guid: 464f70d7647a22a4aa688ffc2b6654cc, type: 3}
- time: 0.33333334
value: {fileID: 7052581180763600252, guid: 464f70d7647a22a4aa688ffc2b6654cc, type: 3}
- time: 0.48333332
value: {fileID: 4839952163610979709, guid: 464f70d7647a22a4aa688ffc2b6654cc, type: 3}
- time: 0.6666667
value: {fileID: -4444670910754578914, guid: 464f70d7647a22a4aa688ffc2b6654cc, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
flags: 2
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
isIntCurve: 0
isSerializeReferenceCurve: 0
pptrCurveMapping:
- {fileID: -4444670910754578914, guid: 464f70d7647a22a4aa688ffc2b6654cc, type: 3}
- {fileID: 5233908553689211412, guid: 464f70d7647a22a4aa688ffc2b6654cc, type: 3}
- {fileID: 7052581180763600252, guid: 464f70d7647a22a4aa688ffc2b6654cc, type: 3}
- {fileID: 4839952163610979709, guid: 464f70d7647a22a4aa688ffc2b6654cc, type: 3}
- {fileID: -4444670910754578914, guid: 464f70d7647a22a4aa688ffc2b6654cc, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.68333334
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View File

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

View File

@@ -0,0 +1,72 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1102 &-9094513822423650161
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: LawnMowerMowing
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 083a3166fef9168469713bd00eee5308, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1107 &-2429364330681070164
AnimatorStateMachine:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: -9094513822423650161}
m_Position: {x: 30, y: 240, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: -9094513822423650161}
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: _Lawnmower_Anim
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: -2429364330681070164}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}

View File

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

View File

@@ -0,0 +1,186 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &277562128272848195
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 249029427890415945}
- component: {fileID: 8669923946467467544}
m_Layer: 0
m_Name: GardenerChaseState
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &249029427890415945
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 277562128272848195}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3773641007251837342}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &8669923946467467544
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 277562128272848195}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: eaefd3d5a2a864ca5b5d9ec5f2a7040f, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &5634601970195484129
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5969249088313380091}
- component: {fileID: 8741941670841680830}
m_Layer: 0
m_Name: GardenerIdleState
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5969249088313380091
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5634601970195484129}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3773641007251837342}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &8741941670841680830
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5634601970195484129}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: eaefd3d5a2a864ca5b5d9ec5f2a7040f, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &7821713087316151254
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3773641007251837342}
- component: {fileID: 3270057320425534415}
- component: {fileID: 8244548860977619315}
- component: {fileID: 3901496808324947611}
m_Layer: 0
m_Name: Gardener
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3773641007251837342
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7821713087316151254}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 35.9931, y: 1.21847, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 5969249088313380091}
- {fileID: 249029427890415945}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &3270057320425534415
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7821713087316151254}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 55938fb1577dd4ad3af7e994048c86f6, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &8244548860977619315
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7821713087316151254}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9e0b24e2f2ad54cc09940c320ed3cf4b, type: 3}
m_Name:
m_EditorClassIdentifier:
defaultState: {fileID: 0}
currentState: {fileID: 0}
_unityEventsFolded: 0
verbose: 0
allowReentry: 0
returnToDefaultOnDisable: 1
OnStateExited:
m_PersistentCalls:
m_Calls: []
OnStateEntered:
m_PersistentCalls:
m_Calls: []
OnFirstStateEntered:
m_PersistentCalls:
m_Calls: []
OnFirstStateExited:
m_PersistentCalls:
m_Calls: []
OnLastStateEntered:
m_PersistentCalls:
m_Calls: []
OnLastStateExited:
m_PersistentCalls:
m_Calls: []
--- !u!114 &3901496808324947611
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7821713087316151254}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4ad080e6ca3114e4e96ccc33655d3dff, type: 3}
m_Name:
m_EditorClassIdentifier:

View File

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

View File

@@ -0,0 +1,15 @@
using System.Security.Cryptography.X509Certificates;
using Core;
using Core.SaveLoad;
using Pixelplacement;
using UnityEngine;
public class GardenerBehaviour : AppleMachine
{
public void stateSwitch (string StateName)
{
Logging.Debug("State Switch to: " + StateName);
ChangeState(StateName);
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 4ad080e6ca3114e4e96ccc33655d3dff

View File

@@ -0,0 +1,17 @@
using Core;
using Core.SaveLoad;
using Pixelplacement;
public class LawnMowerBehaviour : AppleMachine
{
public void mowerTouched()
{
Logging.Debug("Mower Touched");
}
public void stateSwitch(string StateName)
{
Logging.Debug("State Switch to: " + StateName);
ChangeState(StateName);
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 9fba2c868971b20439aaea06a939d8e7

View File

@@ -0,0 +1,160 @@
using Core.SaveLoad;
using UnityEngine;
using Pixelplacement;
public class LawnMowerChaseBehaviour : AppleState
{
public Spline ChaseSpline;
public Transform LawnMowerObject;
public float chaseDuration;
public float chaseDelay;
[Range(0, 1)] public float startPercentage; // Exposed in Inspector
private const float AnchorThreshold = 0.05f;
private bool _wasAtStart = false;
private bool _wasAtEnd = false;
// For initial tween tracking
private bool _initialTweenActive = true;
private float _initialTargetAnchor = 1f;
//Reference to the gardener's gameobject
public GameObject gardenerRef = null;
public Animator gardenerAnimator = null;
public bool gardenerChasing = true;
public GardenerAudioController gardenerAudioController;
public override void OnEnterState()
{
LawnMowerObject.position = ChaseSpline.GetPosition(startPercentage);
float distanceToStart = Mathf.Abs(startPercentage - 0f);
float distanceToEnd = Mathf.Abs(startPercentage - 1f);
gardenerAudioController.StartMowerSound();
if (distanceToStart < distanceToEnd)
{
// Tween from startPercentage to 1
_initialTargetAnchor = 1f;
Tween.Spline(
ChaseSpline,
LawnMowerObject,
startPercentage,
1,
false,
chaseDuration * (1 - startPercentage),
chaseDelay,
Tween.EaseInOut,
Tween.LoopType.None
);
}
else
{
// Tween from startPercentage to 0
_initialTargetAnchor = 0f;
Tween.Spline(
ChaseSpline,
LawnMowerObject,
startPercentage,
0,
false,
chaseDuration * startPercentage,
chaseDelay,
Tween.EaseInOut,
Tween.LoopType.None
);
}
_initialTweenActive = true;
}
public override void OnRestoreState(string data)
{
OnEnterState();
}
void Update()
{
float percentage = ChaseSpline.ClosestPoint(LawnMowerObject.position);
// Handle initial tween completion
if (_initialTweenActive)
{
if (Mathf.Abs(percentage - _initialTargetAnchor) <= AnchorThreshold)
{
// Start ping-pong tween between extremes
StartPingPongTween(_initialTargetAnchor, 1f - _initialTargetAnchor);
_initialTweenActive = false;
}
return; // Don't process flip logic until ping-pong starts
}
// Detect start anchor
if (percentage <= AnchorThreshold)
{
if (!_wasAtStart)
{
flipSprite();
_wasAtStart = true;
_wasAtEnd = false;
}
}
// Detect end anchor
else if (percentage >= 1f - AnchorThreshold)
{
if (!_wasAtEnd)
{
flipSprite();
_wasAtEnd = true;
_wasAtStart = false;
}
}
else
{
_wasAtStart = false;
_wasAtEnd = false;
}
}
private void StartPingPongTween(float from, float to)
{
Tween.Spline(
ChaseSpline,
LawnMowerObject,
from,
to,
false,
chaseDuration,
0,
Tween.EaseLinear,
Tween.LoopType.PingPong
);
}
private void flipSprite()
{
if (gardenerRef == null)
{
gardenerRef = GameObject.Find("GardenerRunningSprite");
gardenerAnimator = gardenerRef.GetComponent<Animator>();
}
Vector3 scale = LawnMowerObject.transform.localScale;
Vector3 rotation = LawnMowerObject.transform.eulerAngles;
scale.x *= -1;
rotation.z *= -1;
LawnMowerObject.transform.localScale = scale;
LawnMowerObject.transform.eulerAngles = rotation;
if (gardenerChasing == true)
{
gardenerRef.transform.localPosition = new Vector3 (-15, -9f, gardenerRef.transform.localPosition.z);
gardenerAnimator.SetBool("IsScared?", true);
gardenerChasing = false;
}
else
{
gardenerRef.transform.localPosition = new Vector3(21f, 16f, gardenerRef.transform.localPosition.z);
gardenerAnimator.SetBool("IsScared?", false);
gardenerChasing = true;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 426d4511f8eb64747ab44f61973dcf2e

View File

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

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 152828d0655f5c14cae91cf1cf71fd39
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,158 @@
using UnityEngine;
using System;
using System.Collections;
using Core;
using Core.Lifecycle;
using Core.SaveLoad;
using UnityEngine.Audio;
public class PicnicBehaviour : ManagedBehaviour
{
private AppleMachine stateMachine;
private Animator animator;
[Header("The FakeChocolate to destroy!")]
[SerializeField] private GameObject fakeChocolate;
[SerializeField] private GameObject realChocolate;
private AppleAudioSource _audioSource;
public AudioResource distractedAudioClips;
public AudioResource angryAudioClips;
public AudioResource feederClips;
public AudioResource moanerClips;
// Save system configuration
public override bool AutoRegisterForSave => true;
// Runtime state tracking
private bool _fakeChocolateDestroyed;
private bool _isDistracted; // track current explicit state so it can be saved
internal override void OnManagedAwake()
{
stateMachine = GetComponent<AppleMachine>();
animator = GetComponent<Animator>();
_audioSource = GetComponent<AppleAudioSource>();
}
internal override void OnSceneRestoreCompleted()
{
if (_fakeChocolateDestroyed)
{
DestroyChocolateObjects();
}
else
{
// Restore the saved state (distracted or chilling) and wait for external control to change states.
if (_isDistracted)
EnterDistractedState();
else
EnterChillingState();
}
}
// Manual state control methods (replaces automatic timer-based switching)
public void EnterDistractedState()
{
if (stateMachine == null) stateMachine = GetComponent<AppleMachine>();
if (animator == null) animator = GetComponent<Animator>();
if (_audioSource == null) _audioSource = GetComponent<AppleAudioSource>();
_audioSource.Stop();
stateMachine.ChangeState("Picnic PPL Distracted");
animator.SetBool("theyDistracted", true);
_isDistracted = true;
}
public void EnterChillingState()
{
if (stateMachine == null) stateMachine = GetComponent<AppleMachine>();
if (animator == null) animator = GetComponent<Animator>();
if (_audioSource == null) _audioSource = GetComponent<AppleAudioSource>();
_audioSource.Stop();
stateMachine.ChangeState("Picnic PPL Chilling");
animator.SetBool("theyDistracted", false);
_isDistracted = false;
}
public void triedToStealChocolate()
{
_audioSource.Stop();
animator.SetTrigger("theyAngry");
Logging.Debug("Hey! Don't steal my chocolate!");
_audioSource.audioSource.resource = angryAudioClips;
_audioSource.Play(0);
}
public void destroyFakeChocolate()
{
_fakeChocolateDestroyed = true;
Destroy(fakeChocolate);
Destroy(realChocolate);
}
private void DestroyChocolateObjects()
{
if (fakeChocolate != null)
{
Destroy(fakeChocolate);
fakeChocolate = null;
}
if (realChocolate != null)
{
realChocolate.SetActive(true);
}
}
public void PlayFeederAudio()
{
_audioSource.audioSource.resource = feederClips;
_audioSource.Play(0);
}
public void PlayMoanerAudio()
{
_audioSource.audioSource.resource = moanerClips;
_audioSource.Play(0);
}
public void PlayDistractedAudio()
{
_audioSource.audioSource.resource = distractedAudioClips;
_audioSource.Play(0);
}
internal override string OnSceneSaveRequested()
{
var state = new PicnicBehaviourState { fakeChocolateDestroyed = _fakeChocolateDestroyed, isDistracted = _isDistracted };
return JsonUtility.ToJson(state);
}
internal override void OnSceneRestoreRequested(string serializedData)
{
if (string.IsNullOrEmpty(serializedData)) return;
try
{
var state = JsonUtility.FromJson<PicnicBehaviourState>(serializedData);
if (state != null)
{
_fakeChocolateDestroyed = state.fakeChocolateDestroyed;
_isDistracted = state.isDistracted;
}
}
catch (Exception ex)
{
Debug.LogWarning($"[PicnicBehaviour] Failed to restore state: {ex.Message}");
}
}
}
[Serializable]
public class PicnicBehaviourState
{
public bool fakeChocolateDestroyed;
public bool isDistracted;
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 0a0d74ee1aa43b54ab5d08005bdd9b16

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fa5b9c4244ad68a459d1b0dedfae767a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3b3e10c6b8bba8b4483e5fa18d9fdb77
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,211 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1102 &-5418160029847934849
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: soundBird_flying
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 8314423429269036170}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: d2469df5202f749479c5a5e5d86c5997, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: soundBird_AnimControler
serializedVersion: 5
m_AnimatorParameters:
- m_Name: isScared
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 1833652908882337205}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1107 &1833652908882337205
AnimatorStateMachine:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 5978219229995665873}
m_Position: {x: 30, y: 230, z: 0}
- serializedVersion: 1
m_State: {fileID: 7226329699167659353}
m_Position: {x: 300, y: 230, z: 0}
- serializedVersion: 1
m_State: {fileID: -5418160029847934849}
m_Position: {x: 170, y: 360, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 5978219229995665873}
--- !u!1101 &3117123134348446577
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions: []
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: -5418160029847934849}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0.673913
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &5978219229995665873
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: soundBird_Idle
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 7208891314770376229}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 4944cf01faa9ad34b9768e180fdcf7cb, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &7208891314770376229
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: isScared
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 7226329699167659353}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 2
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &7226329699167659353
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: soundBird_spooked
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 3117123134348446577}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 22ea14b52af575e4cbec160f0864548c, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &8314423429269036170
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 2
m_ConditionEvent: isScared
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 5978219229995665873}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0.75409836
m_HasExitTime: 0
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1

View File

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

View File

@@ -0,0 +1,183 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: soundBird_Idle
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- serializedVersion: 2
curve:
- time: 0
value: {fileID: -1035714051, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.033333335
value: {fileID: -740831527, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.05
value: {fileID: -648204482, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.11666667
value: {fileID: -960280295, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.13333334
value: {fileID: -1144832505, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.2
value: {fileID: -1860215682, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.25
value: {fileID: 519773293, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.26666668
value: {fileID: -1067281986, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.33333334
value: {fileID: -36811272, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.38333333
value: {fileID: -1592089404, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.41666666
value: {fileID: -1729322987, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.45
value: {fileID: -91858778, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.5
value: {fileID: -26124593, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.53333336
value: {fileID: 259088195, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.6
value: {fileID: 1746085375, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.6166667
value: {fileID: -182272111, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.68333334
value: {fileID: 1436667360, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.73333335
value: {fileID: 545467259, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.75
value: {fileID: 121392657, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.8
value: {fileID: 938631806, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.8333333
value: {fileID: 1943282875, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.8833333
value: {fileID: -1918772169, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.93333334
value: {fileID: -1252794517, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 0.96666664
value: {fileID: -927331073, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 1.0166667
value: {fileID: -1038168376, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 1.0833334
value: {fileID: 1855149249, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 1.1
value: {fileID: -2116798272, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 1.1666666
value: {fileID: 2078607702, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 1.1833333
value: {fileID: -633261939, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 1.2333333
value: {fileID: -86103801, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 1.2833333
value: {fileID: 1380056380, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 1.3166667
value: {fileID: 1797284751, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 1.3666667
value: {fileID: 2004539437, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 1.4166666
value: {fileID: 1984933759, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 1.45
value: {fileID: -89013944, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 1.5
value: {fileID: 1990407029, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 1.5166667
value: {fileID: 1094948637, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- time: 1.5833334
value: {fileID: -1414182512, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
flags: 2
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
isIntCurve: 0
isSerializeReferenceCurve: 0
pptrCurveMapping:
- {fileID: -1035714051, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -740831527, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -648204482, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -960280295, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -1144832505, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -1860215682, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: 519773293, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -1067281986, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -36811272, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -1592089404, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -1729322987, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -91858778, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -26124593, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: 259088195, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: 1746085375, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -182272111, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: 1436667360, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: 545467259, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: 121392657, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: 938631806, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: 1943282875, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -1918772169, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -1252794517, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -927331073, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -1038168376, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: 1855149249, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -2116798272, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: 2078607702, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -633261939, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -86103801, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: 1380056380, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: 1797284751, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: 2004539437, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: 1984933759, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -89013944, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: 1990407029, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: 1094948637, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
- {fileID: -1414182512, guid: 9d1670b18fc5fa8459596f1ddd4a4bd7, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1.6
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View File

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

View File

@@ -0,0 +1,281 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: soundBird_flying
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- serializedVersion: 2
curve:
- time: 0
value: {fileID: 1352243374, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.05
value: {fileID: -349576499, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.1
value: {fileID: 413749935, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.16666667
value: {fileID: 2017559639, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.21666667
value: {fileID: -1655876562, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.26666668
value: {fileID: 1870464896, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.31666666
value: {fileID: 542051099, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.36666667
value: {fileID: -402468524, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.43333334
value: {fileID: 1152881364, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.48333332
value: {fileID: -1294908912, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.55
value: {fileID: -621838372, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.6
value: {fileID: -1297474476, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.6666667
value: {fileID: -1328927936, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.71666664
value: {fileID: 1646701018, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.76666665
value: {fileID: 1583098563, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.81666666
value: {fileID: -36513208, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.8666667
value: {fileID: -1786764806, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.93333334
value: {fileID: 304867534, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.98333335
value: {fileID: -120774828, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 1.0333333
value: {fileID: -1620687073, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
attribute: m_Sprite
path: SoundBirdFlyAround/SoundBirdFlyingAnim
classID: 212
script: {fileID: 0}
flags: 2
- serializedVersion: 2
curve:
- time: 0
value: {fileID: 1352243374, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.05
value: {fileID: -349576499, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.1
value: {fileID: 413749935, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.16666667
value: {fileID: 2017559639, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.21666667
value: {fileID: -1655876562, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.26666668
value: {fileID: 1870464896, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.31666666
value: {fileID: 542051099, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.36666667
value: {fileID: -402468524, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.43333334
value: {fileID: 1152881364, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.48333332
value: {fileID: -1294908912, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.55
value: {fileID: -621838372, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.6
value: {fileID: -1297474476, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.6666667
value: {fileID: -1328927936, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.71666664
value: {fileID: 1646701018, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.76666665
value: {fileID: 1583098563, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.81666666
value: {fileID: -36513208, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.8666667
value: {fileID: -1786764806, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.93333334
value: {fileID: 304867534, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.98333335
value: {fileID: -120774828, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 1.0333333
value: {fileID: -1620687073, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
attribute: m_Sprite
path: SoundBirdLanding/SoundBirdLandingAnim
classID: 212
script: {fileID: 0}
flags: 2
- serializedVersion: 2
curve:
- time: 0
value: {fileID: 1352243374, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.05
value: {fileID: -349576499, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.1
value: {fileID: 413749935, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.16666667
value: {fileID: 2017559639, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.21666667
value: {fileID: -1655876562, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.26666668
value: {fileID: 1870464896, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.31666666
value: {fileID: 542051099, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.36666667
value: {fileID: -402468524, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.43333334
value: {fileID: 1152881364, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.48333332
value: {fileID: -1294908912, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.55
value: {fileID: -621838372, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.6
value: {fileID: -1297474476, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.6666667
value: {fileID: -1328927936, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.71666664
value: {fileID: 1646701018, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.76666665
value: {fileID: 1583098563, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.81666666
value: {fileID: -36513208, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.8666667
value: {fileID: -1786764806, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.93333334
value: {fileID: 304867534, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 0.98333335
value: {fileID: -120774828, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- time: 1.0333333
value: {fileID: -1620687073, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
attribute: m_Sprite
path: SoundBirdTakeoff/SoundBirdTakeOffAnim
classID: 212
script: {fileID: 0}
flags: 2
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 3060895765
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
isIntCurve: 0
isSerializeReferenceCurve: 0
- serializedVersion: 2
path: 330117812
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
isIntCurve: 0
isSerializeReferenceCurve: 0
- serializedVersion: 2
path: 631576921
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
isIntCurve: 0
isSerializeReferenceCurve: 0
pptrCurveMapping:
- {fileID: 1352243374, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -349576499, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 413749935, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 2017559639, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -1655876562, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 1870464896, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 542051099, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -402468524, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 1152881364, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -1294908912, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -621838372, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -1297474476, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -1328927936, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 1646701018, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 1583098563, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -36513208, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -1786764806, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 304867534, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -120774828, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -1620687073, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 1352243374, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -349576499, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 413749935, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 2017559639, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -1655876562, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 1870464896, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 542051099, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -402468524, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 1152881364, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -1294908912, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -621838372, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -1297474476, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -1328927936, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 1646701018, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 1583098563, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -36513208, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -1786764806, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 304867534, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -120774828, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -1620687073, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 1352243374, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -349576499, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 413749935, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 2017559639, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -1655876562, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 1870464896, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 542051099, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -402468524, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 1152881364, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -1294908912, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -621838372, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -1297474476, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -1328927936, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 1646701018, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 1583098563, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -36513208, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -1786764806, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: 304867534, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -120774828, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
- {fileID: -1620687073, guid: 24b1abff6f4a7f946b2ae45b97df35c6, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1.05
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View File

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

View File

@@ -0,0 +1,147 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: soundBird_spooked
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- serializedVersion: 2
curve:
- time: 0
value: {fileID: 1611804804, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.033333335
value: {fileID: -1270621477, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.06666667
value: {fileID: -1443242107, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.1
value: {fileID: -1754193120, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.11666667
value: {fileID: -1454053410, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.15
value: {fileID: -963416743, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.18333334
value: {fileID: 960557805, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.21666667
value: {fileID: 1860856855, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.25
value: {fileID: 1402186056, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.28333333
value: {fileID: -1464771109, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.3
value: {fileID: 1341865396, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.33333334
value: {fileID: 725794037, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.36666667
value: {fileID: 610798074, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.4
value: {fileID: 1331452177, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.43333334
value: {fileID: 1458247875, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.46666667
value: {fileID: 10975412, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.48333332
value: {fileID: -1828920936, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.51666665
value: {fileID: 207413984, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.55
value: {fileID: -1395281158, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.5833333
value: {fileID: 312354876, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.6166667
value: {fileID: 1503701480, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.65
value: {fileID: 1500215705, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.6666667
value: {fileID: -1094665041, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.7
value: {fileID: -1663139022, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.73333335
value: {fileID: -747184157, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- time: 0.76666665
value: {fileID: -2127432694, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
attribute: m_Sprite
path: SoundBirdTakeoff/SoundBirdTakeOffAnim
classID: 212
script: {fileID: 0}
flags: 2
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 631576921
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
isIntCurve: 0
isSerializeReferenceCurve: 0
pptrCurveMapping:
- {fileID: 1611804804, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: -1270621477, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: -1443242107, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: -1754193120, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: -1454053410, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: -963416743, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: 960557805, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: 1860856855, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: 1402186056, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: -1464771109, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: 1341865396, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: 725794037, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: 610798074, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: 1331452177, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: 1458247875, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: 10975412, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: -1828920936, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: 207413984, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: -1395281158, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: 312354876, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: 1503701480, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: 1500215705, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: -1094665041, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: -1663139022, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: -747184157, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
- {fileID: -2127432694, guid: fab3f7d6692d84043991ec5390bcd8e1, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.7833333
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View File

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

View File

@@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: 1d09d0bd473edd744a5c98fb45f159ec
AudioImporter:
externalObjects: {}
serializedVersion: 8
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: 6104d2de1cbe86846b0e152caace38c1
AudioImporter:
externalObjects: {}
serializedVersion: 8
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: d0c663ed661474a408c5986913a2315a
AudioImporter:
externalObjects: {}
serializedVersion: 8
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: 975d8d57c80dbbd478eff9545f015f8f
AudioImporter:
externalObjects: {}
serializedVersion: 8
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,61 @@
using Core;
using Core.SaveLoad;
using Pixelplacement;
using UnityEngine;
public class SoundGenerator : MonoBehaviour
{
[SerializeField] private Sprite enterSprite;
[SerializeField] private Sprite exitSprite;
[SerializeField] private AudioClip enterSound;
[SerializeField] private AppleAudioSource audioSource;
[SerializeField] private AppleMachine soundBirdSMRef;
[SerializeField] private soundBird_CanFly soundbirdHearingCheck;
private bool playerInside = false;
private SpriteRenderer spriteRenderer;
void Awake()
{
spriteRenderer = GetComponent<SpriteRenderer>();
if (spriteRenderer != null && exitSprite != null)
{
spriteRenderer.sprite = exitSprite; // Set to default on start
}
}
private void OnTriggerEnter2D(Collider2D other)
{
if (!playerInside && other.CompareTag("Player"))
{
playerInside = true;
// Logging.Debug("Player entered SoundGenerator trigger!");
if (spriteRenderer != null && enterSprite != null)
{
spriteRenderer.sprite = enterSprite;
}
if (audioSource != null && enterSound != null)
{
audioSource.audioSource.PlayOneShot(enterSound);
}
if (soundBirdSMRef != null && soundBirdSMRef.currentState.name.ToLower().Contains("soundbird_slot") && soundbirdHearingCheck.canFly == true)
{
soundBirdSMRef.ChangeState("SoundBirdTakeoff");
}
}
}
private void OnTriggerExit2D(Collider2D other)
{
if (playerInside && other.CompareTag("Player"))
{
playerInside = false;
// Logging.Debug("Player exited SoundGenerator trigger!");
if (spriteRenderer != null && exitSprite != null)
{
spriteRenderer.sprite = exitSprite;
}
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 81336c2157cce7e46ab6ed093c7070c9

View File

@@ -0,0 +1,81 @@
using UnityEngine;
using Unity.Cinemachine;
using System.Collections;
using Core.SaveLoad;
using Pixelplacement;
public class cameraSwitcher : MonoBehaviour
{
[SerializeField] private CinemachineCamera virtualCamera;
[SerializeField] private CinemachineConfiner2D confiner2D;
[SerializeField] private float zoomOutOrthoSize = 27f;
[SerializeField] private float normalOrthoSize = 20f;
[SerializeField] private float transitionDuration = 0.5f; // Duration of the transition
[SerializeField] private soundBird_FlyingBehaviour flyingBehaviour;
[SerializeField] private soundBird_TakeOffBehaviour takeOffBehaviour; // New reference
[SerializeField] private AppleMachine birdStateMachine;
private int playerInsideCount = 0;
private Coroutine zoomCoroutine;
private void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag("Player"))
{
playerInsideCount++;
if (playerInsideCount == 1 && virtualCamera != null)
{
if (zoomCoroutine != null) StopCoroutine(zoomCoroutine);
zoomCoroutine = StartCoroutine(SmoothOrthoSize(virtualCamera, zoomOutOrthoSize, transitionDuration));
}
}
}
private void OnTriggerExit2D(Collider2D other)
{
if (!gameObject.activeInHierarchy)
return;
if (other.CompareTag("Player"))
{
playerInsideCount--;
if (playerInsideCount == 0 && virtualCamera != null)
{
if (zoomCoroutine != null) StopCoroutine(zoomCoroutine);
zoomCoroutine = StartCoroutine(SmoothOrthoSize(virtualCamera, normalOrthoSize, transitionDuration));
if (birdStateMachine.currentState != null)
{
if (birdStateMachine.currentState.name == "SoundBirdFlyAround" && flyingBehaviour != null)
{
flyingBehaviour.StartLanding();
}
else if (birdStateMachine.currentState.name == "SoundBirdTakeoff" && takeOffBehaviour != null)
{
takeOffBehaviour.StartLanding();
}
}
}
}
}
private IEnumerator SmoothOrthoSize(CinemachineCamera cam, float targetSize, float duration)
{
float startSize = cam.Lens.OrthographicSize;
float elapsed = 0f;
while (elapsed < duration)
{
elapsed += Time.deltaTime;
cam.Lens.OrthographicSize = Mathf.Lerp(startSize, targetSize, elapsed / duration);
if (confiner2D != null)
{
confiner2D.InvalidateBoundingShapeCache();
}
yield return null;
}
cam.Lens.OrthographicSize = targetSize;
if (confiner2D != null)
{
confiner2D.InvalidateBoundingShapeCache();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 165735a7ab2540c4aa3eba7ec6cd97fd

View File

@@ -0,0 +1,64 @@
using UnityEngine;
using Unity.Cinemachine;
using System.Collections;
using Pixelplacement;
public class cameraSwitcherNailBird : MonoBehaviour
{
[SerializeField] private CinemachineCamera virtualCamera;
[SerializeField] private CinemachineConfiner2D confiner2D;
[SerializeField] private float zoomOutOrthoSize = 27f;
[SerializeField] private float normalOrthoSize = 20f;
[SerializeField] private float transitionDuration = 0.5f; // Duration of the transition
private int playerInsideCount = 0;
private Coroutine zoomCoroutine;
private void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag("Player"))
{
playerInsideCount++;
if (playerInsideCount == 1 && virtualCamera != null)
{
if (zoomCoroutine != null) StopCoroutine(zoomCoroutine);
zoomCoroutine = StartCoroutine(SmoothOrthoSize(virtualCamera, zoomOutOrthoSize, transitionDuration));
}
}
}
private void OnTriggerExit2D(Collider2D other)
{
if (other.CompareTag("Player") && gameObject.activeInHierarchy)
{
playerInsideCount--;
if (playerInsideCount == 0 && virtualCamera != null)
{
if (zoomCoroutine != null) StopCoroutine(zoomCoroutine);
zoomCoroutine = StartCoroutine(SmoothOrthoSize(virtualCamera, normalOrthoSize, transitionDuration));
}
}
}
private IEnumerator SmoothOrthoSize(CinemachineCamera cam, float targetSize, float duration)
{
float startSize = cam.Lens.OrthographicSize;
float elapsed = 0f;
while (elapsed < duration)
{
elapsed += Time.deltaTime;
cam.Lens.OrthographicSize = Mathf.Lerp(startSize, targetSize, elapsed / duration);
if (confiner2D != null)
{
confiner2D.InvalidateBoundingShapeCache();
}
yield return null;
}
cam.Lens.OrthographicSize = targetSize;
if (confiner2D != null)
{
confiner2D.InvalidateBoundingShapeCache();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: d205c178cb6f7ea48b2d93690bd16ad3

View File

@@ -0,0 +1,52 @@
using Core;
using UnityEngine;
using Core.Lifecycle;
[System.Serializable]
public class SoundBirdSaveData
{
public bool canFly;
}
public class soundBird_CanFly : ManagedBehaviour
{
public bool canFly = true;
// Enable save/load participation
public override bool AutoRegisterForSave => true;
public void birdCanHear(bool canhear)
{
canFly = canhear;
}
#region Save/Load Implementation
internal override string OnSceneSaveRequested()
{
var saveData = new SoundBirdSaveData
{
canFly = this.canFly
};
return JsonUtility.ToJson(saveData);
}
internal override void OnSceneRestoreRequested(string serializedData)
{
if (string.IsNullOrEmpty(serializedData))
{
Logging.Warning($"[soundBird_CanFly] No save data to restore for {gameObject.name}");
return;
}
var saveData = JsonUtility.FromJson<SoundBirdSaveData>(serializedData);
if (saveData != null)
{
canFly = saveData.canFly;
Logging.Debug($"[soundBird_CanFly] Restored canFly state: {canFly}");
}
}
#endregion
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: b6a41511eddc628479b46152f9042034

View File

@@ -0,0 +1,83 @@
using Core.SaveLoad;
using Pixelplacement;
using Pixelplacement.TweenSystem;
using UnityEngine;
public class soundBird_FlyingBehaviour : MonoBehaviour
{
public Spline FlightSpline;
public Transform SoundBirdObject;
public float flightDuration;
public float flightDelay;
public float cooldownTime;
private AppleMachine stateMachine;
private Animator animator;
private TweenBase objectTween;
//private Coroutine cooldownCoroutine;
public Vector3 midFlightPosition;
private float lastX;
private bool facingRight = true;
void Awake()
{
stateMachine = GetComponentInParent<AppleMachine>();
animator = GetComponentInParent<Animator>();
}
private void OnEnable()
{
objectTween = Tween.Spline(FlightSpline, SoundBirdObject, 0, 1, false, flightDuration, flightDelay, Tween.EaseLinear, Tween.LoopType.Loop, HandleTweenStarted, HandleTweenFinished);
//cooldownCoroutine = StartCoroutine(CooldownTimer());
lastX = SoundBirdObject.position.x;
}
private void Update()
{
float currentX = SoundBirdObject.position.x;
if (currentX > lastX && !facingRight)
{
Flip(true);
}
else if (currentX < lastX && facingRight)
{
Flip(false);
}
lastX = currentX;
}
private void Flip(bool faceRight)
{
Vector3 scale = SoundBirdObject.localScale;
scale.x = Mathf.Abs(scale.x) * (faceRight ? 1 : -1);
SoundBirdObject.localScale = scale;
facingRight = faceRight;
}
private void OnDisable()
{
}
/*private System.Collections.IEnumerator CooldownTimer()
{
yield return new WaitForSeconds(cooldownTime);
midFlightPosition = SoundBirdObject.position;
objectTween.Cancel();
stateMachine.ChangeState("SoundBirdLanding");
}*/
public void StartLanding()
{
midFlightPosition = SoundBirdObject.position;
if (objectTween != null)
{
objectTween.Cancel();
}
stateMachine.ChangeState("SoundBirdLanding");
}
void HandleTweenStarted() { }
void HandleTweenFinished() { }
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 5edced09852126540a36c244ef726b74

View File

@@ -0,0 +1,83 @@
using Core.SaveLoad;
using Pixelplacement;
using Pixelplacement.TweenSystem;
using UnityEngine;
public class soundBird_LandingBehaviour1 : MonoBehaviour
{
public Spline FlightSpline;
public Transform SoundBirdObject;
public float flightDuration;
public float flightDelay;
public soundBird_FlyingBehaviour flyingBehaviour;
private AppleMachine stateMachine;
private Animator animator;
private TweenBase objectTween;
private float lastX;
private bool facingRight = true;
void Awake()
{
stateMachine = GetComponentInParent<AppleMachine>();
animator = GetComponentInParent<Animator>();
}
private void OnEnable()
{
Transform anchorB = transform.Find("AnchorB");
if (anchorB != null)
{
anchorB.position = flyingBehaviour.midFlightPosition;
}
objectTween = Tween.Spline(FlightSpline, SoundBirdObject, 0, 1, false, flightDuration, flightDelay, Tween.EaseOut, Tween.LoopType.None, HandleTweenStarted, HandleTweenFinished);
// Initialize lastX for flipping logic
if (SoundBirdObject != null)
{
lastX = SoundBirdObject.position.x;
}
}
void HandleTweenStarted()
{
}
void HandleTweenFinished()
{
if (SoundBirdObject != null)
{
objectTween.Cancel(); // Stop the spline tween for this object
}
//Logging.Debug("Tween finished!");
if (stateMachine != null)
{
animator.SetBool("isScared", false);
stateMachine.ChangeState(0); // Change to the desired state name
}
}
void Update()
{
if (SoundBirdObject == null) return;
float currentX = SoundBirdObject.position.x;
if (currentX > lastX && !facingRight)
{
Flip(true);
}
else if (currentX < lastX && facingRight)
{
Flip(false);
}
lastX = currentX;
}
private void Flip(bool faceRight)
{
Vector3 scale = SoundBirdObject.localScale;
scale.x = Mathf.Abs(scale.x) * (faceRight ? 1 : -1);
SoundBirdObject.localScale = scale;
facingRight = faceRight;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: c2b68b3b0ae5a3244835ceb7a495a005

View File

@@ -0,0 +1,68 @@
using Core.SaveLoad;
using Pixelplacement;
using Pixelplacement.TweenSystem;
using UnityEngine;
using UnityEngine.Audio;
public class soundBird_TakeOffBehaviour : MonoBehaviour
{
public Spline FlightSpline;
public Transform SoundBirdObject;
public float flightDuration;
public float flightDelay;
private AppleMachine stateMachine;
private Animator animator;
private TweenBase objectTween;
public soundBird_FlyingBehaviour flyingBehaviour;
public AppleAudioSource audioSource;
void Awake()
{
stateMachine = GetComponentInParent<AppleMachine>();
animator = GetComponentInParent<Animator>();
}
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
//initiateTweenSpline();
}
private void OnEnable()
{
animator.SetBool("isScared", true);
objectTween = Tween.Spline(FlightSpline, SoundBirdObject, 0, 1, false, flightDuration, flightDelay, Tween.EaseIn, Tween.LoopType.None, HandleTweenStarted, HandleTweenFinished);
audioSource.Play(0);
}
void HandleTweenStarted()
{
}
void HandleTweenFinished()
{
if (SoundBirdObject != null)
{
objectTween.Cancel(); // Stop the spline tween for this object
}
//Logging.Debug("Tween finished!");
if (stateMachine != null)
{
stateMachine.ChangeState("SoundBirdFlyAround"); // Change to the desired state name
}
}
// Added for cameraSwitcher
public void StartLanding()
{
if (objectTween != null)
{
objectTween.Cancel();
}
if (stateMachine != null)
{
flyingBehaviour.midFlightPosition = SoundBirdObject.position;
stateMachine.ChangeState("SoundBirdLanding");
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 65d587e5278083741b823c66906ddf2c

View File

@@ -0,0 +1,112 @@
using UnityEngine;
using System.Collections;
using TMPro;
using Pixelplacement;
namespace TMPro.Examples
{
[RequireComponent(typeof(TMP_Text))]
public class WarpTextExample : MonoBehaviour
{
private TMP_Text m_TextComponent;
[Header("Spline Reference")]
public Spline spline; // Assign this in the inspector
[Header("Warp Settings")]
public float AngleMultiplier = 1.0f;
public float NormalOffset = 20.0f; // Distance above the spline
void Awake()
{
m_TextComponent = GetComponent<TMP_Text>();
}
void Start()
{
if (spline == null)
{
Debug.LogError("Spline reference not set on WarpTextExample!");
enabled = false;
return;
}
StartCoroutine(WarpText());
}
IEnumerator WarpText()
{
Vector3[] vertices;
Matrix4x4 matrix;
m_TextComponent.havePropertiesChanged = true; // Force update
while (true)
{
m_TextComponent.ForceMeshUpdate();
TMP_TextInfo textInfo = m_TextComponent.textInfo;
int characterCount = textInfo.characterCount;
if (characterCount == 0)
{
yield return null;
continue;
}
float boundsMinX = m_TextComponent.bounds.min.x;
float boundsMaxX = m_TextComponent.bounds.max.x;
for (int i = 0; i < characterCount; i++)
{
if (!textInfo.characterInfo[i].isVisible)
continue;
int vertexIndex = textInfo.characterInfo[i].vertexIndex;
int materialIndex = textInfo.characterInfo[i].materialReferenceIndex;
vertices = textInfo.meshInfo[materialIndex].vertices;
// Compute the baseline mid point for each character
Vector3 offsetToMidBaseline = new Vector2(
(vertices[vertexIndex + 0].x + vertices[vertexIndex + 2].x) / 2,
textInfo.characterInfo[i].baseLine);
// Remove the offset so we can warp around the origin
vertices[vertexIndex + 0] += -offsetToMidBaseline;
vertices[vertexIndex + 1] += -offsetToMidBaseline;
vertices[vertexIndex + 2] += -offsetToMidBaseline;
vertices[vertexIndex + 3] += -offsetToMidBaseline;
// Normalized position along the text bounds
float t = (offsetToMidBaseline.x - boundsMinX) / (boundsMaxX - boundsMinX);
t = Mathf.Clamp01(t);
Vector3 localSplinePos = spline.GetPosition(t);
Vector3 localSplineTangent = spline.GetDirection(t, true).normalized;
// Calculate 2D normal (perpendicular to tangent)
Vector3 normal2D = new Vector3(-localSplineTangent.y, localSplineTangent.x, 0).normalized;
Vector3 offsetPos = localSplinePos + normal2D * NormalOffset;
float angle = Mathf.Atan2(localSplineTangent.y, localSplineTangent.x) * Mathf.Rad2Deg * AngleMultiplier;
matrix = Matrix4x4.TRS(offsetPos, Quaternion.Euler(0, 0, angle), Vector3.one);
vertices[vertexIndex + 0] = matrix.MultiplyPoint3x4(vertices[vertexIndex + 0]);
vertices[vertexIndex + 1] = matrix.MultiplyPoint3x4(vertices[vertexIndex + 1]);
vertices[vertexIndex + 2] = matrix.MultiplyPoint3x4(vertices[vertexIndex + 2]);
vertices[vertexIndex + 3] = matrix.MultiplyPoint3x4(vertices[vertexIndex + 3]);
vertices[vertexIndex + 0] += offsetToMidBaseline;
vertices[vertexIndex + 1] += offsetToMidBaseline;
vertices[vertexIndex + 2] += offsetToMidBaseline;
vertices[vertexIndex + 3] += offsetToMidBaseline;
}
m_TextComponent.UpdateVertexData();
yield return new WaitForSeconds(0.025f);
}
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 18d8b53f75e30224ea663034b2650d37

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1cf1604900ae8224da647627ed56fa65
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,42 @@
using System;
using System.Diagnostics;
using Pixelplacement;
using Pixelplacement.TweenSystem;
using UnityEngine;
public class WolterStateMachine : MonoBehaviour
{
public Spline jumpSpline;
public Transform wolterGameObject;
public float jumpDuration;
public float jumpDelay;
private Animator animator;
private TweenBase jumpTween;
private void Awake()
{
animator = GetComponentInChildren<Animator>();
}
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
jumpTween = Tween.Spline(jumpSpline, wolterGameObject, 1, 0, false, jumpDuration, jumpDelay, Tween.EaseInOut, Tween.LoopType.None, HandleJumpStarted, HandleJumpFinished);
}
void HandleJumpStarted()
{
}
void HandleJumpFinished()
{
if (animator != null)
{
animator.SetBool("Landed", true);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 47b7b0e9f0b06ad45b7e92c25226d21e