Compare commits
20 Commits
abffb5c558
...
integratio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
793da5e568 | ||
|
|
15414f9414 | ||
|
|
8cffe0b161 | ||
|
|
0057ae9fa3 | ||
|
|
cec661586e | ||
|
|
a580a5f35a | ||
|
|
c0df46f9f8 | ||
|
|
9a12a79698 | ||
|
|
d62516f0cb | ||
|
|
445e36975d | ||
|
|
ef96d80d51 | ||
|
|
afd3bc3863 | ||
| 9b590ca6ec | |||
|
|
15b8146815 | ||
|
|
c5b8561b73 | ||
| fd220de298 | |||
|
|
6c76759057 | ||
|
|
e1ff13db30 | ||
|
|
3a40d1a151 | ||
|
|
0ef25f265c |
@@ -1,5 +1,30 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1101 &-8622141701191891965
|
||||
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: NoGuess
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 5993408738867988234}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &-7993130233709895848
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
@@ -17,7 +42,7 @@ AnimatorStateTransition:
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionDuration: 0
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.9594595
|
||||
m_HasExitTime: 0
|
||||
@@ -37,6 +62,7 @@ AnimatorState:
|
||||
m_CycleOffset: 0
|
||||
m_Transitions:
|
||||
- {fileID: -169883073761575190}
|
||||
- {fileID: -953515106580102534}
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
@@ -52,6 +78,31 @@ AnimatorState:
|
||||
m_MirrorParameter:
|
||||
m_CycleOffsetParameter:
|
||||
m_TimeParameter:
|
||||
--- !u!1101 &-953515106580102534
|
||||
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: RightGuess
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: -92837137932308198}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.87903225
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &-169883073761575190
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
@@ -59,14 +110,17 @@ AnimatorStateTransition:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions: []
|
||||
m_Conditions:
|
||||
- m_ConditionMode: 1
|
||||
m_ConditionEvent: NoGuess
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 5993408738867988234}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionDuration: 0
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.8076923
|
||||
m_HasExitTime: 1
|
||||
@@ -84,7 +138,9 @@ AnimatorState:
|
||||
m_Name: ANIM_BirdEyes_Correct
|
||||
m_Speed: 1
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
m_Transitions:
|
||||
- {fileID: -8622141701191891965}
|
||||
- {fileID: 1249646924704393990}
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
@@ -121,6 +177,12 @@ AnimatorController:
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 9100000}
|
||||
- m_Name: NoGuess
|
||||
m_Type: 9
|
||||
m_DefaultFloat: 0
|
||||
m_DefaultInt: 0
|
||||
m_DefaultBool: 0
|
||||
m_Controller: {fileID: 9100000}
|
||||
m_AnimatorLayers:
|
||||
- serializedVersion: 5
|
||||
m_Name: Base Layer
|
||||
@@ -134,6 +196,31 @@ AnimatorController:
|
||||
m_IKPass: 0
|
||||
m_SyncedLayerAffectsTiming: 0
|
||||
m_Controller: {fileID: 9100000}
|
||||
--- !u!1101 &1249646924704393990
|
||||
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: WrongGuess
|
||||
m_EventTreshold: 0
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: -2838832837941805979}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1101 &4511680777278260622
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
@@ -151,7 +238,7 @@ AnimatorStateTransition:
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0.25
|
||||
m_TransitionDuration: 0
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0.9594595
|
||||
m_HasExitTime: 0
|
||||
@@ -201,10 +288,10 @@ AnimatorStateMachine:
|
||||
m_Position: {x: 40, y: 350, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -2838832837941805979}
|
||||
m_Position: {x: -70, y: 450, z: 0}
|
||||
m_Position: {x: -100, y: 450, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: -92837137932308198}
|
||||
m_Position: {x: 150, y: 450, z: 0}
|
||||
m_Position: {x: 200, y: 450, z: 0}
|
||||
m_ChildStateMachines: []
|
||||
m_AnyStateTransitions: []
|
||||
m_EntryTransitions: []
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 84e39aac66cf4a10a89abc01b04b13af, type: 3}
|
||||
m_Name: InteractWithFootballBird
|
||||
m_EditorClassIdentifier:
|
||||
stepId: InteractFootballBird
|
||||
displayName: Interact Football Bird
|
||||
description: Take a picture of the Football bird
|
||||
icon: {fileID: 0}
|
||||
unlocks: []
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0df54e69020c39e44b3b486cd6ac475a
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -16,4 +16,5 @@ MonoBehaviour:
|
||||
displayName: Football in luring spot A
|
||||
description: Place the Football into luring spot A
|
||||
icon: {fileID: 0}
|
||||
unlocks: []
|
||||
unlocks:
|
||||
- {fileID: 11400000, guid: 0df54e69020c39e44b3b486cd6ac475a, type: 2}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 84e39aac66cf4a10a89abc01b04b13af, type: 3}
|
||||
m_Name: InteractWithHammerBird
|
||||
m_EditorClassIdentifier:
|
||||
stepId: InteractHammerBird
|
||||
displayName: Interact With HammerBird
|
||||
description: TAke picture of the HammerBird
|
||||
icon: {fileID: 0}
|
||||
unlocks: []
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 829fc7c8046e0844f93bf810dc1f0ebd
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -16,4 +16,5 @@ MonoBehaviour:
|
||||
displayName: Nails In Lure C
|
||||
description: Place the Nails in the Luring Spot C
|
||||
icon: {fileID: 0}
|
||||
unlocks: []
|
||||
unlocks:
|
||||
- {fileID: 11400000, guid: 829fc7c8046e0844f93bf810dc1f0ebd, type: 2}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using UnityEditor;
|
||||
using Interactions;
|
||||
using PuzzleS;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Editor
|
||||
@@ -13,6 +15,9 @@ namespace Editor
|
||||
private string _pickupSoFolderPath = "Assets/Data/Items";
|
||||
private string _puzzleSoFolderPath = "Assets/Data/Puzzles";
|
||||
|
||||
private enum ItemType { None, Pickup, ItemSlot }
|
||||
private ItemType _itemType = ItemType.None;
|
||||
|
||||
[MenuItem("Tools/Item Prefab Editor")]
|
||||
public static void ShowWindow()
|
||||
{
|
||||
@@ -53,39 +58,28 @@ namespace Editor
|
||||
|
||||
EditorGUILayout.LabelField("Editing: ", _selectedGameObject.name, EditorStyles.boldLabel);
|
||||
EditorGUILayout.Space();
|
||||
// Pickup
|
||||
|
||||
// Determine current type
|
||||
bool hasPickup = _selectedGameObject.GetComponent<Pickup>() != null;
|
||||
bool addPickup = EditorGUILayout.Toggle("Pickup", hasPickup);
|
||||
if (addPickup && !hasPickup)
|
||||
{
|
||||
PrefabEditorUtility.AddOrGetComponent<Pickup>(_selectedGameObject);
|
||||
}
|
||||
else if (!addPickup && hasPickup)
|
||||
bool hasSlot = _selectedGameObject.GetComponent<ItemSlot>() != null;
|
||||
if (hasSlot) _itemType = ItemType.ItemSlot;
|
||||
else if (hasPickup) _itemType = ItemType.Pickup;
|
||||
else _itemType = ItemType.None;
|
||||
|
||||
// Item type selection
|
||||
var newType = (ItemType)EditorGUILayout.EnumPopup("Item Type", _itemType);
|
||||
if (newType != _itemType)
|
||||
{
|
||||
// Remove both, then add selected
|
||||
PrefabEditorUtility.RemoveComponent<Pickup>(_selectedGameObject);
|
||||
PrefabEditorUtility.RemoveComponent<ItemSlot>(_selectedGameObject);
|
||||
if (newType == ItemType.Pickup)
|
||||
PrefabEditorUtility.AddOrGetComponent<Pickup>(_selectedGameObject);
|
||||
else if (newType == ItemType.ItemSlot)
|
||||
PrefabEditorUtility.AddOrGetComponent<ItemSlot>(_selectedGameObject);
|
||||
_itemType = newType;
|
||||
}
|
||||
// CombineWithBehavior
|
||||
bool hasCombine = _selectedGameObject.GetComponent<CombineWithBehavior>() != null;
|
||||
bool addCombine = EditorGUILayout.Toggle("CombineWithBehavior", hasCombine);
|
||||
if (addCombine && !hasCombine)
|
||||
{
|
||||
PrefabEditorUtility.AddOrGetComponent<CombineWithBehavior>(_selectedGameObject);
|
||||
}
|
||||
else if (!addCombine && hasCombine)
|
||||
{
|
||||
PrefabEditorUtility.RemoveComponent<CombineWithBehavior>(_selectedGameObject);
|
||||
}
|
||||
// SlotItemBehavior
|
||||
bool hasSlot = _selectedGameObject.GetComponent<SlotItemBehavior>() != null;
|
||||
bool addSlot = EditorGUILayout.Toggle("SlotItemBehavior", hasSlot);
|
||||
if (addSlot && !hasSlot)
|
||||
{
|
||||
PrefabEditorUtility.AddOrGetComponent<SlotItemBehavior>(_selectedGameObject);
|
||||
}
|
||||
else if (!addSlot && hasSlot)
|
||||
{
|
||||
PrefabEditorUtility.RemoveComponent<SlotItemBehavior>(_selectedGameObject);
|
||||
}
|
||||
|
||||
// ObjectiveStepBehaviour
|
||||
bool hasObjective = _selectedGameObject.GetComponent<ObjectiveStepBehaviour>() != null;
|
||||
bool addObjective = EditorGUILayout.Toggle("ObjectiveStepBehaviour", hasObjective);
|
||||
@@ -97,8 +91,9 @@ namespace Editor
|
||||
{
|
||||
PrefabEditorUtility.RemoveComponent<ObjectiveStepBehaviour>(_selectedGameObject);
|
||||
}
|
||||
// Pickup Data
|
||||
if (addPickup)
|
||||
|
||||
// Pickup Data (for Pickup or ItemSlot)
|
||||
if (_itemType == ItemType.Pickup || _itemType == ItemType.ItemSlot)
|
||||
{
|
||||
var pickup = _selectedGameObject.GetComponent<Pickup>();
|
||||
_pickupData = pickup.itemData;
|
||||
@@ -122,6 +117,7 @@ namespace Editor
|
||||
pickup.itemData = _pickupData;
|
||||
}
|
||||
}
|
||||
|
||||
// Objective Data
|
||||
if (addObjective)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using System.IO;
|
||||
using Interactions;
|
||||
using PuzzleS;
|
||||
|
||||
namespace Editor
|
||||
{
|
||||
@@ -10,15 +12,17 @@ namespace Editor
|
||||
private string _saveFolderPath = "Assets/Prefabs/Items";
|
||||
private string _pickupSoFolderPath = "Assets/Data/Items";
|
||||
private string _puzzleSoFolderPath = "Assets/Data/Puzzles";
|
||||
private bool _addPickup;
|
||||
private bool _addCombineWith;
|
||||
private bool _addSlot;
|
||||
private bool _addObjective;
|
||||
|
||||
private PickupItemData _pickupData;
|
||||
private PuzzleStepSO _objectiveData;
|
||||
private UnityEditor.Editor _soEditor;
|
||||
|
||||
private enum ItemType { None, Pickup, ItemSlot }
|
||||
private ItemType _itemType = ItemType.None;
|
||||
|
||||
private bool _createNext = false;
|
||||
|
||||
[MenuItem("Tools/Prefab Creator")]
|
||||
public static void ShowWindow()
|
||||
{
|
||||
@@ -48,13 +52,19 @@ namespace Editor
|
||||
EditorGUILayout.EndHorizontal();
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField("Add Components:", EditorStyles.boldLabel);
|
||||
_addPickup = EditorGUILayout.Toggle("Pickup", _addPickup);
|
||||
_addCombineWith = EditorGUILayout.Toggle("CombineWithBehavior", _addCombineWith);
|
||||
_addSlot = EditorGUILayout.Toggle("SlotItemBehavior", _addSlot);
|
||||
_addObjective = EditorGUILayout.Toggle("ObjectiveStepBehaviour", _addObjective);
|
||||
|
||||
// Item type selection
|
||||
var newType = (ItemType)EditorGUILayout.EnumPopup("Item Type", _itemType);
|
||||
if (newType != _itemType)
|
||||
{
|
||||
_itemType = newType;
|
||||
}
|
||||
bool addObjective = EditorGUILayout.Toggle("ObjectiveStepBehaviour", _addObjective);
|
||||
_addObjective = addObjective;
|
||||
EditorGUILayout.Space();
|
||||
|
||||
if (_addPickup)
|
||||
// Pickup Data (for Pickup or ItemSlot)
|
||||
if (_itemType == ItemType.Pickup || _itemType == ItemType.ItemSlot)
|
||||
{
|
||||
EditorGUILayout.LabelField("Pickup Data:", EditorStyles.boldLabel);
|
||||
_pickupData = (PickupItemData)EditorGUILayout.ObjectField("PickupItemData", _pickupData, typeof(PickupItemData), false);
|
||||
@@ -76,6 +86,7 @@ namespace Editor
|
||||
PrefabEditorUtility.DrawScriptableObjectEditor(ref _soEditor, _pickupData);
|
||||
}
|
||||
}
|
||||
// Objective Data
|
||||
if (_addObjective)
|
||||
{
|
||||
EditorGUILayout.LabelField("Objective Data:", EditorStyles.boldLabel);
|
||||
@@ -99,12 +110,15 @@ namespace Editor
|
||||
}
|
||||
}
|
||||
GUILayout.FlexibleSpace();
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
GUI.enabled = !string.IsNullOrEmpty(_prefabName) && !string.IsNullOrEmpty(_saveFolderPath);
|
||||
if (GUILayout.Button("Create Prefab"))
|
||||
if (GUILayout.Button("Create Prefab", GUILayout.Height(28)))
|
||||
{
|
||||
CreatePrefab();
|
||||
}
|
||||
_createNext = GUILayout.Toggle(_createNext, "Create Next", GUILayout.Width(100), GUILayout.Height(28));
|
||||
GUI.enabled = true;
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
private void CreatePrefab()
|
||||
@@ -116,18 +130,15 @@ namespace Editor
|
||||
if (interactableLayer != -1)
|
||||
go.layer = interactableLayer;
|
||||
go.AddComponent<SpriteRenderer>();
|
||||
if (_addPickup)
|
||||
if (_itemType == ItemType.Pickup)
|
||||
{
|
||||
var pickup = go.AddComponent<Pickup>();
|
||||
pickup.itemData = _pickupData;
|
||||
}
|
||||
if (_addCombineWith)
|
||||
else if (_itemType == ItemType.ItemSlot)
|
||||
{
|
||||
go.AddComponent<CombineWithBehavior>();
|
||||
}
|
||||
if (_addSlot)
|
||||
{
|
||||
go.AddComponent<SlotItemBehavior>();
|
||||
var slot = go.AddComponent<ItemSlot>();
|
||||
slot.itemData = _pickupData;
|
||||
}
|
||||
if (_addObjective)
|
||||
{
|
||||
@@ -135,10 +146,23 @@ namespace Editor
|
||||
obj.stepData = _objectiveData;
|
||||
}
|
||||
string prefabPath = Path.Combine(_saveFolderPath, _prefabName + ".prefab").Replace("\\", "/");
|
||||
PrefabUtility.SaveAsPrefabAsset(go, prefabPath);
|
||||
var prefab = PrefabUtility.SaveAsPrefabAsset(go, prefabPath);
|
||||
DestroyImmediate(go);
|
||||
AssetDatabase.Refresh();
|
||||
Selection.activeObject = prefab;
|
||||
EditorGUIUtility.PingObject(prefab);
|
||||
EditorUtility.DisplayDialog("Prefab Created", $"Prefab saved to {prefabPath}", "OK");
|
||||
if (_createNext)
|
||||
{
|
||||
_prefabName = "NewPrefab";
|
||||
_pickupData = null;
|
||||
_objectiveData = null;
|
||||
_itemType = ItemType.None;
|
||||
_addObjective = false;
|
||||
_soEditor = null;
|
||||
GUI.FocusControl(null);
|
||||
Repaint();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
123
Assets/Editor/SceneBrowserWindow.cs
Normal file
123
Assets/Editor/SceneBrowserWindow.cs
Normal file
@@ -0,0 +1,123 @@
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
public class SceneBrowserWindow : EditorWindow
|
||||
{
|
||||
private class SceneInfo
|
||||
{
|
||||
public string path;
|
||||
public string name;
|
||||
public string folder;
|
||||
public bool inBuildSettings;
|
||||
}
|
||||
|
||||
private Vector2 _scroll;
|
||||
private List<SceneInfo> _scenes = new List<SceneInfo>();
|
||||
private Dictionary<string, List<SceneInfo>> _scenesByFolder = new Dictionary<string, List<SceneInfo>>();
|
||||
|
||||
[MenuItem("Tools/Scene Browser")]
|
||||
public static void ShowWindow()
|
||||
{
|
||||
var window = GetWindow<SceneBrowserWindow>(false, "Scene Browser", true);
|
||||
window.RefreshScenes();
|
||||
}
|
||||
|
||||
private void OnFocus()
|
||||
{
|
||||
RefreshScenes();
|
||||
}
|
||||
|
||||
private void RefreshScenes()
|
||||
{
|
||||
_scenes.Clear();
|
||||
_scenesByFolder.Clear();
|
||||
string[] guids = AssetDatabase.FindAssets("t:Scene", new[] { "Assets/Scenes" });
|
||||
var buildScenes = EditorBuildSettings.scenes.Select(s => s.path).ToHashSet();
|
||||
foreach (var guid in guids)
|
||||
{
|
||||
string path = AssetDatabase.GUIDToAssetPath(guid);
|
||||
string name = Path.GetFileNameWithoutExtension(path);
|
||||
string folder = Path.GetDirectoryName(path).Replace("\\", "/");
|
||||
if (folder == "Assets/Scenes") folder = "";
|
||||
var info = new SceneInfo
|
||||
{
|
||||
path = path,
|
||||
name = name,
|
||||
folder = folder,
|
||||
inBuildSettings = buildScenes.Contains(path)
|
||||
};
|
||||
_scenes.Add(info);
|
||||
if (!_scenesByFolder.ContainsKey(folder))
|
||||
_scenesByFolder[folder] = new List<SceneInfo>();
|
||||
_scenesByFolder[folder].Add(info);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
if (GUILayout.Button("Refresh"))
|
||||
RefreshScenes();
|
||||
_scroll = EditorGUILayout.BeginScrollView(_scroll);
|
||||
// Top-level scenes
|
||||
if (_scenesByFolder.ContainsKey(""))
|
||||
{
|
||||
foreach (var scene in _scenesByFolder[""])
|
||||
DrawSceneRow(scene);
|
||||
EditorGUILayout.Space();
|
||||
}
|
||||
// Subfolders
|
||||
foreach (var kvp in _scenesByFolder)
|
||||
{
|
||||
if (string.IsNullOrEmpty(kvp.Key)) continue;
|
||||
EditorGUILayout.LabelField(kvp.Key, EditorStyles.boldLabel);
|
||||
foreach (var scene in kvp.Value)
|
||||
DrawSceneRow(scene);
|
||||
EditorGUILayout.Space();
|
||||
}
|
||||
EditorGUILayout.EndScrollView();
|
||||
}
|
||||
|
||||
private void DrawSceneRow(SceneInfo scene)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUILayout.LabelField(scene.name, GUILayout.Width(180));
|
||||
if (GUILayout.Button("Open", GUILayout.Width(50)))
|
||||
{
|
||||
if (EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo())
|
||||
EditorSceneManager.OpenScene(scene.path);
|
||||
}
|
||||
if (GUILayout.Button("Locate", GUILayout.Width(50)))
|
||||
{
|
||||
var obj = AssetDatabase.LoadAssetAtPath<SceneAsset>(scene.path);
|
||||
EditorGUIUtility.PingObject(obj);
|
||||
}
|
||||
bool inBuild = scene.inBuildSettings;
|
||||
bool newInBuild = GUILayout.Toggle(inBuild, "In Build", GUILayout.Width(70));
|
||||
if (newInBuild != inBuild)
|
||||
{
|
||||
ToggleSceneInBuildSettings(scene.path, newInBuild);
|
||||
scene.inBuildSettings = newInBuild;
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
private void ToggleSceneInBuildSettings(string path, bool add)
|
||||
{
|
||||
var scenes = EditorBuildSettings.scenes.ToList();
|
||||
if (add)
|
||||
{
|
||||
if (!scenes.Any(s => s.path == path))
|
||||
scenes.Add(new EditorBuildSettingsScene(path, true));
|
||||
}
|
||||
else
|
||||
{
|
||||
scenes = scenes.Where(s => s.path != path).ToList();
|
||||
}
|
||||
EditorBuildSettings.scenes = scenes.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
3
Assets/Editor/SceneBrowserWindow.cs.meta
Normal file
3
Assets/Editor/SceneBrowserWindow.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bda5b0c96582450e94a8b332f86c726d
|
||||
timeCreated: 1757596929
|
||||
@@ -3,6 +3,8 @@ using UnityEngine;
|
||||
using UnityEditor.SceneManagement;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Interactions;
|
||||
using PuzzleS;
|
||||
|
||||
public class SceneObjectLocatorWindow : EditorWindow
|
||||
{
|
||||
@@ -43,12 +45,10 @@ public class SceneObjectLocatorWindow : EditorWindow
|
||||
foreach (var pickup in pickups)
|
||||
{
|
||||
var go = pickup.gameObject;
|
||||
bool hasCombine = go.GetComponent<CombineWithBehavior>() != null;
|
||||
bool hasSlot = go.GetComponent<SlotItemBehavior>() != null;
|
||||
bool hasSlot = go.GetComponent<ItemSlot>() != null;
|
||||
pickupInfos.Add(new PickupInfo
|
||||
{
|
||||
pickup = pickup,
|
||||
hasCombine = hasCombine,
|
||||
hasSlot = hasSlot
|
||||
});
|
||||
}
|
||||
|
||||
3
Assets/External/Pixelplacement/PixelplacementAssembly.asmdef
vendored
Normal file
3
Assets/External/Pixelplacement/PixelplacementAssembly.asmdef
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"name": "PixelplacementAssembly"
|
||||
}
|
||||
7
Assets/External/Pixelplacement/PixelplacementAssembly.asmdef.meta
vendored
Normal file
7
Assets/External/Pixelplacement/PixelplacementAssembly.asmdef.meta
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: db4a9769b2b9c5a4788bcd189eea1f0b
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
18
Assets/External/Pixelplacement/Surge/Editor/PixelplacementEditor.asmdef
vendored
Normal file
18
Assets/External/Pixelplacement/Surge/Editor/PixelplacementEditor.asmdef
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "PixelplacementEditor",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:db4a9769b2b9c5a4788bcd189eea1f0b"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
7
Assets/External/Pixelplacement/Surge/Editor/PixelplacementEditor.asmdef.meta
vendored
Normal file
7
Assets/External/Pixelplacement/Surge/Editor/PixelplacementEditor.asmdef.meta
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0547315a6b16c1a48bf1db2b83869a5a
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,9 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 274948d5adb104b28a8d42ee1308cee0
|
||||
folderAsset: yes
|
||||
timeCreated: 1500598980
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,9 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f588a5a76c3094128955cddb5540e896
|
||||
folderAsset: yes
|
||||
timeCreated: 1500598980
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -119,7 +119,7 @@ MonoBehaviour:
|
||||
traversableTags: -1
|
||||
tagPenalties: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
graphMask:
|
||||
value: -1
|
||||
value: 1
|
||||
--- !u!114 &7393789300602426170
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -13,6 +13,7 @@ GameObject:
|
||||
- component: {fileID: 3435632802124758411}
|
||||
- component: {fileID: 8947209170748834035}
|
||||
- component: {fileID: 7852204877518954380}
|
||||
- component: {fileID: 1621671461027776358}
|
||||
m_Layer: 8
|
||||
m_Name: PulverCharacter
|
||||
m_TagString: Pulver
|
||||
@@ -86,16 +87,10 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: f82afe7b57bd4e0b9f51a1cca06765f1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
followDistance: 3
|
||||
debugDrawTarget: 1
|
||||
followUpdateInterval: 0.1
|
||||
manualMoveSmooth: 5
|
||||
acceleration: 10
|
||||
deceleration: 12
|
||||
thresholdFar: 7
|
||||
thresholdNear: 5
|
||||
stopThreshold: 0.5
|
||||
currentlyHeldItem: {fileID: 0}
|
||||
manualMoveSmooth: 100
|
||||
justCombined: 0
|
||||
heldObjectRenderer: {fileID: 2099200424669714683}
|
||||
--- !u!114 &8947209170748834035
|
||||
MonoBehaviour:
|
||||
@@ -124,7 +119,7 @@ MonoBehaviour:
|
||||
traversableTags: -1
|
||||
tagPenalties: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
graphMask:
|
||||
value: -1
|
||||
value: 2
|
||||
--- !u!114 &7852204877518954380
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -142,7 +137,7 @@ MonoBehaviour:
|
||||
height: 2
|
||||
canMove: 1
|
||||
maxSpeed: 15
|
||||
gravity: {x: NaN, y: NaN, z: NaN}
|
||||
gravity: {x: 0, y: 0, z: 0}
|
||||
groundMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
@@ -158,7 +153,7 @@ MonoBehaviour:
|
||||
maximumInterval: 2
|
||||
visualizeSensitivity: 0
|
||||
targetCompatibility: {fileID: 0}
|
||||
maxAcceleration: -2.5
|
||||
maxAcceleration: 10000
|
||||
rotationSpeed: 360
|
||||
slowdownDistance: 3
|
||||
pickNextWaypointDist: 2
|
||||
@@ -167,6 +162,28 @@ MonoBehaviour:
|
||||
slowWhenNotFacingTarget: 1
|
||||
whenCloseToDestination: 0
|
||||
constrainInsideGraph: 0
|
||||
--- !u!114 &1621671461027776358
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1102400833121127473}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: cb6a34d769a1e4ac7b0b30e433aa443c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 1
|
||||
smoothType: 0
|
||||
subdivisions: 2
|
||||
iterations: 2
|
||||
strength: 0.5
|
||||
uniformLength: 1
|
||||
maxSegmentLength: 2
|
||||
bezierTangentLength: 0.4
|
||||
offset: 0.2
|
||||
factor: 0.1
|
||||
--- !u!1 &5934518940303293264
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -262,6 +279,10 @@ PrefabInstance:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 2264394306674147778}
|
||||
m_Modifications:
|
||||
- target: {fileID: 566650525959955209, guid: e3b439d398cffdd4194cdb360a46c5a6, type: 3}
|
||||
propertyPath: m_SpriteSortPoint
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1102468210854536367, guid: e3b439d398cffdd4194cdb360a46c5a6, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: Pulver
|
||||
|
||||
@@ -11,7 +11,7 @@ GameObject:
|
||||
- component: {fileID: 7442421452951837692}
|
||||
- component: {fileID: 4110666412151536905}
|
||||
m_Layer: 0
|
||||
m_Name: SlottedItem
|
||||
m_Name: SlottedItemA
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
@@ -87,6 +87,116 @@ SpriteRenderer:
|
||||
m_WasSpriteAssigned: 0
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!1 &3617455498829757156
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4388395494483065101}
|
||||
- component: {fileID: 4237100461469772044}
|
||||
- component: {fileID: 2472695135799577718}
|
||||
m_Layer: 0
|
||||
m_Name: FootballBird
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &4388395494483065101
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3617455498829757156}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 2.8479085, y: -0.13594438, z: 0}
|
||||
m_LocalScale: {x: 0.5, y: 0.50000006, z: 0.50000006}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1924342418841580}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &4237100461469772044
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3617455498829757156}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, 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: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 0
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!95 &2472695135799577718
|
||||
Animator:
|
||||
serializedVersion: 7
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3617455498829757156}
|
||||
m_Enabled: 1
|
||||
m_Avatar: {fileID: 0}
|
||||
m_Controller: {fileID: 0}
|
||||
m_CullingMode: 0
|
||||
m_UpdateMode: 0
|
||||
m_ApplyRootMotion: 0
|
||||
m_LinearVelocityBlending: 0
|
||||
m_StabilizeFeet: 0
|
||||
m_AnimatePhysics: 0
|
||||
m_WarningMessage:
|
||||
m_HasTransformHierarchy: 1
|
||||
m_AllowConstantClipSamplingOptimization: 1
|
||||
m_KeepAnimatorStateOnDisable: 0
|
||||
m_WriteDefaultValuesOnDisable: 0
|
||||
--- !u!1 &7249528695393012044
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -98,9 +208,9 @@ GameObject:
|
||||
- component: {fileID: 2045549771447434109}
|
||||
- component: {fileID: 6258593095132504700}
|
||||
- component: {fileID: 5475802662781903683}
|
||||
- component: {fileID: 3906996712691464207}
|
||||
- component: {fileID: 8818689886719637838}
|
||||
- component: {fileID: 8578055200319571631}
|
||||
- component: {fileID: 3487003259787903584}
|
||||
m_Layer: 10
|
||||
m_Name: LureSpotA
|
||||
m_TagString: Untagged
|
||||
@@ -226,20 +336,6 @@ BoxCollider2D:
|
||||
m_AutoTiling: 0
|
||||
m_Size: {x: 5.75, y: 2.78}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!114 &3906996712691464207
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7249528695393012044}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 7846448751da4bdbaaa5cb87890dca42, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
itemData: {fileID: 11400000, guid: aaf36cd26cf74334e9c7db6c1b03b3fb, type: 2}
|
||||
iconRenderer: {fileID: 6258593095132504700}
|
||||
--- !u!114 &8818689886719637838
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -252,6 +348,21 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 73d6494a73174ffabc6a7d3089d51e73, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
isOneTime: 0
|
||||
cooldown: -1
|
||||
characterToInteract: 1
|
||||
interactionStarted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
interactionInterrupted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
characterArrived:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
interactionComplete:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &8578055200319571631
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -264,14 +375,74 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: ec1a2e6e32f746c4990c579e13b79104, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
OnSuccess:
|
||||
itemData: {fileID: 11400000, guid: aaf36cd26cf74334e9c7db6c1b03b3fb, type: 2}
|
||||
iconRenderer: {fileID: 6258593095132504700}
|
||||
onItemSlotted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
OnFailure:
|
||||
onItemSlotRemoved:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 7602419655779381936}
|
||||
m_TargetAssemblyTypeName: BirdEyesBehavior, Assembly-CSharp
|
||||
m_MethodName: NoItem
|
||||
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
|
||||
onCorrectItemSlotted:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 7602419655779381936}
|
||||
m_TargetAssemblyTypeName: BirdEyesBehavior, Assembly-CSharp
|
||||
m_MethodName: CorrectItem
|
||||
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
|
||||
onIncorrectItemSlotted:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 7602419655779381936}
|
||||
m_TargetAssemblyTypeName: BirdEyesBehavior, Assembly-CSharp
|
||||
m_MethodName: IncorrectItem
|
||||
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
|
||||
onForbiddenItemSlotted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
currentlySlottedItem: {fileID: 0}
|
||||
slottedItemRenderer: {fileID: 0}
|
||||
slottedItemRenderer: {fileID: 4110666412151536905}
|
||||
--- !u!114 &3487003259787903584
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7249528695393012044}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 2226aecbed4b1f143a5a5c5be4236957, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
playerToPlaceDistance: 40
|
||||
birdEyes: {fileID: 7602419655779381936}
|
||||
--- !u!1001 &7700829900874995671
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -282,27 +453,27 @@ PrefabInstance:
|
||||
m_Modifications:
|
||||
- target: {fileID: 1370564349707122423, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: BirdEyes
|
||||
value: BirdEyesA
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2326086342663433936, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 0.5
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2326086342663433936, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 0.5
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2326086342663433936, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
propertyPath: m_LocalScale.z
|
||||
value: 0.5
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2326086342663433936, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 5.47
|
||||
value: 6.25
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2326086342663433936, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 8.65
|
||||
value: 8.87
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2326086342663433936, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
@@ -336,17 +507,78 @@ PrefabInstance:
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2326086342663433936, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
propertyPath: m_ConstrainProportionsScale
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3013218424693156287, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
propertyPath: m_FlipX
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3532512445619884959, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7034773904088491925, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
propertyPath: m_FlipX
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
- target: {fileID: 7698905571408300091, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7698905571408300091, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 0.99999994
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7698905571408300091, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
propertyPath: m_LocalScale.z
|
||||
value: 0.99999994
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7698905571408300091, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -6.89
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7698905571408300091, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -7.05
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7698905571408300091, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
propertyPath: m_ConstrainProportionsScale
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8828658103663197825, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents:
|
||||
- {fileID: 5210033153524231666, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
- {fileID: 4408373410605328204, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedGameObjects:
|
||||
- targetCorrespondingSourceObject: {fileID: 7698905571408300091, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 4388395494483065101}
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
--- !u!4 &1924342418841580 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 7698905571408300091, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
m_PrefabInstance: {fileID: 7700829900874995671}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &5375394469162727687 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 2326086342663433936, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
m_PrefabInstance: {fileID: 7700829900874995671}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &7602419655779381936 stripped
|
||||
MonoBehaviour:
|
||||
m_CorrespondingSourceObject: {fileID: 243176356944356711, guid: 185f4e1548ec9754893c0a17f2207c44, type: 3}
|
||||
m_PrefabInstance: {fileID: 7700829900874995671}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 13d59d3c42170824b8f92557822d9bf0, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
|
||||
@@ -11,7 +11,7 @@ GameObject:
|
||||
- component: {fileID: 779234943217098985}
|
||||
- component: {fileID: 7990414055343410434}
|
||||
m_Layer: 0
|
||||
m_Name: SlottedItem
|
||||
m_Name: SlottedItemB
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
@@ -26,7 +26,7 @@ Transform:
|
||||
m_GameObject: {fileID: 1985797937494910982}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalPosition: {x: -0.279, y: -0.097, z: 0}
|
||||
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
@@ -99,7 +99,6 @@ GameObject:
|
||||
- component: {fileID: 6583028881099676536}
|
||||
- component: {fileID: 8374056515464764762}
|
||||
- component: {fileID: 4289780218821574471}
|
||||
- component: {fileID: 4191908717467096214}
|
||||
- component: {fileID: 3093816592344978065}
|
||||
- component: {fileID: 8758136668472096799}
|
||||
m_Layer: 10
|
||||
@@ -238,20 +237,21 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 73d6494a73174ffabc6a7d3089d51e73, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!114 &4191908717467096214
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5835735262203788332}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 7846448751da4bdbaaa5cb87890dca42, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
itemData: {fileID: 11400000, guid: f97b9e24d6dceb145b56426c1152ebeb, type: 2}
|
||||
iconRenderer: {fileID: 6583028881099676536}
|
||||
isOneTime: 0
|
||||
cooldown: -1
|
||||
characterToInteract: 1
|
||||
interactionStarted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
interactionInterrupted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
characterArrived:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
interactionComplete:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &3093816592344978065
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -264,14 +264,24 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: ec1a2e6e32f746c4990c579e13b79104, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
OnSuccess:
|
||||
itemData: {fileID: 11400000, guid: f97b9e24d6dceb145b56426c1152ebeb, type: 2}
|
||||
iconRenderer: {fileID: 6583028881099676536}
|
||||
onItemSlotted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
OnFailure:
|
||||
onItemSlotRemoved:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
currentlySlottedItem: {fileID: 0}
|
||||
slottedItemRenderer: {fileID: 0}
|
||||
onCorrectItemSlotted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
onIncorrectItemSlotted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
onForbiddenItemSlotted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
slottedItemRenderer: {fileID: 7990414055343410434}
|
||||
--- !u!114 &8758136668472096799
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -94,7 +94,7 @@ GameObject:
|
||||
- component: {fileID: 1828079450404796388}
|
||||
- component: {fileID: 3806274462998212361}
|
||||
m_Layer: 0
|
||||
m_Name: SlottedItem
|
||||
m_Name: SlottedItemC
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
@@ -182,8 +182,8 @@ GameObject:
|
||||
- component: {fileID: 5015123355472106337}
|
||||
- component: {fileID: 1857323601952658682}
|
||||
- component: {fileID: 519585874127847016}
|
||||
- component: {fileID: 3177191571756140058}
|
||||
- component: {fileID: 106497079666291966}
|
||||
- component: {fileID: 3169137887822749614}
|
||||
m_Layer: 10
|
||||
m_Name: LureSpotC
|
||||
m_TagString: Untagged
|
||||
@@ -321,20 +321,21 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 73d6494a73174ffabc6a7d3089d51e73, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!114 &3177191571756140058
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7145022056631397938}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 7846448751da4bdbaaa5cb87890dca42, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
itemData: {fileID: 11400000, guid: c68dea945fecbf44094359769db04f31, type: 2}
|
||||
iconRenderer: {fileID: 5015123355472106337}
|
||||
isOneTime: 0
|
||||
cooldown: -1
|
||||
characterToInteract: 1
|
||||
interactionStarted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
interactionInterrupted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
characterArrived:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
interactionComplete:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &106497079666291966
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -347,11 +348,34 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: ec1a2e6e32f746c4990c579e13b79104, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
OnSuccess:
|
||||
itemData: {fileID: 11400000, guid: c68dea945fecbf44094359769db04f31, type: 2}
|
||||
iconRenderer: {fileID: 5015123355472106337}
|
||||
onItemSlotted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
OnFailure:
|
||||
onItemSlotRemoved:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
currentlySlottedItem: {fileID: 0}
|
||||
slottedItemRenderer: {fileID: 0}
|
||||
onCorrectItemSlotted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
onIncorrectItemSlotted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
onForbiddenItemSlotted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
slottedItemRenderer: {fileID: 3806274462998212361}
|
||||
--- !u!114 &3169137887822749614
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7145022056631397938}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 1101f6c4eb04423b89dc78dc7c9f1aae, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
stepData: {fileID: 11400000, guid: 28848561ff31fe24ea9f8590dee0bf8f, type: 2}
|
||||
|
||||
@@ -12,7 +12,6 @@ GameObject:
|
||||
- component: {fileID: 8875860401447896107}
|
||||
- component: {fileID: 5057760771402457000}
|
||||
- component: {fileID: 5387498764853775290}
|
||||
- component: {fileID: 6499593962557772468}
|
||||
- component: {fileID: 2433130051631076285}
|
||||
m_Layer: 10
|
||||
m_Name: SoundBird
|
||||
@@ -150,20 +149,21 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 73d6494a73174ffabc6a7d3089d51e73, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!114 &6499593962557772468
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 588897581313790951}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 7846448751da4bdbaaa5cb87890dca42, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
itemData: {fileID: 11400000, guid: d28f5774afad9d14f823601707150700, type: 2}
|
||||
iconRenderer: {fileID: 8875860401447896107}
|
||||
isOneTime: 0
|
||||
cooldown: -1
|
||||
characterToInteract: 1
|
||||
interactionStarted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
interactionInterrupted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
characterArrived:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
interactionComplete:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &2433130051631076285
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -176,13 +176,23 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: ec1a2e6e32f746c4990c579e13b79104, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
OnSuccess:
|
||||
itemData: {fileID: 11400000, guid: d28f5774afad9d14f823601707150700, type: 2}
|
||||
iconRenderer: {fileID: 8875860401447896107}
|
||||
onItemSlotted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
OnFailure:
|
||||
onItemSlotRemoved:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
onCorrectItemSlotted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
onIncorrectItemSlotted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
onForbiddenItemSlotted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
currentlySlottedItem: {fileID: 0}
|
||||
slottedItemRenderer: {fileID: 6941190210788968874}
|
||||
--- !u!1 &4624889622840393752
|
||||
GameObject:
|
||||
|
||||
@@ -14,7 +14,7 @@ GameObject:
|
||||
- component: {fileID: 7616859841301711022}
|
||||
- component: {fileID: 592045584872845087}
|
||||
m_Layer: 10
|
||||
m_Name: BasePickup
|
||||
m_Name: BurgerBuns
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
@@ -30,8 +30,8 @@ Transform:
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 3.405, y: 0, z: 0}
|
||||
m_LocalScale: {x: 4, y: 4, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_LocalScale: {x: 2.5, y: 2.5, z: 0.625}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -79,15 +79,15 @@ SpriteRenderer:
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 1
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Sprite: {fileID: 4273613496703388379, guid: 1d2396d3a6e78544083da828beb20888, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_Size: {x: 1.76, y: 0.75}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!61 &3070149615425714466
|
||||
@@ -127,14 +127,14 @@ BoxCollider2D:
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_SpriteTilingProperty:
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
pivot: {x: 0, y: 0}
|
||||
oldSize: {x: 0, y: 0}
|
||||
newSize: {x: 0, y: 0}
|
||||
adaptiveTilingThreshold: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
oldSize: {x: 1.76, y: 0.75}
|
||||
newSize: {x: 1.76, y: 0.75}
|
||||
adaptiveTilingThreshold: 0.5
|
||||
drawMode: 0
|
||||
adaptiveTiling: 0
|
||||
m_AutoTiling: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_Size: {x: 2, y: 1.5}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!114 &7616859841301711022
|
||||
MonoBehaviour:
|
||||
@@ -148,6 +148,21 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 73d6494a73174ffabc6a7d3089d51e73, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
isOneTime: 0
|
||||
cooldown: -1
|
||||
characterToInteract: 1
|
||||
interactionStarted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
interactionInterrupted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
characterArrived:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
interactionComplete:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &592045584872845087
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -160,5 +175,5 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 7846448751da4bdbaaa5cb87890dca42, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
itemData: {fileID: 0}
|
||||
itemData: {fileID: 11400000, guid: 0c6986639ca176a419c92f5a327d95ce, type: 2}
|
||||
iconRenderer: {fileID: 7494677664706785084}
|
||||
|
||||
179
Assets/Prefabs/Items/PrefabsPLACEHOLDER/Bunfflers.prefab
Normal file
179
Assets/Prefabs/Items/PrefabsPLACEHOLDER/Bunfflers.prefab
Normal file
@@ -0,0 +1,179 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &8631570451324008562
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8737943614546067711}
|
||||
- component: {fileID: 4638897979003302452}
|
||||
- component: {fileID: 2967522604765020532}
|
||||
- component: {fileID: 6501709216426994228}
|
||||
- component: {fileID: 7629925223318462841}
|
||||
m_Layer: 0
|
||||
m_Name: Bunfflers
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8737943614546067711
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8631570451324008562}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -23.31, y: -12.06, z: 0}
|
||||
m_LocalScale: {x: 2, y: 2, z: 2}
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!212 &4638897979003302452
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8631570451324008562}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, 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: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: -8848419083337551572, guid: b285cfb6530624a44a95ec99a59d7215, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1.74, y: 1.59}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!61 &2967522604765020532
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8631570451324008562}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_ForceSendLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ForceReceiveLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ContactCaptureLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_CallbackLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_IsTrigger: 0
|
||||
m_UsedByEffector: 0
|
||||
m_CompositeOperation: 0
|
||||
m_CompositeOrder: 0
|
||||
m_Offset: {x: 0.00000047683716, y: -0.06357646}
|
||||
m_SpriteTilingProperty:
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
oldSize: {x: 1.74, y: 1.59}
|
||||
newSize: {x: 1.74, y: 1.59}
|
||||
adaptiveTilingThreshold: 0.5
|
||||
drawMode: 0
|
||||
adaptiveTiling: 0
|
||||
m_AutoTiling: 0
|
||||
m_Size: {x: 3.011527, y: 2.861527}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!114 &6501709216426994228
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8631570451324008562}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 73d6494a73174ffabc6a7d3089d51e73, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
isOneTime: 0
|
||||
cooldown: -1
|
||||
characterToInteract: 0
|
||||
interactionStarted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
interactionInterrupted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
characterArrived:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
interactionComplete:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &7629925223318462841
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8631570451324008562}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 7846448751da4bdbaaa5cb87890dca42, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
itemData: {fileID: 11400000, guid: 6934dcb56c610c44da228f7f24ca13c9, type: 2}
|
||||
iconRenderer: {fileID: 4638897979003302452}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 47ac9229b9b128041a770b193eb43b02
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -127,31 +127,5 @@ PrefabInstance:
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents:
|
||||
- targetCorrespondingSourceObject: {fileID: 7447346505753002421, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 200688012287672078}
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
--- !u!1 &5336239774528417475 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 7447346505753002421, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
m_PrefabInstance: {fileID: 3266354364519034742}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &200688012287672078
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5336239774528417475}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 21401a3b30134380bb205964d9e5c67d, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
OnSuccess:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
OnFailure:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
|
||||
161
Assets/Prefabs/Items/PrefabsPLACEHOLDER/FootballBird.prefab
Normal file
161
Assets/Prefabs/Items/PrefabsPLACEHOLDER/FootballBird.prefab
Normal file
@@ -0,0 +1,161 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1001 &9194176465486785202
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 592045584872845087, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: itemData
|
||||
value:
|
||||
objectReference: {fileID: 11400000, guid: ab57c8237aac144439a18d69f56d36c6, type: 2}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 0.8000001
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 0.8000001
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalScale.z
|
||||
value: 0.26666668
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0.15
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -0.4
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_ConstrainProportionsScale
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3070149615425714466, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_Size.x
|
||||
value: 3.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3070149615425714466, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_Size.y
|
||||
value: 3.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3070149615425714466, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_SpriteTilingProperty.pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3070149615425714466, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_SpriteTilingProperty.pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3070149615425714466, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_SpriteTilingProperty.newSize.x
|
||||
value: 2.24
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3070149615425714466, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_SpriteTilingProperty.newSize.y
|
||||
value: 2.11
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3070149615425714466, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_SpriteTilingProperty.oldSize.x
|
||||
value: 2.52
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3070149615425714466, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_SpriteTilingProperty.oldSize.y
|
||||
value: 3.07
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3070149615425714466, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_SpriteTilingProperty.adaptiveTilingThreshold
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7447346505753002421, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: FootballBird
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7494677664706785084, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_Size.x
|
||||
value: 2.24
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7494677664706785084, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_Size.y
|
||||
value: 2.11
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7494677664706785084, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_Sprite
|
||||
value:
|
||||
objectReference: {fileID: 804776353370782802, guid: b187e41d8728aba4b90917cc22005463, type: 3}
|
||||
- target: {fileID: 7494677664706785084, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_WasSpriteAssigned
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7616859841301711022, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: isOneTime
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7616859841301711022, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: characterToInteract
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents:
|
||||
- {fileID: 592045584872845087, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents:
|
||||
- targetCorrespondingSourceObject: {fileID: 7447346505753002421, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 1972611059221495588}
|
||||
m_SourcePrefab: {fileID: 100100000, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
--- !u!1 &1784002662241348359 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 7447346505753002421, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
m_PrefabInstance: {fileID: 9194176465486785202}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &1972611059221495588
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1784002662241348359}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 1101f6c4eb04423b89dc78dc7c9f1aae, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
stepData: {fileID: 11400000, guid: 0df54e69020c39e44b3b486cd6ac475a, type: 2}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9b2d5618c8cc81743b982c6cc8d95871
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
157
Assets/Prefabs/Items/PrefabsPLACEHOLDER/HammerBird.prefab
Normal file
157
Assets/Prefabs/Items/PrefabsPLACEHOLDER/HammerBird.prefab
Normal file
@@ -0,0 +1,157 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1001 &9194176465486785202
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 0}
|
||||
m_Modifications:
|
||||
- target: {fileID: 592045584872845087, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: itemData
|
||||
value:
|
||||
objectReference: {fileID: 11400000, guid: ab57c8237aac144439a18d69f56d36c6, type: 2}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalScale.x
|
||||
value: 1.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalScale.y
|
||||
value: 1.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalScale.z
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 54.83
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -35.53
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_ConstrainProportionsScale
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3070149615425714466, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_Size.x
|
||||
value: 3.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3070149615425714466, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_Size.y
|
||||
value: 3.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3070149615425714466, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_SpriteTilingProperty.pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3070149615425714466, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_SpriteTilingProperty.pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3070149615425714466, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_SpriteTilingProperty.newSize.x
|
||||
value: 2.24
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3070149615425714466, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_SpriteTilingProperty.newSize.y
|
||||
value: 2.11
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3070149615425714466, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_SpriteTilingProperty.oldSize.x
|
||||
value: 2.08
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3070149615425714466, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_SpriteTilingProperty.oldSize.y
|
||||
value: 2.83
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3070149615425714466, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_SpriteTilingProperty.adaptiveTilingThreshold
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7447346505753002421, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: HammerBird
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7494677664706785084, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_Size.x
|
||||
value: 2.24
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7494677664706785084, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_Size.y
|
||||
value: 2.11
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7494677664706785084, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_Sprite
|
||||
value:
|
||||
objectReference: {fileID: -5464640192890044756, guid: 1bf1b8625c66fa142a1ac7ce275cd4a6, type: 3}
|
||||
- target: {fileID: 7494677664706785084, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_WasSpriteAssigned
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7616859841301711022, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: characterToInteract
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents:
|
||||
- {fileID: 592045584872845087, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents:
|
||||
- targetCorrespondingSourceObject: {fileID: 7447346505753002421, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 1972611059221495588}
|
||||
m_SourcePrefab: {fileID: 100100000, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
--- !u!1 &1784002662241348359 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 7447346505753002421, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
m_PrefabInstance: {fileID: 9194176465486785202}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &1972611059221495588
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1784002662241348359}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 1101f6c4eb04423b89dc78dc7c9f1aae, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
stepData: {fileID: 11400000, guid: 829fc7c8046e0844f93bf810dc1f0ebd, type: 2}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e3d6494020df3a34f88a89f0ee9a3527
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -128,9 +128,6 @@ PrefabInstance:
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents:
|
||||
- targetCorrespondingSourceObject: {fileID: 7447346505753002421, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 5935055277585311711}
|
||||
- targetCorrespondingSourceObject: {fileID: 7447346505753002421, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 5172306257923753614}
|
||||
@@ -140,24 +137,6 @@ GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 7447346505753002421, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
m_PrefabInstance: {fileID: 8543660602505065938}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &5935055277585311711
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1282228733406082151}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 21401a3b30134380bb205964d9e5c67d, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
OnSuccess:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
OnFailure:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &5172306257923753614
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -50,7 +50,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7447346505753002421, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: BasePuzzlePickup
|
||||
value: BurgerBuns
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
|
||||
125
Assets/Scenes/BootstrapScene.unity
Normal file
125
Assets/Scenes/BootstrapScene.unity
Normal file
@@ -0,0 +1,125 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 10
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 3
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 13
|
||||
m_BakeOnSceneLoad: 0
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 0
|
||||
m_EnableRealtimeLightmaps: 0
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 12
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAmbientOcclusion: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 512
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 256
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRDenoiserTypeDirect: 1
|
||||
m_PVRDenoiserTypeIndirect: 1
|
||||
m_PVRDenoiserTypeAO: 1
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 1
|
||||
m_PVRFilteringGaussRadiusAO: 1
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_LightingSettings: {fileID: 0}
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 3
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
buildHeightMesh: 0
|
||||
maxJobWorkers: 0
|
||||
preserveTilesOutsideBounds: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1660057539 &9223372036854775807
|
||||
SceneRoots:
|
||||
m_ObjectHideFlags: 0
|
||||
m_Roots: []
|
||||
7
Assets/Scenes/BootstrapScene.unity.meta
Normal file
7
Assets/Scenes/BootstrapScene.unity.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 706f6dec7a10d2542be1a3c21216158b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -190,7 +190,7 @@ Transform:
|
||||
m_GameObject: {fileID: 100481742}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -10}
|
||||
m_LocalPosition: {x: -4, y: 0, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
@@ -299,6 +299,10 @@ PrefabInstance:
|
||||
propertyPath: stepData
|
||||
value:
|
||||
objectReference: {fileID: 11400000, guid: 13b0c411066f85a41ba40c3bbbc281ed, type: 2}
|
||||
- target: {fileID: 6254953093500072797, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||
propertyPath: characterToInteract
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6303063351359542479, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||
propertyPath: m_Sprite
|
||||
value:
|
||||
@@ -494,6 +498,10 @@ PrefabInstance:
|
||||
propertyPath: m_Name
|
||||
value: Quarry
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8086761134767870039, guid: 539b408cd1191614abdcd99506f1157d, type: 3}
|
||||
propertyPath: characterToInteract
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 9191656170436146298, guid: 539b408cd1191614abdcd99506f1157d, type: 3}
|
||||
propertyPath: m_Sprite
|
||||
value:
|
||||
@@ -567,17 +575,23 @@ PrefabInstance:
|
||||
propertyPath: m_Enabled
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6254953093500072797, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||
propertyPath: isOneTime
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6254953093500072797, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||
propertyPath: characterToInteract
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6350287859698694726, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: TestAss
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedComponents:
|
||||
- {fileID: 4778083634590203921, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents:
|
||||
- targetCorrespondingSourceObject: {fileID: 6350287859698694726, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 800207724}
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||
--- !u!1 &384576743
|
||||
GameObject:
|
||||
@@ -737,6 +751,10 @@ PrefabInstance:
|
||||
propertyPath: stepData
|
||||
value:
|
||||
objectReference: {fileID: 11400000, guid: 9de0c57af6191384e96e2ba7c04a3d0d, type: 2}
|
||||
- target: {fileID: 6254953093500072797, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||
propertyPath: characterToInteract
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6303063351359542479, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||
propertyPath: m_Sprite
|
||||
value:
|
||||
@@ -755,29 +773,6 @@ Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 2844046668579196942, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||
m_PrefabInstance: {fileID: 368640488}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &800207718 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 6350287859698694726, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||
m_PrefabInstance: {fileID: 368640488}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &800207724
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 800207718}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 21401a3b30134380bb205964d9e5c67d, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
OnSuccess:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
OnFailure:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &948124904
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -868,7 +863,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: c119ffb87b2a16d4f925ff5d5ffd7092, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
ShouldPlayIntro: 1
|
||||
shouldPlayIntro: 0
|
||||
--- !u!95 &948124911
|
||||
Animator:
|
||||
serializedVersion: 7
|
||||
@@ -982,6 +977,10 @@ PrefabInstance:
|
||||
propertyPath: stepData
|
||||
value:
|
||||
objectReference: {fileID: 11400000, guid: a84cbe9804e13f74e857c55d90cc10d1, type: 2}
|
||||
- target: {fileID: 6254953093500072797, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||
propertyPath: characterToInteract
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6303063351359542479, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||
propertyPath: m_Sprite
|
||||
value:
|
||||
@@ -1103,6 +1102,10 @@ PrefabInstance:
|
||||
propertyPath: m_WasSpriteAssigned
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7616859841301711022, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: characterToInteract
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
@@ -1446,7 +1449,16 @@ PrefabInstance:
|
||||
propertyPath: m_WasSpriteAssigned
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
- target: {fileID: 7616859841301711022, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: isOneTime
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7616859841301711022, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: characterToInteract
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents:
|
||||
- {fileID: 592045584872845087, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects:
|
||||
- targetCorrespondingSourceObject: {fileID: 1730119453103664125, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
@@ -1562,37 +1574,15 @@ PrefabInstance:
|
||||
propertyPath: m_WasSpriteAssigned
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7616859841301711022, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
propertyPath: characterToInteract
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents:
|
||||
- targetCorrespondingSourceObject: {fileID: 7447346505753002421, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
insertIndex: -1
|
||||
addedObject: {fileID: 1578994557}
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
--- !u!1 &1578994556 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 7447346505753002421, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
m_PrefabInstance: {fileID: 1578994555}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!114 &1578994557
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1578994556}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 21401a3b30134380bb205964d9e5c67d, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
OnSuccess:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
OnFailure:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!4 &1627665103 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 2844046668579196942, guid: b5fc01af35233eb4cbeede05e50a7c34, type: 3}
|
||||
@@ -1620,14 +1610,29 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: ec1a2e6e32f746c4990c579e13b79104, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
OnSuccess:
|
||||
itemData: {fileID: 11400000, guid: e0fad48a84a6b6346ac17c84bc512500, type: 2}
|
||||
iconRenderer: {fileID: 1631660128}
|
||||
onItemSlotted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
OnFailure:
|
||||
onItemSlotRemoved:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
onCorrectItemSlotted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
onIncorrectItemSlotted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
onForbiddenItemSlotted:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
currentlySlottedItem: {fileID: 0}
|
||||
slottedItemRenderer: {fileID: 124275613}
|
||||
--- !u!212 &1631660128 stripped
|
||||
SpriteRenderer:
|
||||
m_CorrespondingSourceObject: {fileID: 7494677664706785084, guid: bf4b9d7045397f946b2125b1ad4a3fbd, type: 3}
|
||||
m_PrefabInstance: {fileID: 1336824707}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &1741016587
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1716,7 +1721,7 @@ Transform:
|
||||
m_GameObject: {fileID: 1741016587}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -10}
|
||||
m_LocalPosition: {x: -4, y: 0, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
@@ -1829,7 +1834,7 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
version: 1
|
||||
data:
|
||||
dataString: UEsDBBQAAAgIAAAIIewb8cShXAIAABIFAAALACQAZ3JhcGgwLmpzb24KACAAAAAAAAEAGAAAgD7V3rGdAQCAPtXesZ0BAIA+1d6xnQF1VE1z2jAQ/SuMzk3HkNBAby0E0gMJE9rJxRchrbEGWfJIcoBk+O/dlW3s0OnJ0nv78fZD/mDK+BJEsG7plFxZCez7gNGZfRl05CMc+c6ajXqH1uZVyZCTEY82Lzwoi/iQ3LwtIDglfpidJuMEwcqozLriQe5gZn3wCGdce0DK2UDeBqGPATvi52ZKLic8je7p9I6naTI441GACeA609awNautKiM0L0qQJLkzHiWXuEltaLCcxmZE0a3WyjdaWDiVsdZNmYMDKlYqjqXF/Ld4zUHt8kCXr3d97+cs8xAaVY6f5sphj+qw7KetG1dwv6+lvXFdUaJvd1FTHXX1D30zjHTmbPHYJh7GikKuxP6FnwT3odfYPjzvlA9jgw5c7/lWw2sO5skuna2MRDK4ilwrD6N5d71UNstB7Du8lnoFVuX/x0M1nGPxx5lWxZao2DsENtrGfsfhg8PJ/ELBcTV8EwJRUvHHw2++6+9QQyyU8wGppkpD8ra2cmTKFnigxosqzKwzENFGcwmG63BaY5RwPcArrpf1illweixN7oZr38CVS4Q7+yS5otb2cJmVz+1hBT5/roJWBjrRRDxhm2bWmHq//GeSvDaVy7joee0qJT8vFpuOJxM+hXEi72+HYnx3MwSRZeMJl9tMZnwyYXHzlMEyuV7XOpvu4MxMF9zglrW/kMHS8TKuunT8sFTvhe3pUyazG+EAzHMdoe2QB4dJ8E3KB6mwPxsIQZk4bfaRMm3FHmR6CZTGSh+OwfG0i5KyUr3ZQEjKZvGfkTKCL5u8dvCm4EDJ22Bndv4LUEsDBBQAAAgIAAAIIewRqbRYbQAAAHgAAAAJACQAbWV0YS5qc29uCgAgAAAAAAABABgAAIA+1d6xnQEAgD7V3rGdAQCAPtXesZ0Bq1YqSy0qzszPU7JSMNEz0jM011FQSi9KLMgoBooYgjilmSkgdrSSpamFRaJlqqlBirmxYbKpia5hanJamqlFYkpSWkpaooWFUixQfUllQapfYm4qRE9AYklGWmZeSmZeup57UWaKO8hopdhaAFBLAQItABQAAAgIAAAIIewb8cShXAIAABIFAAALACQAAAAAAAAAAAAAAAAAAABncmFwaDAuanNvbgoAIAAAAAAAAQAYAACAPtXesZ0BAIA+1d6xnQEAgD7V3rGdAVBLAQItABQAAAgIAAAIIewRqbRYbQAAAHgAAAAJACQAAAAAAAAAAAAAAKkCAABtZXRhLmpzb24KACAAAAAAAAEAGAAAgD7V3rGdAQCAPtXesZ0BAIA+1d6xnQFQSwUGAAAAAAIAAgC4AAAAYQMAAAAA
|
||||
dataString: UEsDBBQAAAgIAAAIIezWWttFWgIAABMFAAALACQAZ3JhcGgwLmpzb24KACAAAAAAAAEAGAAAgD7V3rGdAQCAPtXesZ0BAIA+1d6xnQF1VMty2jAU/RVG66ZjSGigu5YkpAsSJrSTjTdCusYaZMkjyTyS4d97r2xjQ6crS+fcx7kP+ZMp40sQwbq5U3JhJbDvA0Zn9mXQkc9w4BtrVuoDWpt3JUNORjzavPGgLOJDcvO2gOCU+GE2mowTBCujMuuKR7mBmfXBI5xx7QEpZwN5G4Q+B+yAn5spuRzxNLqn0weepsnghEcBJoDrTFvD1qy2qozQvChBkuTOeJSc4ya1ocFyGpsRRbdaK99oYeFYxlpXZQ4OqFipOJYW89/iNQe1yQNdvt71vV+zzENoVDl+fFAOe1SHZT9t3biC+20tbcd1RYm+3UVNddTFP/TNMNKZs8Vzm3gYKwq5Ets3fhTch15j+/BDp3wYG7TnesvXGt5zMC927mxlJJLBVeRaeRg9dNdzZbMcxLbDa6lXYFX+fzxUwykWf5hpVayJir1DYKVt7HccPjiczC8UHFfDNyEQJRV/PPzmm/4ONcSTcj4g1VRpSN7aVo5M2RMeqPGiCjPrDES00VyC4ToclxglXA/wiutlvWKeOD2WJnfDtW/gyiXCnX2SXFFLuz/Pyud2vwCfv1ZBKwOdaCJesE0za0y9X/6SJK9V5TIuel6bSsnLxWLT8WTCpzBO5P3tUIzvboYgsmw84XKdyYxPJixunjJYJtfLWmfTHZxZvyUG16z9hwzmjpdx16Xj+7n6KGxPoDKZXQkHYF4vQ3hwmAUfpXyUChu0ghCUieNmnynTVmxBpudAaSz18RAcT7soKSvVzgZCUjaLP42UEXxe5aWDnYI9JW+DndjpL1BLAwQUAAAICAAACCHsldWPv1oCAAASBQAACwAkAGdyYXBoMS5qc29uCgAgAAAAAAABABgAAIA+1d6xnQEAgD7V3rGdAQCAPtXesZ0BdVRLc9owEP4rjM5Nx+C86K11EtJDEqa0k4svi7XGGmTJo0eAZPjvXck2duj0xPLtt7vfPuQPJpRtsHDaLIzgT5oj+zZhwWZfJoPzEfew0Wol3rHnvAruqkCCyPkFTmjCpyHM6hqdEcV3tZGBnBDolSi1qe/5BjNtnSW4BGmRXEa7EK0I+piwPf1czEPIgazZTbDeyZonkyOZBSqHZqD2xJ7WsrwqJNQN8iB5IF9dX3b0q3QaiYra6ThpyK6lFLbTwtyhib1m0FhPnRCBC6DeooDQaoViU7mgcxz8UpYWXSfKwOFOGBpRm5X90O3carDbVtkbSI8n6W3Kp3+8F63g0uj6sa86TUIFV4li+wsOBVg3GusYvvss26sdyC2sJb5WqJ71wmivODmd8SHUW5zdDX9PjWUVFttRiVZrj/bBzf+3E5o4xub3mRT1Ori+XrbASuo47rh7NLSYn6Q4XobtUhAaZPyx+Bs24xPqHA/CWEeurk0V5K21N4HKHsgIgy+8y7RRGNFOc4MKpDssKYs7X+CZb1T1zPMA4a10tTtf/wTOQiI88JPkzLXUu9OybKV3T2irF++kUDiIDo5nGlOmlWrvazySPmzlTQnFKGzjBf98Wixdp7c3ZYJJWqSIt7MLWPNyBpheTsv5/PoWWLw9oahPkMtWaDceWpoakiu6s/4TMlkYaOKtcwO7hXiv9WjkQpV6VRhE9dJmOAlHQ0XoTfJ7LmhAK3ROqLhu9pEzqYst8vyUKI+d3u+dgXzIkrNGvGkXkJxl8ZuRswCfbnlp8E3gLhTvkx3Z8S9QSwMEFAAACAgAAAgh7H7sEB6KAAAAtgAAAAkAJABtZXRhLmpzb24KACAAAAAAAAEAGAAAgD7V3rGdAQCAPtXesZ0BAIA+1d6xnQFtjbsOgkAQRX+FbC2EfcmsP0Bn7A3FwMzAFiIBNDHGf3c3tnb3cXLvWz153eJ9VqfCVabSzaFQ44rLtKXEZPOIlPVVBQ+AgX1NjdWDd6XmQcQDUi8kCKASbnsLjdRc28EygymxJzHI1mkJ4QioukTtr4XPeOPf8AX3SeJMcR6rdo3U5v889r/oPl9QSwECLQAUAAAICAAACCHs1lrbRVoCAAATBQAACwAkAAAAAAAAAAAAAAAAAAAAZ3JhcGgwLmpzb24KACAAAAAAAAEAGAAAgD7V3rGdAQCAPtXesZ0BAIA+1d6xnQFQSwECLQAUAAAICAAACCHsldWPv1oCAAASBQAACwAkAAAAAAAAAAAAAACnAgAAZ3JhcGgxLmpzb24KACAAAAAAAAEAGAAAgD7V3rGdAQCAPtXesZ0BAIA+1d6xnQFQSwECLQAUAAAICAAACCHsfuwQHooAAAC2AAAACQAkAAAAAAAAAAAAAABOBQAAbWV0YS5qc29uCgAgAAAAAAABABgAAIA+1d6xnQEAgD7V3rGdAQCAPtXesZ0BUEsFBgAAAAADAAMAFQEAACMGAAAAAA==
|
||||
upgradeData:
|
||||
file_cachedStartup: {fileID: 0}
|
||||
data_cachedStartup:
|
||||
@@ -1974,30 +1979,6 @@ PrefabInstance:
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3435632802124758411, guid: 8ac0210dbf9d7754e9526d6d5c214f49, type: 3}
|
||||
propertyPath: acceleration
|
||||
value: 15
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3435632802124758411, guid: 8ac0210dbf9d7754e9526d6d5c214f49, type: 3}
|
||||
propertyPath: thresholdFar
|
||||
value: 12
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3435632802124758411, guid: 8ac0210dbf9d7754e9526d6d5c214f49, type: 3}
|
||||
propertyPath: thresholdNear
|
||||
value: 7
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3435632802124758411, guid: 8ac0210dbf9d7754e9526d6d5c214f49, type: 3}
|
||||
propertyPath: followDistance
|
||||
value: 5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3435632802124758411, guid: 8ac0210dbf9d7754e9526d6d5c214f49, type: 3}
|
||||
propertyPath: manualMoveSmooth
|
||||
value: 100
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3435632802124758411, guid: 8ac0210dbf9d7754e9526d6d5c214f49, type: 3}
|
||||
propertyPath: heldIconDisplayHeight
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
@@ -2013,7 +1994,7 @@ PrefabInstance:
|
||||
m_Modifications:
|
||||
- target: {fileID: 3823830588451517910, guid: 301b4e0735896334f8f6fb9a68a7e419, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
value: -4
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3823830588451517910, guid: 301b4e0735896334f8f6fb9a68a7e419, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,6 +5,7 @@ public class BirdEyesBehavior : MonoBehaviour
|
||||
{
|
||||
private StateMachine statemachine;
|
||||
private Animator animator;
|
||||
public bool correctItemIsIn;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
@@ -18,16 +19,22 @@ public class BirdEyesBehavior : MonoBehaviour
|
||||
|
||||
}
|
||||
|
||||
void CorrectItem()
|
||||
public void CorrectItem()
|
||||
{
|
||||
correctItemIsIn = true;
|
||||
animator.SetTrigger("RightGuess");
|
||||
}
|
||||
|
||||
void IncorrectItem()
|
||||
public void IncorrectItem()
|
||||
{
|
||||
correctItemIsIn = false;
|
||||
animator.SetTrigger("WrongGuess");
|
||||
}
|
||||
void BirdReveal()
|
||||
public void NoItem()
|
||||
{
|
||||
animator.SetTrigger("NoGuess");
|
||||
}
|
||||
public void BirdReveal()
|
||||
{
|
||||
statemachine.ChangeState ("BirdSpawned");
|
||||
}
|
||||
|
||||
21
Assets/Scripts/AppleHillsScripts.asmdef
Normal file
21
Assets/Scripts/AppleHillsScripts.asmdef
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "AppleHillsScripts",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"PixelplacementAssembly",
|
||||
"Unity.Addressables",
|
||||
"AstarPathfindingProject",
|
||||
"Unity.ResourceManager",
|
||||
"Unity.InputSystem",
|
||||
"Unity.TextMeshPro"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
7
Assets/Scripts/AppleHillsScripts.asmdef.meta
Normal file
7
Assets/Scripts/AppleHillsScripts.asmdef.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d91d3f46515a6954caa674697afbf416
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -14,7 +14,8 @@ public class DebugUIMessage : MonoBehaviour
|
||||
/// </summary>
|
||||
/// <param name="message">The message to display.</param>
|
||||
/// <param name="duration">How long to display the message (seconds).</param>
|
||||
public static void Show(string message, float duration = 2f)
|
||||
/// <param name="displayColor"></param>
|
||||
public static void Show(string message, Color displayColor, float duration = 2f)
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
@@ -23,7 +24,7 @@ public class DebugUIMessage : MonoBehaviour
|
||||
instance.SetupUI();
|
||||
DontDestroyOnLoad(go);
|
||||
}
|
||||
instance.ShowMessage(message, duration);
|
||||
instance.ShowMessage(message, duration, displayColor);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -45,7 +46,7 @@ public class DebugUIMessage : MonoBehaviour
|
||||
messageText.font = customFont;
|
||||
else
|
||||
messageText.font = Resources.GetBuiltinResource<Font>("LegacyRuntime.ttf");
|
||||
messageText.fontSize = 16;
|
||||
messageText.fontSize = 32;
|
||||
messageText.color = Color.yellow;
|
||||
var outline = textGO.AddComponent<Outline>();
|
||||
outline.effectColor = Color.black;
|
||||
@@ -55,16 +56,17 @@ public class DebugUIMessage : MonoBehaviour
|
||||
rect.anchorMax = new Vector2(0.5f, 0.5f);
|
||||
rect.pivot = new Vector2(0.5f, 0.5f);
|
||||
rect.anchoredPosition = Vector2.zero;
|
||||
rect.sizeDelta = new Vector2(400, 40);
|
||||
rect.sizeDelta = new Vector2(800, 40);
|
||||
messageText.text = "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Internal method to show a message and start the hide coroutine.
|
||||
/// </summary>
|
||||
private void ShowMessage(string message, float duration)
|
||||
private void ShowMessage(string message, float duration, Color fontColor)
|
||||
{
|
||||
messageText.text = message;
|
||||
messageText.color = fontColor;
|
||||
messageText.enabled = true;
|
||||
if (hideCoroutine != null)
|
||||
StopCoroutine(hideCoroutine);
|
||||
|
||||
@@ -35,6 +35,14 @@ public class GameManager : MonoBehaviour
|
||||
void Awake()
|
||||
{
|
||||
_instance = this;
|
||||
if (gameSettings == null)
|
||||
{
|
||||
gameSettings = Resources.Load<GameSettings>("DefaultSettings");
|
||||
if (gameSettings == null)
|
||||
{
|
||||
Debug.LogError("GameSettings asset not found in Resources!");
|
||||
}
|
||||
}
|
||||
// DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
|
||||
@@ -50,7 +58,7 @@ public class GameManager : MonoBehaviour
|
||||
public float ManualMoveSmooth => gameSettings != null ? gameSettings.manualMoveSmooth : 8f;
|
||||
public float ThresholdFar => gameSettings != null ? gameSettings.thresholdFar : 2.5f;
|
||||
public float ThresholdNear => gameSettings != null ? gameSettings.thresholdNear : 0.5f;
|
||||
public float StopThreshold => gameSettings != null ? gameSettings.stopThreshold : 0.1f;
|
||||
public float StopThreshold => gameSettings != null ? gameSettings.stopThreshold : 0.5f;
|
||||
public float MoveSpeed => gameSettings != null ? gameSettings.moveSpeed : 5f;
|
||||
public float StopDistance => gameSettings != null ? gameSettings.stopDistance : 0.1f;
|
||||
public bool UseRigidbody => gameSettings != null ? gameSettings.useRigidbody : true;
|
||||
@@ -59,6 +67,7 @@ public class GameManager : MonoBehaviour
|
||||
public float HeldIconDisplayHeight => gameSettings != null ? gameSettings.heldIconDisplayHeight : 2.0f;
|
||||
public GameObject BasePickupPrefab => gameSettings != null ? gameSettings.basePickupPrefab : null;
|
||||
public LayerMask InteractableLayerMask => gameSettings != null ? gameSettings.interactableLayerMask : -1;
|
||||
public float PlayerStopDistanceDirectInteraction => gameSettings != null ? gameSettings.playerStopDistanceDirectInteraction : 2.0f;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the combination rule for two items, if any.
|
||||
@@ -68,7 +77,8 @@ public class GameManager : MonoBehaviour
|
||||
if (gameSettings == null || gameSettings.combinationRules == null) return null;
|
||||
foreach (var rule in gameSettings.combinationRules)
|
||||
{
|
||||
if ((rule.itemA == item1 && rule.itemB == item2) || (rule.itemA == item2 && rule.itemB == item1))
|
||||
if ((PickupItemData.AreEquivalent(rule.itemA, item1) && PickupItemData.AreEquivalent(rule.itemB, item2)) ||
|
||||
(PickupItemData.AreEquivalent(rule.itemA, item2) && PickupItemData.AreEquivalent(rule.itemB, item1)))
|
||||
{
|
||||
return rule;
|
||||
}
|
||||
@@ -84,7 +94,7 @@ public class GameManager : MonoBehaviour
|
||||
if (gameSettings == null || gameSettings.slotItemConfigs == null || slotItem == null) return null;
|
||||
foreach (var config in gameSettings.slotItemConfigs)
|
||||
{
|
||||
if (config.slotItem == slotItem)
|
||||
if (PickupItemData.AreEquivalent(slotItem, config.slotItem))
|
||||
return config;
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -8,6 +8,7 @@ public class GameSettings : ScriptableObject
|
||||
{
|
||||
[Header("Interactions")]
|
||||
public float playerStopDistance = 6.0f;
|
||||
public float playerStopDistanceDirectInteraction = 2.0f;
|
||||
public float followerPickupDelay = 0.2f;
|
||||
|
||||
[Header("Follower Settings")]
|
||||
|
||||
@@ -42,11 +42,29 @@ public class SceneManagerService : MonoBehaviour
|
||||
|
||||
private readonly Dictionary<string, AsyncOperation> _activeLoads = new();
|
||||
private readonly Dictionary<string, AsyncOperation> _activeUnloads = new();
|
||||
private const string BootstrapSceneName = "BootstrapScene";
|
||||
|
||||
void Awake()
|
||||
{
|
||||
_instance = this;
|
||||
// DontDestroyOnLoad(gameObject);
|
||||
#if UNITY_EDITOR
|
||||
// In Editor, set CurrentGameplayScene to the currently open scene at play start
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
var activeScene = SceneManager.GetActiveScene();
|
||||
if (activeScene.IsValid())
|
||||
{
|
||||
CurrentGameplayScene = activeScene.name;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// Ensure BootstrapScene is loaded at startup
|
||||
var bootstrap = SceneManager.GetSceneByName(BootstrapSceneName);
|
||||
if (!bootstrap.isLoaded)
|
||||
{
|
||||
SceneManager.LoadScene(BootstrapSceneName, LoadSceneMode.Additive);
|
||||
}
|
||||
}
|
||||
|
||||
void OnApplicationQuit()
|
||||
@@ -196,7 +214,7 @@ public class SceneManagerService : MonoBehaviour
|
||||
}
|
||||
|
||||
// Tracks the currently loaded gameplay scene (not persistent/bootstrapper)
|
||||
public string CurrentGameplayScene { get; private set; } = "AppleHillsOverworld";
|
||||
public string CurrentGameplayScene { get; private set; } = "MainMenu";
|
||||
|
||||
// Switches from current gameplay scene to a new one
|
||||
public async Task SwitchSceneAsync(string newSceneName, IProgress<float> progress = null)
|
||||
@@ -210,10 +228,8 @@ public class SceneManagerService : MonoBehaviour
|
||||
else
|
||||
DestroyImmediate(astar.gameObject);
|
||||
}
|
||||
// Load new scene
|
||||
await LoadSceneAsync(newSceneName, progress);
|
||||
// Unload previous scene (if not same)
|
||||
if (!string.IsNullOrEmpty(CurrentGameplayScene) && CurrentGameplayScene != newSceneName)
|
||||
// Unload previous gameplay scene (if not BootstrapScene and not same as new)
|
||||
if (!string.IsNullOrEmpty(CurrentGameplayScene) && CurrentGameplayScene != newSceneName && CurrentGameplayScene != BootstrapSceneName)
|
||||
{
|
||||
var prevScene = SceneManager.GetSceneByName(CurrentGameplayScene);
|
||||
if (prevScene.isLoaded)
|
||||
@@ -225,6 +241,14 @@ public class SceneManagerService : MonoBehaviour
|
||||
Debug.LogWarning($"SceneManagerService: Previous scene '{CurrentGameplayScene}' is not loaded, skipping unload.");
|
||||
}
|
||||
}
|
||||
// Ensure BootstrapScene is loaded before loading new scene
|
||||
var bootstrap = SceneManager.GetSceneByName(BootstrapSceneName);
|
||||
if (!bootstrap.isLoaded)
|
||||
{
|
||||
SceneManager.LoadScene(BootstrapSceneName, LoadSceneMode.Additive);
|
||||
}
|
||||
// Load new gameplay scene
|
||||
await LoadSceneAsync(newSceneName, progress);
|
||||
// Update tracker
|
||||
CurrentGameplayScene = newSceneName;
|
||||
}
|
||||
|
||||
16
Assets/Scripts/DamianExperiments/AnneLiseBehaviour.cs
Normal file
16
Assets/Scripts/DamianExperiments/AnneLiseBehaviour.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class AnneLiseBehaviour : MonoBehaviour
|
||||
{
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d0d1761ee6769c243b110122f5e17b73
|
||||
@@ -2,23 +2,33 @@ using UnityEngine;
|
||||
|
||||
public class Distancemeasurer : MonoBehaviour
|
||||
{
|
||||
public float playerDistanceToChange;
|
||||
public float playerToPlaceDistance;
|
||||
public BirdEyesBehavior birdEyes;
|
||||
private Vector2 eyesPosition;
|
||||
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()
|
||||
{
|
||||
eyesPosition = transform.position;
|
||||
playerPosition = transform.position;
|
||||
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);
|
||||
//Debug.Log("Distance to player: " + distance);
|
||||
if (distance > playerToPlaceDistance && birdEyes.correctItemIsIn == true)
|
||||
{
|
||||
birdEyes.BirdReveal();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
3
Assets/Scripts/Data.meta
Normal file
3
Assets/Scripts/Data.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e0b15b90103942c3b0e630462ecc5de1
|
||||
timeCreated: 1757518020
|
||||
1
Assets/Scripts/Data/ItemCombinationManager.cs
Normal file
1
Assets/Scripts/Data/ItemCombinationManager.cs
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
3
Assets/Scripts/Data/ItemCombinationManager.cs.meta
Normal file
3
Assets/Scripts/Data/ItemCombinationManager.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a54fc1a3945f46c580a83e74f9436526
|
||||
timeCreated: 1757518020
|
||||
@@ -142,7 +142,7 @@ public class InputManager : MonoBehaviour
|
||||
Vector2 screenPos = positionAction.ReadValue<Vector2>();
|
||||
Vector3 worldPos = Camera.main.ScreenToWorldPoint(screenPos);
|
||||
Vector2 worldPos2D = new Vector2(worldPos.x, worldPos.y);
|
||||
Debug.Log($"[InputManager] HoldMove update at {worldPos2D}");
|
||||
// Debug.Log($"[InputManager] HoldMove update at {worldPos2D}");
|
||||
defaultConsumer?.OnHoldMove(worldPos2D);
|
||||
}
|
||||
}
|
||||
@@ -157,18 +157,15 @@ public class InputManager : MonoBehaviour
|
||||
Collider2D hit = Physics2D.OverlapPoint(worldPos, mask);
|
||||
if (hit != null)
|
||||
{
|
||||
var interactable = hit.GetComponent<ITouchInputConsumer>();
|
||||
if (interactable != null)
|
||||
var consumer = hit.GetComponent<ITouchInputConsumer>();
|
||||
if (consumer != null)
|
||||
{
|
||||
Debug.unityLogger.Log("Interactable", $"[InputManager] Delegating tap to interactable at {worldPos} (GameObject: {hit.gameObject.name})");
|
||||
interactable.OnTap(worldPos);
|
||||
Debug.unityLogger.Log("Interactable", $"[InputManager] Delegating tap to consumer at {worldPos} (GameObject: {hit.gameObject.name})");
|
||||
consumer.OnTap(worldPos);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.unityLogger.Log("Interactable", $"[InputManager] Collider2D hit at {worldPos} (GameObject: {hit.gameObject.name}), but no ITouchInputConsumer found.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.unityLogger.Log("Interactable", $"[InputManager] No Collider2D found at {worldPos} for interactable delegation.");
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Input
|
||||
// --- Movement State ---
|
||||
private Vector3 targetPosition;
|
||||
private Vector3 directMoveVelocity; // default is Vector3.zero
|
||||
private bool isHolding;
|
||||
internal bool isHolding;
|
||||
private Vector2 lastHoldPosition;
|
||||
private Coroutine pathfindingDragCoroutine;
|
||||
private float pathfindingDragUpdateInterval = 0.1f; // Interval in seconds
|
||||
@@ -28,6 +28,10 @@ namespace Input
|
||||
private Transform artTransform;
|
||||
private SpriteRenderer spriteRenderer;
|
||||
|
||||
// --- Last direct movement direction ---
|
||||
private Vector3 _lastDirectMoveDir = Vector3.right;
|
||||
public Vector3 LastDirectMoveDir => _lastDirectMoveDir;
|
||||
|
||||
// --- MoveToAndNotify State ---
|
||||
public delegate void ArrivedAtTargetHandler();
|
||||
private Coroutine moveToCoroutine;
|
||||
@@ -184,6 +188,9 @@ namespace Input
|
||||
adjustedMove = toTarget;
|
||||
}
|
||||
transform.position += adjustedMove;
|
||||
|
||||
// Cache the last direct movement direction
|
||||
_lastDirectMoveDir = directMoveVelocity.normalized;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Interaction requirement that allows combining the follower's held item with this pickup if a valid combination rule exists.
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(Pickup))]
|
||||
public class CombineWithBehavior : InteractionRequirementBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Attempts to combine the follower's held item with this pickup's item.
|
||||
/// </summary>
|
||||
/// <param name="follower">The follower attempting the interaction.</param>
|
||||
/// <returns>True if the combination was successful, false otherwise.</returns>
|
||||
public override bool TryInteract(FollowerController follower)
|
||||
{
|
||||
var heldItem = follower.CurrentlyHeldItem;
|
||||
var pickup = GetComponent<Pickup>();
|
||||
if (heldItem == null)
|
||||
{
|
||||
// DebugUIMessage.Show("You need an item to combine.");
|
||||
OnFailure?.Invoke();
|
||||
return true;
|
||||
}
|
||||
if (pickup == null || pickup.itemData == null)
|
||||
{
|
||||
DebugUIMessage.Show("Target item is missing or invalid.");
|
||||
OnFailure?.Invoke();
|
||||
return false;
|
||||
}
|
||||
var rule = GameManager.Instance.GetCombinationRule(heldItem, pickup.itemData);
|
||||
if (rule != null && rule.resultPrefab != null)
|
||||
{
|
||||
// Instantiate the result prefab at the pickup's position
|
||||
var resultObj = GameObject.Instantiate(rule.resultPrefab, pickup.transform.position, Quaternion.identity);
|
||||
var resultPickup = resultObj.GetComponent<Pickup>();
|
||||
if (resultPickup != null)
|
||||
{
|
||||
// Hide and parent to follower
|
||||
resultObj.SetActive(false);
|
||||
resultObj.transform.SetParent(follower.transform);
|
||||
// Set held item and icon from the spawned prefab
|
||||
follower.SetHeldItem(resultPickup.itemData, resultPickup.iconRenderer);
|
||||
// Cache the spawned object as the held item
|
||||
follower.CacheHeldPickupObject(resultObj);
|
||||
follower.justCombined = true;
|
||||
OnSuccess?.Invoke();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("Result prefab does not have a Pickup component.");
|
||||
GameObject.Destroy(resultObj);
|
||||
OnFailure?.Invoke();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// DebugUIMessage.Show($"Cannot combine {heldItem.itemName ?? \"an item\"} with {pickup.itemData.itemName ?? \"target item\"}.");
|
||||
OnFailure?.Invoke();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 21401a3b30134380bb205964d9e5c67d
|
||||
timeCreated: 1756981777
|
||||
@@ -1,19 +1,42 @@
|
||||
using UnityEngine;
|
||||
using Input;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using UnityEngine.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an interactable object that can respond to tap input events.
|
||||
/// </summary>
|
||||
public class Interactable : MonoBehaviour, ITouchInputConsumer
|
||||
namespace Interactions
|
||||
{
|
||||
public event Action StartedInteraction;
|
||||
public event Action<bool> InteractionComplete;
|
||||
|
||||
private ObjectiveStepBehaviour stepBehaviour;
|
||||
|
||||
void Awake()
|
||||
public enum CharacterToInteract
|
||||
{
|
||||
stepBehaviour = GetComponent<ObjectiveStepBehaviour>();
|
||||
Trafalgar,
|
||||
Pulver
|
||||
}
|
||||
/// <summary>
|
||||
/// Represents an interactable object that can respond to tap input events.
|
||||
/// </summary>
|
||||
public class Interactable : MonoBehaviour, ITouchInputConsumer
|
||||
{
|
||||
[Header("Interaction Settings")]
|
||||
public bool isOneTime = false;
|
||||
public float cooldown = -1f;
|
||||
public CharacterToInteract characterToInteract = CharacterToInteract.Pulver;
|
||||
|
||||
[Header("Interaction Events")]
|
||||
public UnityEvent<PlayerTouchController, FollowerController> interactionStarted;
|
||||
public UnityEvent interactionInterrupted;
|
||||
public UnityEvent characterArrived;
|
||||
public UnityEvent<bool> interactionComplete;
|
||||
|
||||
// Helpers for managing interaction state
|
||||
private bool _interactionInProgress;
|
||||
private PlayerTouchController _playerRef;
|
||||
private FollowerController _followerController;
|
||||
|
||||
private bool _isActive = true;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
// Subscribe to interactionComplete event
|
||||
interactionComplete.AddListener(OnInteractionComplete);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -21,56 +44,187 @@ public class Interactable : MonoBehaviour, ITouchInputConsumer
|
||||
/// </summary>
|
||||
public void OnTap(Vector2 worldPosition)
|
||||
{
|
||||
if (!_isActive)
|
||||
{
|
||||
Debug.Log($"[Interactable] Is disabled!");
|
||||
return;
|
||||
}
|
||||
Debug.Log($"[Interactable] OnTap at {worldPosition} on {gameObject.name}");
|
||||
StartedInteraction?.Invoke();
|
||||
// Broadcast interaction started event
|
||||
TryInteract();
|
||||
}
|
||||
|
||||
public void TryInteract()
|
||||
{
|
||||
_interactionInProgress = true;
|
||||
|
||||
_playerRef = FindFirstObjectByType<PlayerTouchController>();
|
||||
_followerController = FindFirstObjectByType<FollowerController>();
|
||||
|
||||
interactionStarted?.Invoke(_playerRef, _followerController);
|
||||
|
||||
if (_playerRef == null)
|
||||
{
|
||||
Debug.Log($"[Interactable] Player character could not be found. Aborting interaction.");
|
||||
interactionInterrupted.Invoke();
|
||||
return;
|
||||
}
|
||||
|
||||
// Compute closest point on the interaction radius
|
||||
Vector3 interactablePos = transform.position;
|
||||
Vector3 playerPos = _playerRef.transform.position;
|
||||
float stopDistance = characterToInteract == CharacterToInteract.Pulver
|
||||
? GameManager.Instance.PlayerStopDistance
|
||||
: GameManager.Instance.PlayerStopDistanceDirectInteraction;
|
||||
Vector3 toPlayer = (playerPos - interactablePos).normalized;
|
||||
Vector3 stopPoint = interactablePos + toPlayer * stopDistance;
|
||||
|
||||
// Unsubscribe previous to avoid duplicate calls
|
||||
_playerRef.OnArrivedAtTarget -= OnPlayerArrived;
|
||||
_playerRef.OnMoveToCancelled -= OnPlayerMoveCancelled;
|
||||
_playerRef.OnArrivedAtTarget += OnPlayerArrived;
|
||||
_playerRef.OnMoveToCancelled += OnPlayerMoveCancelled;
|
||||
_playerRef.MoveToAndNotify(stopPoint);
|
||||
}
|
||||
|
||||
private void OnPlayerMoveCancelled()
|
||||
{
|
||||
_interactionInProgress = false;
|
||||
interactionInterrupted?.Invoke();
|
||||
}
|
||||
|
||||
private void OnPlayerArrived()
|
||||
{
|
||||
if (!_interactionInProgress)
|
||||
return;
|
||||
|
||||
// Unsubscribe to avoid memory leaks
|
||||
_playerRef.OnArrivedAtTarget -= OnPlayerArrived;
|
||||
|
||||
if (characterToInteract == CharacterToInteract.Pulver)
|
||||
{
|
||||
_followerController.OnPickupArrived -= OnFollowerArrived;
|
||||
_followerController.OnPickupArrived += OnFollowerArrived;
|
||||
_followerController.GoToPointAndReturn(transform.position, _playerRef.transform);
|
||||
}
|
||||
else if (characterToInteract == CharacterToInteract.Trafalgar)
|
||||
{
|
||||
BroadcastCharacterArrived();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnFollowerArrived()
|
||||
{
|
||||
if (!_interactionInProgress)
|
||||
return;
|
||||
|
||||
// Unsubscribe to avoid memory leaks
|
||||
_followerController.OnPickupArrived -= OnFollowerArrived;
|
||||
|
||||
BroadcastCharacterArrived();
|
||||
}
|
||||
|
||||
private void BroadcastCharacterArrived()
|
||||
{
|
||||
// Check for ObjectiveStepBehaviour and lock state
|
||||
var step = GetComponent<PuzzleS.ObjectiveStepBehaviour>();
|
||||
if (step != null && !step.IsStepUnlocked())
|
||||
{
|
||||
DebugUIMessage.Show("This step is locked!", Color.yellow);
|
||||
BroadcastInteractionComplete(false);
|
||||
// Reset variables for next time
|
||||
_interactionInProgress = false;
|
||||
_playerRef = null;
|
||||
_followerController = null;
|
||||
return;
|
||||
}
|
||||
// Broadcast appropriate event
|
||||
characterArrived?.Invoke();
|
||||
// Reset variables for next time
|
||||
_interactionInProgress = false;
|
||||
_playerRef = null;
|
||||
_followerController = null;
|
||||
}
|
||||
|
||||
private void OnInteractionComplete(bool success)
|
||||
{
|
||||
if (success)
|
||||
{
|
||||
if (isOneTime)
|
||||
{
|
||||
_isActive = false;
|
||||
}
|
||||
else if (cooldown >= 0f)
|
||||
{
|
||||
StartCoroutine(HandleCooldown());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private System.Collections.IEnumerator HandleCooldown()
|
||||
{
|
||||
_isActive = false;
|
||||
yield return new WaitForSeconds(cooldown);
|
||||
_isActive = true;
|
||||
}
|
||||
|
||||
public void OnHoldStart(Vector2 position)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnHoldMove(Vector2 position)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnHoldEnd(Vector2 position)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void BroadcastInteractionComplete(bool success)
|
||||
{
|
||||
interactionComplete?.Invoke(success);
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
/// <summary>
|
||||
/// No hold behavior for interactables.
|
||||
/// Draws gizmos for pickup interaction range in the editor.
|
||||
/// </summary>
|
||||
public void OnHoldStart(Vector2 worldPosition) { }
|
||||
public void OnHoldMove(Vector2 worldPosition) { }
|
||||
public void OnHoldEnd(Vector2 worldPosition) { }
|
||||
|
||||
/// <summary>
|
||||
/// Called when the follower arrives at this interactable.
|
||||
/// </summary>
|
||||
public bool OnFollowerArrived(FollowerController follower)
|
||||
void OnDrawGizmos()
|
||||
{
|
||||
// Check if step is locked here
|
||||
if (stepBehaviour != null && !stepBehaviour.IsStepUnlocked())
|
||||
float playerStopDistance;
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
DebugUIMessage.Show("Item is not unlocked yet");
|
||||
Debug.Log("[Puzzles] Tried to interact with locked step: " + gameObject.name);
|
||||
InteractionComplete?.Invoke(false);
|
||||
return false;
|
||||
playerStopDistance = characterToInteract == CharacterToInteract.Trafalgar
|
||||
? GameManager.Instance.PlayerStopDistanceDirectInteraction
|
||||
: GameManager.Instance.PlayerStopDistance;
|
||||
}
|
||||
var requirements = GetComponents<InteractionRequirementBase>();
|
||||
if (requirements.Length == 0)
|
||||
else
|
||||
{
|
||||
InteractionComplete?.Invoke(true);
|
||||
return true;
|
||||
}
|
||||
bool anySuccess = false;
|
||||
foreach (var req in requirements)
|
||||
{
|
||||
if (req.TryInteract(follower))
|
||||
{
|
||||
anySuccess = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
InteractionComplete?.Invoke(anySuccess);
|
||||
if (!anySuccess)
|
||||
{
|
||||
Debug.Log($"[Interactable] No interaction requirements succeeded for {gameObject.name}");
|
||||
// Optionally trigger a default failure event or feedback here
|
||||
}
|
||||
return anySuccess;
|
||||
// Load settings directly from asset path in editor
|
||||
var settings =
|
||||
UnityEditor.AssetDatabase.LoadAssetAtPath<GameSettings>(
|
||||
"Assets/Data/Settings/DefaultSettings.asset");
|
||||
playerStopDistance = settings != null
|
||||
? (characterToInteract == CharacterToInteract.Trafalgar
|
||||
? settings.playerStopDistanceDirectInteraction
|
||||
: settings.playerStopDistance)
|
||||
: 1.0f;
|
||||
}
|
||||
|
||||
public void CompleteInteraction(bool success)
|
||||
Gizmos.color = Color.yellow;
|
||||
Gizmos.DrawWireSphere(transform.position, playerStopDistance);
|
||||
GameObject playerObj = GameObject.FindGameObjectWithTag("Player");
|
||||
if (playerObj != null)
|
||||
{
|
||||
InteractionComplete?.Invoke(success);
|
||||
Vector3 stopPoint = transform.position +
|
||||
(playerObj.transform.position - transform.position).normalized * playerStopDistance;
|
||||
Gizmos.color = Color.cyan;
|
||||
Gizmos.DrawSphere(stopPoint, 0.15f);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
151
Assets/Scripts/Interactions/ItemSlot.cs
Normal file
151
Assets/Scripts/Interactions/ItemSlot.cs
Normal file
@@ -0,0 +1,151 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
namespace Interactions
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction requirement that allows slotting, swapping, or picking up items in a slot.
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(Interactable))]
|
||||
public class ItemSlot : Pickup
|
||||
{
|
||||
public UnityEvent onItemSlotted;
|
||||
public UnityEvent onItemSlotRemoved;
|
||||
public UnityEvent onCorrectItemSlotted;
|
||||
public UnityEvent onIncorrectItemSlotted;
|
||||
public UnityEvent onForbiddenItemSlotted;
|
||||
private PickupItemData _currentlySlottedItemData;
|
||||
public SpriteRenderer slottedItemRenderer;
|
||||
private GameObject _currentlySlottedItemObject = null;
|
||||
|
||||
public GameObject GetSlottedObject()
|
||||
{
|
||||
return _currentlySlottedItemObject;
|
||||
}
|
||||
|
||||
public void SetSlottedObject(GameObject obj)
|
||||
{
|
||||
_currentlySlottedItemObject = obj;
|
||||
if (_currentlySlottedItemObject != null)
|
||||
{
|
||||
_currentlySlottedItemObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnCharacterArrived()
|
||||
{
|
||||
var heldItemData = FollowerController.CurrentlyHeldItemData;
|
||||
var heldItemObj = FollowerController.GetHeldPickupObject();
|
||||
var config = GameManager.Instance.GetSlotItemConfig(itemData);
|
||||
var forbidden = config?.forbiddenItems ?? new List<PickupItemData>();
|
||||
|
||||
// Held item, slot empty -> try to slot item
|
||||
if (heldItemData != null && _currentlySlottedItemObject == null)
|
||||
{
|
||||
// First check for forbidden items at the very start so we don't continue unnecessarily
|
||||
if (PickupItemData.ListContainsEquivalent(forbidden, heldItemData))
|
||||
{
|
||||
DebugUIMessage.Show("Can't place that here.", Color.red);
|
||||
onForbiddenItemSlotted?.Invoke();
|
||||
Interactable.BroadcastInteractionComplete(false);
|
||||
return;
|
||||
}
|
||||
|
||||
SlotItem(heldItemObj, heldItemData, true);
|
||||
return;
|
||||
}
|
||||
|
||||
// Either pickup or swap items
|
||||
if ((heldItemData == null && _currentlySlottedItemObject != null)
|
||||
|| (heldItemData != null && _currentlySlottedItemObject != null))
|
||||
{
|
||||
FollowerController.TryPickupItem(_currentlySlottedItemObject, _currentlySlottedItemData, false);
|
||||
onItemSlotRemoved?.Invoke();
|
||||
SlotItem(heldItemObj, heldItemData, _currentlySlottedItemObject == null);
|
||||
return;
|
||||
}
|
||||
|
||||
// No held item, slot empty -> show warning
|
||||
if (heldItemData == null && _currentlySlottedItemObject == null)
|
||||
{
|
||||
DebugUIMessage.Show("This requires an item.", Color.red);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the sprite and scale for the currently slotted item.
|
||||
/// </summary>
|
||||
private void UpdateSlottedSprite()
|
||||
{
|
||||
if (slottedItemRenderer != null && _currentlySlottedItemData != null && _currentlySlottedItemData.mapSprite != null)
|
||||
{
|
||||
slottedItemRenderer.sprite = _currentlySlottedItemData.mapSprite;
|
||||
// Scale sprite to desired height, preserve aspect ratio, compensate for parent scale
|
||||
float desiredHeight = GameManager.Instance.HeldIconDisplayHeight;
|
||||
var sprite = _currentlySlottedItemData.mapSprite;
|
||||
float spriteHeight = sprite.bounds.size.y;
|
||||
float spriteWidth = sprite.bounds.size.x;
|
||||
Vector3 parentScale = slottedItemRenderer.transform.parent != null
|
||||
? slottedItemRenderer.transform.parent.localScale
|
||||
: Vector3.one;
|
||||
if (spriteHeight > 0f)
|
||||
{
|
||||
float uniformScale = desiredHeight / spriteHeight;
|
||||
float scale = uniformScale / Mathf.Max(parentScale.x, parentScale.y);
|
||||
slottedItemRenderer.transform.localScale = new Vector3(scale, scale, 1f);
|
||||
}
|
||||
}
|
||||
else if (slottedItemRenderer != null)
|
||||
{
|
||||
slottedItemRenderer.sprite = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void SlotItem(GameObject itemToSlot, PickupItemData itemToSlotData, bool clearFollowerHeldItem = true)
|
||||
{
|
||||
if (itemToSlot == null)
|
||||
{
|
||||
_currentlySlottedItemObject = null;
|
||||
_currentlySlottedItemData = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
itemToSlot.SetActive(false);
|
||||
itemToSlot.transform.SetParent(null);
|
||||
SetSlottedObject(itemToSlot);
|
||||
_currentlySlottedItemData = itemToSlotData;
|
||||
}
|
||||
if (clearFollowerHeldItem)
|
||||
{
|
||||
FollowerController.ClearHeldItem();
|
||||
}
|
||||
UpdateSlottedSprite();
|
||||
|
||||
// Once an item is slotted, we know it is not forbidden, so we can skip that check, but now check if it was
|
||||
// the correct item we're looking for
|
||||
var config = GameManager.Instance.GetSlotItemConfig(itemData);
|
||||
var allowed = config?.allowedItems ?? new List<PickupItemData>();
|
||||
if (PickupItemData.ListContainsEquivalent(allowed, itemToSlotData))
|
||||
{
|
||||
if (itemToSlot != null)
|
||||
{
|
||||
DebugUIMessage.Show("You correctly slotted " + itemToSlotData.itemName + " into: " + itemData.itemName, Color.green);
|
||||
onCorrectItemSlotted?.Invoke();
|
||||
}
|
||||
|
||||
Interactable.BroadcastInteractionComplete(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (itemToSlot != null)
|
||||
{
|
||||
DebugUIMessage.Show("I'm not sure this works.", Color.yellow);
|
||||
onIncorrectItemSlotted?.Invoke();
|
||||
}
|
||||
Interactable.BroadcastInteractionComplete(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using Input;
|
||||
using Interactions;
|
||||
|
||||
/// <summary>
|
||||
/// MonoBehaviour that immediately completes an interaction when started.
|
||||
@@ -13,7 +15,7 @@ public class OneClickInteraction : MonoBehaviour
|
||||
interactable = GetComponent<Interactable>();
|
||||
if (interactable != null)
|
||||
{
|
||||
interactable.StartedInteraction += OnStartedInteraction;
|
||||
interactable.interactionStarted.AddListener(OnInteractionStarted);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,15 +23,15 @@ public class OneClickInteraction : MonoBehaviour
|
||||
{
|
||||
if (interactable != null)
|
||||
{
|
||||
interactable.StartedInteraction -= OnStartedInteraction;
|
||||
interactable.interactionStarted.RemoveListener(OnInteractionStarted);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnStartedInteraction()
|
||||
private void OnInteractionStarted(PlayerTouchController playerRef, FollowerController followerRef)
|
||||
{
|
||||
if (interactable != null)
|
||||
{
|
||||
interactable.CompleteInteraction(true);
|
||||
interactable.BroadcastInteractionComplete(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
using Input;
|
||||
using UnityEngine;
|
||||
|
||||
public class Pickup : MonoBehaviour
|
||||
namespace Interactions
|
||||
{
|
||||
/// <summary>
|
||||
/// Data for the pickup item (icon, name, etc).
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(Interactable))]
|
||||
public class Pickup : MonoBehaviour
|
||||
{
|
||||
public PickupItemData itemData;
|
||||
/// <summary>
|
||||
/// Renderer for the pickup icon.
|
||||
/// </summary>
|
||||
public SpriteRenderer iconRenderer;
|
||||
private Interactable interactable;
|
||||
|
||||
private bool pickupInProgress = false;
|
||||
protected Interactable Interactable;
|
||||
private PlayerTouchController _playerRef;
|
||||
protected FollowerController FollowerController;
|
||||
|
||||
/// <summary>
|
||||
/// Unity Awake callback. Sets up icon, interactable, and event handlers.
|
||||
@@ -22,12 +19,14 @@ public class Pickup : MonoBehaviour
|
||||
{
|
||||
if (iconRenderer == null)
|
||||
iconRenderer = GetComponent<SpriteRenderer>();
|
||||
interactable = GetComponent<Interactable>();
|
||||
if (interactable != null)
|
||||
|
||||
Interactable = GetComponent<Interactable>();
|
||||
if (Interactable != null)
|
||||
{
|
||||
interactable.StartedInteraction += OnStartedInteraction;
|
||||
interactable.InteractionComplete += OnInteractionComplete;
|
||||
Interactable.interactionStarted.AddListener(OnInteractionStarted);
|
||||
Interactable.characterArrived.AddListener(OnCharacterArrived);
|
||||
}
|
||||
|
||||
ApplyItemData();
|
||||
}
|
||||
|
||||
@@ -36,10 +35,10 @@ public class Pickup : MonoBehaviour
|
||||
/// </summary>
|
||||
void OnDestroy()
|
||||
{
|
||||
if (interactable != null)
|
||||
if (Interactable != null)
|
||||
{
|
||||
interactable.StartedInteraction -= OnStartedInteraction;
|
||||
interactable.InteractionComplete -= OnInteractionComplete;
|
||||
Interactable.interactionStarted.RemoveListener(OnInteractionStarted);
|
||||
Interactable.characterArrived.RemoveListener(OnCharacterArrived);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,33 +52,6 @@ public class Pickup : MonoBehaviour
|
||||
iconRenderer = GetComponent<SpriteRenderer>();
|
||||
ApplyItemData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws gizmos for pickup interaction range in the editor.
|
||||
/// </summary>
|
||||
void OnDrawGizmos()
|
||||
{
|
||||
float playerStopDistance;
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
playerStopDistance = GameManager.Instance.PlayerStopDistance;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Load settings directly from asset path in editor
|
||||
var settings = UnityEditor.AssetDatabase.LoadAssetAtPath<GameSettings>("Assets/Data/Settings/DefaultSettings.asset");
|
||||
playerStopDistance = settings != null ? settings.playerStopDistance : 1.0f;
|
||||
}
|
||||
Gizmos.color = Color.yellow;
|
||||
Gizmos.DrawWireSphere(transform.position, playerStopDistance);
|
||||
GameObject playerObj = GameObject.FindGameObjectWithTag("Player");
|
||||
if (playerObj != null)
|
||||
{
|
||||
Vector3 stopPoint = transform.position + (playerObj.transform.position - transform.position).normalized * playerStopDistance;
|
||||
Gizmos.color = Color.cyan;
|
||||
Gizmos.DrawSphere(stopPoint, 0.15f);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
@@ -93,90 +65,31 @@ public class Pickup : MonoBehaviour
|
||||
{
|
||||
iconRenderer.sprite = itemData.mapSprite;
|
||||
}
|
||||
|
||||
gameObject.name = itemData.itemName;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles the start of an interaction (player approaches, then follower picks up).
|
||||
/// Handles the start of an interaction (for feedback/UI only).
|
||||
/// </summary>
|
||||
private void OnStartedInteraction()
|
||||
private void OnInteractionStarted(PlayerTouchController playerRef, FollowerController followerRef)
|
||||
{
|
||||
if (pickupInProgress) return;
|
||||
var playerObj = GameObject.FindGameObjectWithTag("Player");
|
||||
var followerObj = GameObject.FindGameObjectWithTag("Pulver");
|
||||
if (playerObj == null || followerObj == null)
|
||||
{
|
||||
Debug.LogWarning("Pickup: Player or Follower not found.");
|
||||
return;
|
||||
}
|
||||
var playerController = playerObj.GetComponent<PlayerTouchController>();
|
||||
var followerController = followerObj.GetComponent<FollowerController>();
|
||||
if (playerController == null || followerController == null)
|
||||
{
|
||||
Debug.LogWarning("Pickup: PlayerTouchController or FollowerController missing.");
|
||||
return;
|
||||
}
|
||||
float playerStopDistance = GameManager.Instance.PlayerStopDistance;
|
||||
float followerPickupDelay = GameManager.Instance.FollowerPickupDelay;
|
||||
// --- Local event/coroutine handlers ---
|
||||
void OnPlayerArrived()
|
||||
{
|
||||
playerController.OnArrivedAtTarget -= OnPlayerArrived;
|
||||
playerController.OnMoveToCancelled -= OnPlayerMoveCancelled;
|
||||
pickupInProgress = true;
|
||||
StartCoroutine(DispatchFollower());
|
||||
}
|
||||
void OnPlayerMoveCancelled()
|
||||
{
|
||||
playerController.OnArrivedAtTarget -= OnPlayerArrived;
|
||||
playerController.OnMoveToCancelled -= OnPlayerMoveCancelled;
|
||||
pickupInProgress = false;
|
||||
}
|
||||
System.Collections.IEnumerator DispatchFollower()
|
||||
{
|
||||
yield return new WaitForSeconds(followerPickupDelay);
|
||||
followerController.OnPickupArrived += OnFollowerArrived;
|
||||
followerController.OnPickupReturned += OnFollowerReturned;
|
||||
followerController.GoToPointAndReturn(transform.position, playerObj.transform);
|
||||
}
|
||||
void OnFollowerArrived()
|
||||
{
|
||||
followerController.OnPickupArrived -= OnFollowerArrived;
|
||||
bool interactionSuccess = true;
|
||||
if (interactable != null)
|
||||
{
|
||||
interactionSuccess = interactable.OnFollowerArrived(followerController);
|
||||
}
|
||||
followerController.SetInteractionResult(interactionSuccess);
|
||||
}
|
||||
void OnFollowerReturned()
|
||||
{
|
||||
followerController.OnPickupReturned -= OnFollowerReturned;
|
||||
pickupInProgress = false;
|
||||
}
|
||||
playerController.OnArrivedAtTarget += OnPlayerArrived;
|
||||
playerController.OnMoveToCancelled += OnPlayerMoveCancelled;
|
||||
Vector3 stopPoint = transform.position + (playerObj.transform.position - transform.position).normalized * playerStopDistance;
|
||||
float distToPickup = Vector2.Distance(new Vector2(playerObj.transform.position.x, playerObj.transform.position.y), new Vector2(transform.position.x, transform.position.y));
|
||||
float dist = Vector2.Distance(new Vector2(playerObj.transform.position.x, playerObj.transform.position.y), new Vector2(stopPoint.x, stopPoint.y));
|
||||
if (distToPickup <= playerStopDistance || dist <= 0.2f)
|
||||
{
|
||||
OnPlayerArrived();
|
||||
}
|
||||
else
|
||||
{
|
||||
playerController.MoveToAndNotify(stopPoint);
|
||||
}
|
||||
_playerRef = playerRef;
|
||||
FollowerController = followerRef;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles completion of the interaction (e.g., after pickup is done).
|
||||
/// </summary>
|
||||
/// <param name="success">Whether the interaction was successful.</param>
|
||||
private void OnInteractionComplete(bool success)
|
||||
protected virtual void OnCharacterArrived()
|
||||
{
|
||||
if (!success) return;
|
||||
// Optionally, add logic to disable the pickup or provide feedback
|
||||
var combinationResult = FollowerController.TryCombineItems(this, out var combinationResultItem);
|
||||
if (combinationResultItem != null)
|
||||
{
|
||||
Interactable.BroadcastInteractionComplete(true);
|
||||
return;
|
||||
}
|
||||
|
||||
FollowerController?.TryPickupItem(gameObject, itemData);
|
||||
Interactable.BroadcastInteractionComplete(combinationResult == FollowerController.CombinationResult.NotApplicable);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
[CreateAssetMenu(fileName = "PickupItemData", menuName = "Game/Pickup Item Data")]
|
||||
public class PickupItemData : ScriptableObject
|
||||
@@ -7,4 +8,22 @@ public class PickupItemData : ScriptableObject
|
||||
[TextArea]
|
||||
public string description;
|
||||
public Sprite mapSprite;
|
||||
|
||||
public static bool AreEquivalent(PickupItemData a, PickupItemData b)
|
||||
{
|
||||
if (ReferenceEquals(a, b)) return true;
|
||||
if (a is null || b is null) return false;
|
||||
// Compare by itemName as a fallback
|
||||
return a.itemName == b.itemName;
|
||||
}
|
||||
|
||||
public static bool ListContainsEquivalent(List<PickupItemData> list, PickupItemData item)
|
||||
{
|
||||
foreach (var entry in list)
|
||||
{
|
||||
if (AreEquivalent(entry, item))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Interaction requirement that checks if the follower is holding a specific required item.
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(Interactable))]
|
||||
public class RequiresItemBehavior : InteractionRequirementBase
|
||||
{
|
||||
[Header("Required Item")]
|
||||
public PickupItemData requiredItem;
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to interact, succeeds only if the follower is holding the required item.
|
||||
/// </summary>
|
||||
/// <param name="follower">The follower attempting the interaction.</param>
|
||||
/// <returns>True if the interaction was successful, false otherwise.</returns>
|
||||
public override bool TryInteract(FollowerController follower)
|
||||
{
|
||||
var heldItem = follower.CurrentlyHeldItem;
|
||||
if (heldItem == requiredItem)
|
||||
{
|
||||
OnSuccess?.Invoke();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
string requiredName = requiredItem != null ? requiredItem.itemName : "required item";
|
||||
if (heldItem == null)
|
||||
{
|
||||
DebugUIMessage.Show($"You need {requiredName} to interact.");
|
||||
}
|
||||
else
|
||||
{
|
||||
string heldName = heldItem.itemName ?? "an item";
|
||||
DebugUIMessage.Show($"You need {requiredName}, but you are holding {heldName}.");
|
||||
}
|
||||
OnFailure?.Invoke();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31103d67032c44a9b95ec014babe2c62
|
||||
timeCreated: 1756981777
|
||||
@@ -1,164 +0,0 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using System.Collections.Generic;
|
||||
|
||||
/// <summary>
|
||||
/// Interaction requirement that allows slotting, swapping, or picking up items in a slot.
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(Interactable))]
|
||||
[RequireComponent(typeof(Pickup))]
|
||||
public class SlotItemBehavior : InteractionRequirementBase
|
||||
{
|
||||
[Header("Slot State")]
|
||||
/// <summary>
|
||||
/// The item currently slotted in this slot.
|
||||
/// </summary>
|
||||
public PickupItemData currentlySlottedItem;
|
||||
/// <summary>
|
||||
/// The renderer for the slotted item's sprite.
|
||||
/// </summary>
|
||||
public SpriteRenderer slottedItemRenderer;
|
||||
|
||||
private GameObject _cachedSlottedObject = null;
|
||||
|
||||
// Helper for slotting an object, with option to skip destruction (for swap)
|
||||
private void SetSlottedObject(GameObject obj)
|
||||
{
|
||||
_cachedSlottedObject = obj;
|
||||
if (_cachedSlottedObject != null)
|
||||
{
|
||||
_cachedSlottedObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void RemoveSlottedObject()
|
||||
{
|
||||
if (_cachedSlottedObject != null)
|
||||
{
|
||||
Destroy(_cachedSlottedObject);
|
||||
_cachedSlottedObject = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void CacheSlottedObject(GameObject obj)
|
||||
{
|
||||
// Only destroy if not swapping
|
||||
RemoveSlottedObject();
|
||||
SetSlottedObject(obj);
|
||||
}
|
||||
|
||||
private void RestoreSlottedObject(Vector3 position)
|
||||
{
|
||||
if (_cachedSlottedObject != null)
|
||||
{
|
||||
_cachedSlottedObject.transform.position = position;
|
||||
_cachedSlottedObject.transform.SetParent(null);
|
||||
_cachedSlottedObject.SetActive(true);
|
||||
_cachedSlottedObject = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to interact with the slot, handling slotting, swapping, or picking up items.
|
||||
/// </summary>
|
||||
/// <param name="follower">The follower attempting the interaction.</param>
|
||||
/// <returns>True if the interaction was successful, false otherwise.</returns>
|
||||
public override bool TryInteract(FollowerController follower)
|
||||
{
|
||||
var heldItem = follower.CurrentlyHeldItem;
|
||||
var heldObj = follower.GetHeldPickupObject();
|
||||
var pickup = GetComponent<Pickup>();
|
||||
var slotItem = pickup != null ? pickup.itemData : null;
|
||||
var config = GameManager.Instance.GetSlotItemConfig(slotItem);
|
||||
var allowed = config?.allowedItems ?? new List<PickupItemData>();
|
||||
var forbidden = config?.forbiddenItems ?? new List<PickupItemData>();
|
||||
|
||||
// CASE 1: No held item, slot has item -> pick up slotted item
|
||||
if (heldItem == null && _cachedSlottedObject != null)
|
||||
{
|
||||
follower.SetHeldItemFromObject(_cachedSlottedObject);
|
||||
RemoveSlottedObject();
|
||||
currentlySlottedItem = null;
|
||||
UpdateSlottedSprite();
|
||||
return true;
|
||||
}
|
||||
// CASE 2: Held item, slot has item -> swap
|
||||
if (heldItem != null && _cachedSlottedObject != null)
|
||||
{
|
||||
var followerHeldObj = heldObj;
|
||||
var followerHeldItem = heldItem;
|
||||
var slotObj = _cachedSlottedObject;
|
||||
var slotItemData = currentlySlottedItem;
|
||||
|
||||
// 1. Slot the follower's held object (do NOT destroy the old one)
|
||||
SetSlottedObject(followerHeldObj);
|
||||
currentlySlottedItem = followerHeldItem;
|
||||
UpdateSlottedSprite();
|
||||
|
||||
// 2. Give the slot's object to the follower
|
||||
follower.SetHeldItemFromObject(slotObj);
|
||||
|
||||
return true;
|
||||
}
|
||||
// CASE 3: Held item, slot empty -> slot the held item
|
||||
if (heldItem != null && _cachedSlottedObject == null)
|
||||
{
|
||||
if (forbidden.Contains(heldItem))
|
||||
{
|
||||
DebugUIMessage.Show("Can't place that here.");
|
||||
return false;
|
||||
}
|
||||
CacheSlottedObject(heldObj);
|
||||
currentlySlottedItem = heldItem;
|
||||
UpdateSlottedSprite();
|
||||
follower.ClearHeldItem();
|
||||
if (allowed.Contains(heldItem))
|
||||
{
|
||||
OnSuccess?.Invoke();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugUIMessage.Show("I'm not sure this works.");
|
||||
OnFailure?.Invoke();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// CASE 4: No held item, slot empty -> show warning
|
||||
if (heldItem == null && _cachedSlottedObject == null)
|
||||
{
|
||||
DebugUIMessage.Show("This requires an item.");
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the sprite and scale for the currently slotted item.
|
||||
/// </summary>
|
||||
private void UpdateSlottedSprite()
|
||||
{
|
||||
if (slottedItemRenderer != null && currentlySlottedItem != null && currentlySlottedItem.mapSprite != null)
|
||||
{
|
||||
slottedItemRenderer.sprite = currentlySlottedItem.mapSprite;
|
||||
// Scale sprite to desired height, preserve aspect ratio, compensate for parent scale
|
||||
float desiredHeight = GameManager.Instance.HeldIconDisplayHeight;
|
||||
var sprite = currentlySlottedItem.mapSprite;
|
||||
float spriteHeight = sprite.bounds.size.y;
|
||||
float spriteWidth = sprite.bounds.size.x;
|
||||
Vector3 parentScale = slottedItemRenderer.transform.parent != null
|
||||
? slottedItemRenderer.transform.parent.localScale
|
||||
: Vector3.one;
|
||||
if (spriteHeight > 0f)
|
||||
{
|
||||
float uniformScale = desiredHeight / spriteHeight;
|
||||
float scale = uniformScale / Mathf.Max(parentScale.x, parentScale.y);
|
||||
slottedItemRenderer.transform.localScale = new Vector3(scale, scale, 1f);
|
||||
}
|
||||
}
|
||||
else if (slottedItemRenderer != null)
|
||||
{
|
||||
slottedItemRenderer.sprite = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using Input;
|
||||
using Interactions;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
@@ -26,7 +28,7 @@ public class LevelSwitch : MonoBehaviour
|
||||
_interactable = GetComponent<Interactable>();
|
||||
if (_interactable != null)
|
||||
{
|
||||
_interactable.StartedInteraction += OnStartedInteraction;
|
||||
_interactable.characterArrived.AddListener(OnCharacterArrived);
|
||||
}
|
||||
ApplySwitchData();
|
||||
}
|
||||
@@ -38,7 +40,7 @@ public class LevelSwitch : MonoBehaviour
|
||||
{
|
||||
if (_interactable != null)
|
||||
{
|
||||
_interactable.StartedInteraction -= OnStartedInteraction;
|
||||
_interactable.characterArrived.RemoveListener(OnCharacterArrived);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +73,7 @@ public class LevelSwitch : MonoBehaviour
|
||||
/// <summary>
|
||||
/// Handles the start of an interaction (shows confirmation menu and switches the level if confirmed).
|
||||
/// </summary>
|
||||
private void OnStartedInteraction()
|
||||
private void OnCharacterArrived()
|
||||
{
|
||||
if (switchData == null || string.IsNullOrEmpty(switchData.targetLevelSceneName) || !_isActive)
|
||||
return;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using Interactions;
|
||||
using UnityEngine;
|
||||
using Pathfinding;
|
||||
using UnityEngine.SceneManagement;
|
||||
using Utils;
|
||||
@@ -6,7 +7,7 @@ using Utils;
|
||||
/// <summary>
|
||||
/// Controls the follower character, including following the player, handling pickups, and managing held items.
|
||||
/// </summary>
|
||||
public class FollowerController : MonoBehaviour
|
||||
public class FollowerController: MonoBehaviour
|
||||
{
|
||||
[Header("Follower Settings")]
|
||||
public bool debugDrawTarget = true;
|
||||
@@ -19,6 +20,7 @@ public class FollowerController : MonoBehaviour
|
||||
/// </summary>
|
||||
public float manualMoveSmooth = 8f;
|
||||
|
||||
private GameObject _playerRef;
|
||||
private Transform _playerTransform;
|
||||
private AIPath _playerAIPath;
|
||||
private AIPath _aiPath;
|
||||
@@ -29,10 +31,13 @@ public class FollowerController : MonoBehaviour
|
||||
private float _currentSpeed = 0f;
|
||||
private Animator _animator;
|
||||
private Transform _artTransform;
|
||||
private SpriteRenderer spriteRenderer;
|
||||
private SpriteRenderer _spriteRenderer;
|
||||
|
||||
private PickupItemData _currentlyHeldItemData;
|
||||
public PickupItemData CurrentlyHeldItemData => _currentlyHeldItemData;
|
||||
private GameObject _cachedPickupObject = null;
|
||||
public bool justCombined = false;
|
||||
|
||||
private PickupItemData _currentlyHeldItem;
|
||||
public PickupItemData CurrentlyHeldItem => _currentlyHeldItem;
|
||||
/// <summary>
|
||||
/// Renderer for the held item icon.
|
||||
/// </summary>
|
||||
@@ -55,26 +60,7 @@ public class FollowerController : MonoBehaviour
|
||||
public event FollowerPickupHandler OnPickupReturned;
|
||||
private Coroutine _pickupCoroutine;
|
||||
|
||||
private bool _lastInteractionSuccess = true;
|
||||
|
||||
/// <summary>
|
||||
/// Cache for the currently picked-up GameObject (hidden while held).
|
||||
/// </summary>
|
||||
private GameObject _cachedPickupObject = null;
|
||||
public bool justCombined = false;
|
||||
|
||||
/// <summary>
|
||||
/// Caches the given pickup object as the currently held item, hides it, and parents it to the follower.
|
||||
/// </summary>
|
||||
public void CacheHeldPickupObject(GameObject obj)
|
||||
{
|
||||
// Do not destroy the previous object; just replace and hide
|
||||
_cachedPickupObject = obj;
|
||||
if (_cachedPickupObject != null)
|
||||
{
|
||||
_cachedPickupObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
private Input.PlayerTouchController _playerTouchController;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
@@ -84,12 +70,12 @@ public class FollowerController : MonoBehaviour
|
||||
if (_artTransform != null)
|
||||
{
|
||||
_animator = _artTransform.GetComponent<Animator>();
|
||||
spriteRenderer = _artTransform.GetComponent<SpriteRenderer>();
|
||||
_spriteRenderer = _artTransform.GetComponent<SpriteRenderer>();
|
||||
}
|
||||
else
|
||||
{
|
||||
_animator = GetComponentInChildren<Animator>(); // fallback
|
||||
spriteRenderer = GetComponentInChildren<SpriteRenderer>();
|
||||
_spriteRenderer = GetComponentInChildren<SpriteRenderer>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,37 +95,6 @@ public class FollowerController : MonoBehaviour
|
||||
FindPlayerReference();
|
||||
}
|
||||
|
||||
void UpdateFollowTarget()
|
||||
{
|
||||
if (_playerTransform == null)
|
||||
{
|
||||
FindPlayerReference();
|
||||
if (_playerTransform == null)
|
||||
return;
|
||||
}
|
||||
if (_isManualFollowing)
|
||||
{
|
||||
Vector3 playerPos = _playerTransform.position;
|
||||
Vector3 moveDir = Vector3.zero;
|
||||
if (_playerAIPath != null && _playerAIPath.velocity.magnitude > 0.01f)
|
||||
{
|
||||
moveDir = _playerAIPath.velocity.normalized;
|
||||
_lastMoveDir = moveDir;
|
||||
}
|
||||
else
|
||||
{
|
||||
moveDir = _lastMoveDir;
|
||||
}
|
||||
// Use GameSettings for followDistance
|
||||
_targetPoint = playerPos - moveDir * GameManager.Instance.FollowDistance;
|
||||
_targetPoint.z = 0;
|
||||
if (_aiPath != null)
|
||||
{
|
||||
_aiPath.enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (_playerTransform == null)
|
||||
@@ -185,12 +140,12 @@ public class FollowerController : MonoBehaviour
|
||||
}
|
||||
Vector3 dir = (_targetPoint - transform.position).normalized;
|
||||
// Sprite flipping based on movement direction
|
||||
if (spriteRenderer != null && dir.sqrMagnitude > 0.001f)
|
||||
if (_spriteRenderer != null && dir.sqrMagnitude > 0.001f)
|
||||
{
|
||||
if (dir.x > 0.01f)
|
||||
spriteRenderer.flipX = false;
|
||||
_spriteRenderer.flipX = false;
|
||||
else if (dir.x < -0.01f)
|
||||
spriteRenderer.flipX = true;
|
||||
_spriteRenderer.flipX = true;
|
||||
}
|
||||
transform.position += dir * _currentSpeed * Time.deltaTime;
|
||||
}
|
||||
@@ -214,12 +169,12 @@ public class FollowerController : MonoBehaviour
|
||||
{
|
||||
normalizedSpeed = _aiPath.velocity.magnitude / _followerMaxSpeed;
|
||||
// Sprite flipping for pathfinding mode
|
||||
if (spriteRenderer != null && _aiPath.velocity.sqrMagnitude > 0.001f)
|
||||
if (_spriteRenderer != null && _aiPath.velocity.sqrMagnitude > 0.001f)
|
||||
{
|
||||
if (_aiPath.velocity.x > 0.01f)
|
||||
spriteRenderer.flipX = false;
|
||||
_spriteRenderer.flipX = false;
|
||||
else if (_aiPath.velocity.x < -0.01f)
|
||||
spriteRenderer.flipX = true;
|
||||
_spriteRenderer.flipX = true;
|
||||
}
|
||||
}
|
||||
_animator.SetFloat("Speed", Mathf.Clamp01(normalizedSpeed));
|
||||
@@ -231,8 +186,10 @@ public class FollowerController : MonoBehaviour
|
||||
GameObject playerObj = GameObject.FindGameObjectWithTag("Player");
|
||||
if (playerObj != null)
|
||||
{
|
||||
_playerRef = playerObj;
|
||||
_playerTransform = playerObj.transform;
|
||||
_playerAIPath = playerObj.GetComponent<AIPath>();
|
||||
_playerTouchController = playerObj.GetComponent<Input.PlayerTouchController>();
|
||||
if (_playerAIPath != null)
|
||||
{
|
||||
_playerMaxSpeed = _playerAIPath.maxSpeed;
|
||||
@@ -244,6 +201,49 @@ public class FollowerController : MonoBehaviour
|
||||
{
|
||||
_playerTransform = null;
|
||||
_playerAIPath = null;
|
||||
_playerTouchController = null;
|
||||
}
|
||||
}
|
||||
|
||||
#region Movement
|
||||
/// <summary>
|
||||
/// Updates the follower's target point to follow the player at a specified distance,
|
||||
/// using the player's current movement direction if available. Disables pathfinding
|
||||
/// when in manual following mode.
|
||||
/// </summary>
|
||||
void UpdateFollowTarget()
|
||||
{
|
||||
if (_playerTransform == null)
|
||||
{
|
||||
FindPlayerReference();
|
||||
if (_playerTransform == null)
|
||||
return;
|
||||
}
|
||||
if (_isManualFollowing)
|
||||
{
|
||||
Vector3 playerPos = _playerTransform.position;
|
||||
Vector3 moveDir = Vector3.zero;
|
||||
if (_playerAIPath != null && _playerAIPath.velocity.magnitude > 0.01f)
|
||||
{
|
||||
moveDir = _playerAIPath.velocity.normalized;
|
||||
_lastMoveDir = moveDir;
|
||||
}
|
||||
else if (_playerTouchController != null && _playerTouchController.isHolding && _playerTouchController.LastDirectMoveDir.sqrMagnitude > 0.01f)
|
||||
{
|
||||
moveDir = _playerTouchController.LastDirectMoveDir;
|
||||
_lastMoveDir = moveDir;
|
||||
}
|
||||
else
|
||||
{
|
||||
moveDir = _lastMoveDir;
|
||||
}
|
||||
// Use GameSettings for followDistance
|
||||
_targetPoint = playerPos - moveDir * GameManager.Instance.FollowDistance;
|
||||
_targetPoint.z = 0;
|
||||
if (_aiPath != null)
|
||||
{
|
||||
_aiPath.enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,76 +278,6 @@ public class FollowerController : MonoBehaviour
|
||||
_pickupCoroutine = StartCoroutine(PickupSequence(itemPosition, playerTransform));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the item held by the follower, copying all visual properties from the Pickup's SpriteRenderer.
|
||||
/// </summary>
|
||||
/// <param name="itemData">The item data to set.</param>
|
||||
/// <param name="pickupRenderer">The SpriteRenderer from the Pickup to copy appearance from.</param>
|
||||
public void SetHeldItem(PickupItemData itemData, SpriteRenderer pickupRenderer = null)
|
||||
{
|
||||
_currentlyHeldItem = itemData;
|
||||
if (heldObjectRenderer != null)
|
||||
{
|
||||
if (_currentlyHeldItem != null && pickupRenderer != null)
|
||||
{
|
||||
AppleHillsUtils.CopySpriteRendererProperties(pickupRenderer, heldObjectRenderer);
|
||||
}
|
||||
else
|
||||
{
|
||||
heldObjectRenderer.sprite = null;
|
||||
heldObjectRenderer.enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the result of the last interaction (success or failure).
|
||||
/// </summary>
|
||||
/// <param name="success">True if the last interaction was successful, false otherwise.</param>
|
||||
public void SetInteractionResult(bool success)
|
||||
{
|
||||
_lastInteractionSuccess = success;
|
||||
}
|
||||
|
||||
public GameObject GetHeldPickupObject()
|
||||
{
|
||||
return _cachedPickupObject;
|
||||
}
|
||||
|
||||
public void SetHeldItemFromObject(GameObject obj)
|
||||
{
|
||||
if (obj == null)
|
||||
{
|
||||
ClearHeldItem();
|
||||
return;
|
||||
}
|
||||
var pickup = obj.GetComponent<Pickup>();
|
||||
if (pickup != null)
|
||||
{
|
||||
SetHeldItem(pickup.itemData, pickup.iconRenderer);
|
||||
CacheHeldPickupObject(obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
ClearHeldItem();
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearHeldItem()
|
||||
{
|
||||
if (_cachedPickupObject != null)
|
||||
{
|
||||
// Destroy(_cachedPickupObject);
|
||||
_cachedPickupObject = null;
|
||||
}
|
||||
_currentlyHeldItem = null;
|
||||
if (heldObjectRenderer != null)
|
||||
{
|
||||
heldObjectRenderer.sprite = null;
|
||||
heldObjectRenderer.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private System.Collections.IEnumerator PickupSequence(Vector2 itemPosition, Transform playerTransform)
|
||||
{
|
||||
_isManualFollowing = false;
|
||||
@@ -364,42 +294,7 @@ public class FollowerController : MonoBehaviour
|
||||
yield return null;
|
||||
}
|
||||
OnPickupArrived?.Invoke();
|
||||
// Only perform pickup/swap logic if interaction succeeded
|
||||
if (_lastInteractionSuccess && heldObjectRenderer != null)
|
||||
{
|
||||
Collider2D[] hits = Physics2D.OverlapCircleAll(itemPosition, 0.2f);
|
||||
foreach (var hit in hits)
|
||||
{
|
||||
var pickup = hit.GetComponent<Pickup>();
|
||||
if (pickup != null)
|
||||
{
|
||||
var slotBehavior = pickup.GetComponent<SlotItemBehavior>();
|
||||
if (slotBehavior != null)
|
||||
{
|
||||
// Slot item: do not destroy or swap, just return to player
|
||||
break;
|
||||
}
|
||||
if (justCombined)
|
||||
{
|
||||
GameObject.Destroy(pickup.gameObject);
|
||||
justCombined = false;
|
||||
break;
|
||||
}
|
||||
// Swap logic: if holding an item, drop it here
|
||||
if (_currentlyHeldItem != null && _cachedPickupObject != null)
|
||||
{
|
||||
// Drop the cached object at the pickup's position
|
||||
_cachedPickupObject.transform.position = pickup.transform.position;
|
||||
_cachedPickupObject.transform.SetParent(null);
|
||||
_cachedPickupObject.SetActive(true);
|
||||
_cachedPickupObject = null;
|
||||
}
|
||||
SetHeldItem(pickup.itemData, pickup.iconRenderer);
|
||||
CacheHeldPickupObject(pickup.gameObject);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Wait briefly, then return to player
|
||||
yield return new WaitForSeconds(0.2f);
|
||||
if (_aiPath != null && playerTransform != null)
|
||||
@@ -424,21 +319,72 @@ public class FollowerController : MonoBehaviour
|
||||
_aiPath.enabled = false;
|
||||
_pickupCoroutine = null;
|
||||
}
|
||||
#endregion Movement
|
||||
|
||||
#region ItemInteractions
|
||||
public void TryPickupItem(GameObject itemObject, PickupItemData itemData, bool dropItem = true)
|
||||
{
|
||||
if (_currentlyHeldItemData != null && _cachedPickupObject != null && dropItem)
|
||||
{
|
||||
// Drop the currently held item at the current position
|
||||
DropHeldItemAt(transform.position);
|
||||
}
|
||||
// Pick up the new item
|
||||
SetHeldItem(itemData, itemObject.GetComponent<SpriteRenderer>());
|
||||
_cachedPickupObject = itemObject;
|
||||
_cachedPickupObject.SetActive(false);
|
||||
}
|
||||
|
||||
public enum CombinationResult
|
||||
{
|
||||
Successful,
|
||||
Unsuccessful,
|
||||
NotApplicable
|
||||
}
|
||||
|
||||
public CombinationResult TryCombineItems(Pickup pickupA, out GameObject newItem)
|
||||
{
|
||||
newItem = null;
|
||||
if (_cachedPickupObject == null)
|
||||
{
|
||||
return CombinationResult.NotApplicable;
|
||||
}
|
||||
Pickup pickupB = _cachedPickupObject.GetComponent<Pickup>();
|
||||
if (pickupA == null || pickupB == null)
|
||||
{
|
||||
return CombinationResult.NotApplicable;
|
||||
}
|
||||
var rule = GameManager.Instance.GetCombinationRule(pickupA.itemData, pickupB.itemData);
|
||||
Vector3 spawnPos = pickupA.gameObject.transform.position;
|
||||
if (rule != null && rule.resultPrefab != null)
|
||||
{
|
||||
newItem = Instantiate(rule.resultPrefab, spawnPos, Quaternion.identity);
|
||||
PickupItemData itemData = newItem.GetComponent<Pickup>().itemData;
|
||||
Destroy(pickupA.gameObject);
|
||||
Destroy(pickupB.gameObject);
|
||||
TryPickupItem(newItem,itemData);
|
||||
return CombinationResult.Successful;
|
||||
}
|
||||
|
||||
// If no combination found, return Unsuccessful
|
||||
return CombinationResult.Unsuccessful;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Drop the held item at the specified position, unparenting and activating it.
|
||||
/// Set the item held by the follower, copying all visual properties from the Pickup's SpriteRenderer.
|
||||
/// </summary>
|
||||
/// <param name="position">The world position to drop the item at.</param>
|
||||
public void DropHeldItemAt(Vector3 position)
|
||||
/// <param name="itemData">The item data to set.</param>
|
||||
/// <param name="pickupRenderer">The SpriteRenderer from the Pickup to copy appearance from.</param>
|
||||
public void SetHeldItem(PickupItemData itemData, SpriteRenderer pickupRenderer = null)
|
||||
{
|
||||
if (_cachedPickupObject != null)
|
||||
{
|
||||
_cachedPickupObject.transform.position = position;
|
||||
_cachedPickupObject.transform.SetParent(null);
|
||||
_cachedPickupObject.SetActive(true);
|
||||
_cachedPickupObject = null;
|
||||
_currentlyHeldItem = null;
|
||||
_currentlyHeldItemData = itemData;
|
||||
if (heldObjectRenderer != null)
|
||||
{
|
||||
if (_currentlyHeldItemData != null && pickupRenderer != null)
|
||||
{
|
||||
AppleHillsUtils.CopySpriteRendererProperties(pickupRenderer, heldObjectRenderer);
|
||||
}
|
||||
else
|
||||
{
|
||||
heldObjectRenderer.sprite = null;
|
||||
heldObjectRenderer.enabled = false;
|
||||
@@ -446,6 +392,61 @@ public class FollowerController : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public GameObject GetHeldPickupObject()
|
||||
{
|
||||
return _cachedPickupObject;
|
||||
}
|
||||
|
||||
public void SetHeldItemFromObject(GameObject obj)
|
||||
{
|
||||
if (obj == null)
|
||||
{
|
||||
ClearHeldItem();
|
||||
return;
|
||||
}
|
||||
var pickup = obj.GetComponent<Pickup>();
|
||||
if (pickup != null)
|
||||
{
|
||||
SetHeldItem(pickup.itemData, pickup.iconRenderer);
|
||||
_cachedPickupObject = obj;
|
||||
}
|
||||
else
|
||||
{
|
||||
ClearHeldItem();
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearHeldItem()
|
||||
{
|
||||
_cachedPickupObject = null;
|
||||
_currentlyHeldItemData = null;
|
||||
if (heldObjectRenderer != null)
|
||||
{
|
||||
heldObjectRenderer.sprite = null;
|
||||
heldObjectRenderer.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void DropItem(FollowerController follower, Vector3 position)
|
||||
{
|
||||
var item = follower.GetHeldPickupObject();
|
||||
if (item == null) return;
|
||||
item.transform.position = position;
|
||||
item.transform.SetParent(null);
|
||||
item.SetActive(true);
|
||||
follower.ClearHeldItem();
|
||||
// Optionally: fire event, update UI, etc.
|
||||
}
|
||||
|
||||
public void DropHeldItemAt(Vector3 position)
|
||||
{
|
||||
DropItem(this, position);
|
||||
}
|
||||
|
||||
|
||||
#endregion ItemInteractions
|
||||
|
||||
#if UNITY_EDITOR
|
||||
void OnDrawGizmos()
|
||||
{
|
||||
if (debugDrawTarget && Application.isPlaying)
|
||||
@@ -456,6 +457,5 @@ public class FollowerController : MonoBehaviour
|
||||
Gizmos.DrawLine(transform.position, _targetPoint);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,42 +1,50 @@
|
||||
|
||||
using Input;
|
||||
using Interactions;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Manages the state and interactions for a single puzzle step, including unlock/lock logic and event handling.
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(Interactable))]
|
||||
public class ObjectiveStepBehaviour : MonoBehaviour
|
||||
namespace PuzzleS
|
||||
{
|
||||
/// <summary>
|
||||
/// Manages the state and interactions for a single puzzle step, including unlock/lock logic and event handling.
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(Interactable))]
|
||||
public class ObjectiveStepBehaviour : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// The data object representing this puzzle step.
|
||||
/// </summary>
|
||||
public PuzzleStepSO stepData;
|
||||
private Interactable interactable;
|
||||
private bool isUnlocked = false;
|
||||
private Interactable _interactable;
|
||||
private bool _isUnlocked = false;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
interactable = GetComponent<Interactable>();
|
||||
_interactable = GetComponent<Interactable>();
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (interactable == null)
|
||||
interactable = GetComponent<Interactable>();
|
||||
if (interactable != null)
|
||||
if (_interactable == null)
|
||||
_interactable = GetComponent<Interactable>();
|
||||
if (_interactable != null)
|
||||
{
|
||||
interactable.StartedInteraction += OnStartedInteraction;
|
||||
interactable.InteractionComplete += OnInteractionComplete;
|
||||
_interactable.interactionStarted.AddListener(OnInteractionStarted);
|
||||
_interactable.interactionComplete.AddListener(OnInteractionComplete);
|
||||
}
|
||||
PuzzleManager.Instance?.RegisterStepBehaviour(this);
|
||||
// Check if this step was already unlocked
|
||||
if (stepData != null && PuzzleManager.Instance != null && PuzzleManager.Instance.IsStepUnlocked(stepData))
|
||||
{
|
||||
UnlockStep();
|
||||
}
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
void OnDestroy()
|
||||
{
|
||||
if (interactable != null)
|
||||
if (_interactable != null)
|
||||
{
|
||||
interactable.StartedInteraction -= OnStartedInteraction;
|
||||
interactable.InteractionComplete -= OnInteractionComplete;
|
||||
_interactable.interactionStarted.RemoveListener(OnInteractionStarted);
|
||||
_interactable.interactionComplete.RemoveListener(OnInteractionComplete);
|
||||
}
|
||||
PuzzleManager.Instance?.UnregisterStepBehaviour(this);
|
||||
}
|
||||
@@ -46,7 +54,7 @@ public class ObjectiveStepBehaviour : MonoBehaviour
|
||||
/// </summary>
|
||||
public void UnlockStep()
|
||||
{
|
||||
isUnlocked = true;
|
||||
_isUnlocked = true;
|
||||
Debug.Log($"[Puzzles] Step unlocked: {stepData?.stepId} on {gameObject.name}");
|
||||
// Optionally, show visual feedback for unlocked state
|
||||
}
|
||||
@@ -56,7 +64,7 @@ public class ObjectiveStepBehaviour : MonoBehaviour
|
||||
/// </summary>
|
||||
public void LockStep()
|
||||
{
|
||||
isUnlocked = false;
|
||||
_isUnlocked = false;
|
||||
Debug.Log($"[Puzzles] Step locked: {stepData?.stepId} on {gameObject.name}");
|
||||
// Optionally, show visual feedback for locked state
|
||||
}
|
||||
@@ -66,13 +74,13 @@ public class ObjectiveStepBehaviour : MonoBehaviour
|
||||
/// </summary>
|
||||
public bool IsStepUnlocked()
|
||||
{
|
||||
return isUnlocked;
|
||||
return _isUnlocked;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles the start of an interaction (can be used for visual feedback).
|
||||
/// </summary>
|
||||
private void OnStartedInteraction()
|
||||
private void OnInteractionStarted(PlayerTouchController playerRef, FollowerController followerRef)
|
||||
{
|
||||
// Optionally handle started interaction (e.g. visual feedback)
|
||||
}
|
||||
@@ -83,11 +91,12 @@ public class ObjectiveStepBehaviour : MonoBehaviour
|
||||
/// <param name="success">Whether the interaction was successful.</param>
|
||||
private void OnInteractionComplete(bool success)
|
||||
{
|
||||
if (!isUnlocked) return;
|
||||
if (!_isUnlocked) return;
|
||||
if (success)
|
||||
{
|
||||
Debug.Log($"[Puzzles] Step interacted: {stepData?.stepId} on {gameObject.name}");
|
||||
PuzzleManager.Instance?.OnStepCompleted(stepData);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using PuzzleS;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
/// <summary>
|
||||
/// Manages puzzle step registration, dependency management, and step completion for the puzzle system.
|
||||
@@ -43,6 +45,18 @@ public class PuzzleManager : MonoBehaviour
|
||||
{
|
||||
_instance = this;
|
||||
// DontDestroyOnLoad(gameObject);
|
||||
SceneManager.sceneLoaded += OnSceneLoaded;
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
SceneManager.sceneLoaded -= OnSceneLoaded;
|
||||
}
|
||||
|
||||
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
|
||||
{
|
||||
BuildRuntimeDependencies();
|
||||
UnlockInitialSteps();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -70,12 +84,6 @@ public class PuzzleManager : MonoBehaviour
|
||||
Debug.Log($"[Puzzles] Unregistered step: {behaviour.stepData.stepId} on {behaviour.gameObject.name}");
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
BuildRuntimeDependencies();
|
||||
UnlockInitialSteps();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Builds the runtime dependency graph for all registered steps.
|
||||
/// </summary>
|
||||
@@ -171,6 +179,14 @@ public class PuzzleManager : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether a step is already unlocked.
|
||||
/// </summary>
|
||||
public bool IsStepUnlocked(PuzzleStepSO step)
|
||||
{
|
||||
return unlockedSteps.Contains(step);
|
||||
}
|
||||
|
||||
void OnApplicationQuit()
|
||||
{
|
||||
_isQuitting = true;
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class MainMenu : MonoBehaviour
|
||||
{
|
||||
public void StartGame()
|
||||
public async void StartGame()
|
||||
{
|
||||
// Replace with the actual scene name as set in Build Settings
|
||||
SceneManager.LoadScene("AppleHillsOverworld");
|
||||
var progress = new Progress<float>(p => Debug.Log($"Loading progress: {p * 100:F0}%"));
|
||||
await SceneManagerService.Instance.SwitchSceneAsync("AppleHillsOverworld", progress);
|
||||
}
|
||||
|
||||
public void QuitGame()
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Utils
|
||||
to.color = from.color;
|
||||
to.flipX = from.flipX;
|
||||
to.flipY = from.flipY;
|
||||
to.material = from.material;
|
||||
to.sharedMaterial = from.sharedMaterial; // Use sharedMaterial instead of material to avoid instantiation in edit mode
|
||||
to.drawMode = from.drawMode;
|
||||
to.size = from.size;
|
||||
to.maskInteraction = from.maskInteraction;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d863bca9b2680743bd08a98ae378772
|
||||
guid: 69ae0bad39b0d4047b207ef833c6a8f2
|
||||
folderAsset: yes
|
||||
timeCreated: 1522266281
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,9 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 53b6a515c1f2ee049862496c7b3cece4
|
||||
guid: cd088c42a70189a488a25c4c87093e47
|
||||
folderAsset: yes
|
||||
timeCreated: 1521850290
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
188
Assets/Tests/EditMode/AppleHillsUtilsTests.cs
Normal file
188
Assets/Tests/EditMode/AppleHillsUtilsTests.cs
Normal file
@@ -0,0 +1,188 @@
|
||||
using NUnit.Framework;
|
||||
using UnityEngine;
|
||||
using Utils;
|
||||
using UnityEngine.TestTools;
|
||||
|
||||
namespace Tests.EditMode
|
||||
{
|
||||
public class AppleHillsUtilsTests
|
||||
{
|
||||
private GameObject sourceObject;
|
||||
private GameObject targetObject;
|
||||
private SpriteRenderer sourceRenderer;
|
||||
private SpriteRenderer targetRenderer;
|
||||
private Sprite testSprite1;
|
||||
private Sprite testSprite2;
|
||||
private Material testMaterial1;
|
||||
private Material testMaterial2;
|
||||
|
||||
[SetUp]
|
||||
public void SetUp()
|
||||
{
|
||||
// Create test GameObjects with SpriteRenderer components
|
||||
sourceObject = new GameObject("SourceObject");
|
||||
targetObject = new GameObject("TargetObject");
|
||||
sourceRenderer = sourceObject.AddComponent<SpriteRenderer>();
|
||||
targetRenderer = targetObject.AddComponent<SpriteRenderer>();
|
||||
|
||||
// Create test sprites (1x1 pixel textures)
|
||||
Texture2D texture1 = new Texture2D(1, 1);
|
||||
texture1.SetPixel(0, 0, Color.red);
|
||||
texture1.Apply();
|
||||
testSprite1 = Sprite.Create(texture1, new Rect(0, 0, 1, 1), Vector2.zero);
|
||||
|
||||
Texture2D texture2 = new Texture2D(1, 1);
|
||||
texture2.SetPixel(0, 0, Color.blue);
|
||||
texture2.Apply();
|
||||
testSprite2 = Sprite.Create(texture2, new Rect(0, 0, 1, 1), Vector2.zero);
|
||||
|
||||
// Create test materials
|
||||
testMaterial1 = new Material(Shader.Find("Sprites/Default"));
|
||||
testMaterial1.name = "TestMaterial1";
|
||||
testMaterial2 = new Material(Shader.Find("Sprites/Default"));
|
||||
testMaterial2.name = "TestMaterial2";
|
||||
|
||||
// Initialize target with different values to ensure they change
|
||||
targetRenderer.sprite = testSprite2;
|
||||
targetRenderer.color = Color.blue;
|
||||
targetRenderer.flipX = true;
|
||||
targetRenderer.flipY = true;
|
||||
targetRenderer.sharedMaterial = testMaterial2;
|
||||
targetRenderer.drawMode = SpriteDrawMode.Tiled;
|
||||
targetRenderer.size = new Vector2(10, 10);
|
||||
targetRenderer.maskInteraction = SpriteMaskInteraction.VisibleInsideMask;
|
||||
targetRenderer.sortingOrder = 10;
|
||||
targetRenderer.enabled = false;
|
||||
targetObject.transform.localScale = new Vector3(2, 2, 2);
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
// Clean up created objects
|
||||
Object.DestroyImmediate(sourceObject);
|
||||
Object.DestroyImmediate(targetObject);
|
||||
Object.DestroyImmediate(testSprite1);
|
||||
Object.DestroyImmediate(testSprite2);
|
||||
Object.DestroyImmediate(testMaterial1);
|
||||
Object.DestroyImmediate(testMaterial2);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CopySpriteRendererProperties_CopiesAllProperties()
|
||||
{
|
||||
// Arrange - Set source properties
|
||||
sourceRenderer.sprite = testSprite1;
|
||||
sourceRenderer.color = Color.red;
|
||||
sourceRenderer.flipX = false;
|
||||
sourceRenderer.flipY = false;
|
||||
sourceRenderer.sharedMaterial = testMaterial1;
|
||||
sourceRenderer.drawMode = SpriteDrawMode.Simple;
|
||||
sourceRenderer.size = new Vector2(5, 5);
|
||||
sourceRenderer.maskInteraction = SpriteMaskInteraction.VisibleOutsideMask;
|
||||
sourceRenderer.sortingOrder = 5;
|
||||
sourceRenderer.enabled = true;
|
||||
sourceObject.transform.localScale = new Vector3(1, 1, 1);
|
||||
|
||||
// Act
|
||||
AppleHillsUtils.CopySpriteRendererProperties(sourceRenderer, targetRenderer);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(sourceRenderer.sprite, targetRenderer.sprite, "Sprite should be copied");
|
||||
Assert.AreEqual(sourceRenderer.color, targetRenderer.color, "Color should be copied");
|
||||
Assert.AreEqual(sourceRenderer.flipX, targetRenderer.flipX, "FlipX should be copied");
|
||||
Assert.AreEqual(sourceRenderer.flipY, targetRenderer.flipY, "FlipY should be copied");
|
||||
Assert.AreEqual(sourceRenderer.sharedMaterial, targetRenderer.sharedMaterial, "Material should be copied");
|
||||
Assert.AreEqual(sourceRenderer.drawMode, targetRenderer.drawMode, "DrawMode should be copied");
|
||||
Assert.AreEqual(sourceRenderer.size, targetRenderer.size, "Size should be copied");
|
||||
Assert.AreEqual(sourceRenderer.maskInteraction, targetRenderer.maskInteraction, "MaskInteraction should be copied");
|
||||
Assert.AreEqual(sourceRenderer.sortingLayerID, targetRenderer.sortingLayerID, "SortingLayerID should be copied");
|
||||
Assert.AreEqual(sourceRenderer.sortingOrder, targetRenderer.sortingOrder, "SortingOrder should be copied");
|
||||
Assert.IsTrue(targetRenderer.enabled, "Enabled should be set to true");
|
||||
Assert.AreEqual(sourceRenderer.transform.localScale, targetRenderer.transform.localScale, "LocalScale should be copied");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CopySpriteRendererProperties_NullSource_DoesNothing()
|
||||
{
|
||||
// Arrange - Store original values
|
||||
var originalSprite = targetRenderer.sprite;
|
||||
var originalColor = targetRenderer.color;
|
||||
var originalFlipX = targetRenderer.flipX;
|
||||
var originalFlipY = targetRenderer.flipY;
|
||||
var originalMaterial = targetRenderer.sharedMaterial;
|
||||
var originalDrawMode = targetRenderer.drawMode;
|
||||
var originalSize = targetRenderer.size;
|
||||
var originalMaskInteraction = targetRenderer.maskInteraction;
|
||||
var originalSortingLayerID = targetRenderer.sortingLayerID;
|
||||
var originalSortingOrder = targetRenderer.sortingOrder;
|
||||
var originalEnabled = targetRenderer.enabled;
|
||||
var originalScale = targetRenderer.transform.localScale;
|
||||
|
||||
// Act
|
||||
AppleHillsUtils.CopySpriteRendererProperties(null, targetRenderer);
|
||||
|
||||
// Assert - Nothing should change
|
||||
Assert.AreEqual(originalSprite, targetRenderer.sprite, "Sprite should not change");
|
||||
Assert.AreEqual(originalColor, targetRenderer.color, "Color should not change");
|
||||
Assert.AreEqual(originalFlipX, targetRenderer.flipX, "FlipX should not change");
|
||||
Assert.AreEqual(originalFlipY, targetRenderer.flipY, "FlipY should not change");
|
||||
Assert.AreEqual(originalMaterial, targetRenderer.sharedMaterial, "Material should not change");
|
||||
Assert.AreEqual(originalDrawMode, targetRenderer.drawMode, "DrawMode should not change");
|
||||
Assert.AreEqual(originalSize, targetRenderer.size, "Size should not change");
|
||||
Assert.AreEqual(originalMaskInteraction, targetRenderer.maskInteraction, "MaskInteraction should not change");
|
||||
Assert.AreEqual(originalSortingLayerID, targetRenderer.sortingLayerID, "SortingLayerID should not change");
|
||||
Assert.AreEqual(originalSortingOrder, targetRenderer.sortingOrder, "SortingOrder should not change");
|
||||
Assert.AreEqual(originalEnabled, targetRenderer.enabled, "Enabled should not change");
|
||||
Assert.AreEqual(originalScale, targetRenderer.transform.localScale, "LocalScale should not change");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CopySpriteRendererProperties_NullTarget_DoesNotThrow()
|
||||
{
|
||||
// Arrange
|
||||
sourceRenderer.sprite = testSprite1;
|
||||
|
||||
// Act & Assert - Should not throw an exception
|
||||
Assert.DoesNotThrow(() => AppleHillsUtils.CopySpriteRendererProperties(sourceRenderer, null));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CopySpriteRendererProperties_BothNull_DoesNotThrow()
|
||||
{
|
||||
// Act & Assert - Should not throw an exception
|
||||
Assert.DoesNotThrow(() => AppleHillsUtils.CopySpriteRendererProperties(null, null));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CopySpriteRendererProperties_DifferentProperties_CorrectlyCopies()
|
||||
{
|
||||
// Arrange - Set source with mixed properties
|
||||
sourceRenderer.sprite = testSprite1;
|
||||
sourceRenderer.color = new Color(0.5f, 0.5f, 0.5f, 0.7f); // Semi-transparent gray
|
||||
sourceRenderer.flipX = true;
|
||||
sourceRenderer.flipY = false;
|
||||
sourceRenderer.sharedMaterial = testMaterial1;
|
||||
sourceRenderer.drawMode = SpriteDrawMode.Sliced;
|
||||
sourceRenderer.size = new Vector2(3.5f, 2.5f);
|
||||
sourceRenderer.sortingOrder = 42;
|
||||
sourceObject.transform.localScale = new Vector3(0.5f, 1.5f, 1f); // Non-uniform scale
|
||||
|
||||
// The exact warning message format matters - match it precisely
|
||||
LogAssert.Expect(LogType.Warning, "Sprite Tiling might not appear correctly because the Sprite used is not generated with Full Rect. To fix this, change the Mesh Type in the Sprite's import setting to Full Rect");
|
||||
|
||||
// Act
|
||||
AppleHillsUtils.CopySpriteRendererProperties(sourceRenderer, targetRenderer);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(testSprite1, targetRenderer.sprite, "Sprite should match");
|
||||
Assert.AreEqual(new Color(0.5f, 0.5f, 0.5f, 0.7f), targetRenderer.color, "Color should match including alpha");
|
||||
Assert.IsTrue(targetRenderer.flipX, "FlipX should be true");
|
||||
Assert.IsFalse(targetRenderer.flipY, "FlipY should be false");
|
||||
Assert.AreEqual(SpriteDrawMode.Sliced, targetRenderer.drawMode, "DrawMode should be Sliced");
|
||||
Assert.AreEqual(new Vector2(3.5f, 2.5f), targetRenderer.size, "Size should match exactly");
|
||||
Assert.AreEqual(42, targetRenderer.sortingOrder, "SortingOrder should be 42");
|
||||
Assert.AreEqual(new Vector3(0.5f, 1.5f, 1f), targetRenderer.transform.localScale, "Non-uniform scale should match");
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Tests/EditMode/AppleHillsUtilsTests.cs.meta
Normal file
3
Assets/Tests/EditMode/AppleHillsUtilsTests.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0c2768f91f9f4455a4d7480f6ee8ef43
|
||||
timeCreated: 1757849036
|
||||
144
Assets/Tests/EditMode/BootstrapTests.cs
Normal file
144
Assets/Tests/EditMode/BootstrapTests.cs
Normal file
@@ -0,0 +1,144 @@
|
||||
using NUnit.Framework;
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using UnityEngine.TestTools;
|
||||
|
||||
namespace Tests.EditMode
|
||||
{
|
||||
public class BootstrapTests
|
||||
{
|
||||
private Bootstrap.CustomBootSettings settings;
|
||||
private GameObject prefab1;
|
||||
private GameObject prefab2;
|
||||
|
||||
[SetUp]
|
||||
public void SetUp()
|
||||
{
|
||||
settings = ScriptableObject.CreateInstance<Bootstrap.CustomBootSettings>();
|
||||
settings.name = "TestSettings";
|
||||
prefab1 = GameObject.CreatePrimitive(PrimitiveType.Cube);
|
||||
prefab1.name = "Prefab1";
|
||||
prefab2 = GameObject.CreatePrimitive(PrimitiveType.Sphere);
|
||||
prefab2.name = "Prefab2";
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
// Settings will clean up the container and instantiated prefabs
|
||||
settings.Cleanup();
|
||||
|
||||
// Clean up the prefab templates
|
||||
if (prefab1 != null) Object.DestroyImmediate(prefab1);
|
||||
if (prefab2 != null) Object.DestroyImmediate(prefab2);
|
||||
if (settings != null) Object.DestroyImmediate(settings);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InitialiseSync_CreatesContainerWithCorrectName()
|
||||
{
|
||||
// Arrange
|
||||
settings.BootPrefabs = new[] { prefab1 };
|
||||
|
||||
// Act
|
||||
settings.InitialiseSync();
|
||||
|
||||
// Access the RuntimeContainer through reflection since it's private
|
||||
var containerField = typeof(Bootstrap.CustomBootSettings).GetField("RuntimeContainer",
|
||||
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
|
||||
var container = containerField.GetValue(settings) as GameObject;
|
||||
|
||||
// Assert
|
||||
Assert.IsNotNull(container, "RuntimeContainer should not be null");
|
||||
Assert.AreEqual($"{settings.name}_Container", container.name,
|
||||
"Container should be named with the pattern {settings.name}_Container");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InitialiseSync_InstantiatesAllPrefabs()
|
||||
{
|
||||
// Arrange
|
||||
settings.BootPrefabs = new[] { prefab1, prefab2 };
|
||||
|
||||
// Act
|
||||
settings.InitialiseSync();
|
||||
|
||||
// Access the RuntimeContainer and Instances through reflection
|
||||
var containerField = typeof(Bootstrap.CustomBootSettings).GetField("RuntimeContainer",
|
||||
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
|
||||
var container = containerField.GetValue(settings) as GameObject;
|
||||
|
||||
var instancesField = typeof(Bootstrap.CustomBootSettings).GetField("Instances",
|
||||
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
|
||||
var instances = instancesField.GetValue(settings) as GameObject[];
|
||||
|
||||
// Assert
|
||||
Assert.IsNotNull(container, "RuntimeContainer should not be null");
|
||||
Assert.AreEqual(2, container.transform.childCount, "Container should have 2 child objects");
|
||||
Assert.IsNotNull(instances, "Instances array should not be null");
|
||||
Assert.AreEqual(2, instances.Length, "Instances array should have 2 elements");
|
||||
|
||||
Assert.IsNotNull(instances[0], "First instance should not be null");
|
||||
Assert.IsTrue(instances[0].name.StartsWith(prefab1.name),
|
||||
$"First instance name '{instances[0].name}' should start with prefab name '{prefab1.name}'");
|
||||
Assert.AreEqual(container.transform, instances[0].transform.parent, "First instance should be a child of the container");
|
||||
|
||||
Assert.IsNotNull(instances[1], "Second instance should not be null");
|
||||
Assert.IsTrue(instances[1].name.StartsWith(prefab2.name),
|
||||
$"Second instance name '{instances[1].name}' should start with prefab name '{prefab2.name}'");
|
||||
Assert.AreEqual(container.transform, instances[1].transform.parent, "Second instance should be a child of the container");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InitialiseSync_HandlesNullPrefabs()
|
||||
{
|
||||
// Arrange
|
||||
settings.BootPrefabs = new GameObject[] { prefab1, null, prefab2 };
|
||||
|
||||
// Act
|
||||
settings.InitialiseSync();
|
||||
|
||||
// Access the RuntimeContainer and Instances through reflection
|
||||
var containerField = typeof(Bootstrap.CustomBootSettings).GetField("RuntimeContainer",
|
||||
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
|
||||
var container = containerField.GetValue(settings) as GameObject;
|
||||
|
||||
var instancesField = typeof(Bootstrap.CustomBootSettings).GetField("Instances",
|
||||
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
|
||||
var instances = instancesField.GetValue(settings) as GameObject[];
|
||||
|
||||
// Assert
|
||||
Assert.IsNotNull(container, "RuntimeContainer should not be null");
|
||||
Assert.AreEqual(2, container.transform.childCount, "Container should have 2 child objects (skipping the null prefab)");
|
||||
Assert.AreEqual(3, instances.Length, "Instances array should have 3 elements (including null)");
|
||||
|
||||
Assert.IsNotNull(instances[0], "First instance should not be null");
|
||||
Assert.IsNull(instances[1], "Second instance should be null");
|
||||
Assert.IsNotNull(instances[2], "Third instance should not be null");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InitialiseSync_EmptyPrefabsArray_CreatesContainerOnly()
|
||||
{
|
||||
// Arrange
|
||||
settings.BootPrefabs = new GameObject[0];
|
||||
|
||||
// Act
|
||||
settings.InitialiseSync();
|
||||
|
||||
// Access the RuntimeContainer through reflection
|
||||
var containerField = typeof(Bootstrap.CustomBootSettings).GetField("RuntimeContainer",
|
||||
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
|
||||
var container = containerField.GetValue(settings) as GameObject;
|
||||
|
||||
var instancesField = typeof(Bootstrap.CustomBootSettings).GetField("Instances",
|
||||
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
|
||||
var instances = instancesField.GetValue(settings) as GameObject[];
|
||||
|
||||
// Assert
|
||||
Assert.IsNotNull(container, "RuntimeContainer should be created even with empty prefabs array");
|
||||
Assert.AreEqual(0, container.transform.childCount, "Container should have no children");
|
||||
Assert.AreEqual(0, instances.Length, "Instances array should be empty");
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Tests/EditMode/BootstrapTests.cs.meta
Normal file
3
Assets/Tests/EditMode/BootstrapTests.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8750f59e7251412a844c51012839ec20
|
||||
timeCreated: 1757845616
|
||||
26
Assets/Tests/EditMode/EditModeTests.asmdef
Normal file
26
Assets/Tests/EditMode/EditModeTests.asmdef
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "Tests",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"UnityEngine.TestRunner",
|
||||
"UnityEditor.TestRunner",
|
||||
"Unity.InputSystem",
|
||||
"Unity.InputSystem.TestFramework",
|
||||
"AppleHillsScripts"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": true,
|
||||
"precompiledReferences": [
|
||||
"nunit.framework.dll"
|
||||
],
|
||||
"autoReferenced": false,
|
||||
"defineConstraints": [
|
||||
"UNITY_INCLUDE_TESTS"
|
||||
],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
7
Assets/Tests/EditMode/EditModeTests.asmdef.meta
Normal file
7
Assets/Tests/EditMode/EditModeTests.asmdef.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 66b3a4fff1b1a544b9381e41a3e2d334
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
198
Assets/Tests/EditMode/PickupItemDataTests.cs
Normal file
198
Assets/Tests/EditMode/PickupItemDataTests.cs
Normal file
@@ -0,0 +1,198 @@
|
||||
using NUnit.Framework;
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Tests.EditMode
|
||||
{
|
||||
public class PickupItemDataTests
|
||||
{
|
||||
private PickupItemData item1;
|
||||
private PickupItemData item2;
|
||||
private PickupItemData item3;
|
||||
|
||||
[SetUp]
|
||||
public void SetUp()
|
||||
{
|
||||
// Create test instances using ScriptableObject.CreateInstance
|
||||
item1 = ScriptableObject.CreateInstance<PickupItemData>();
|
||||
item1.itemName = "Apple";
|
||||
item1.description = "A red fruit";
|
||||
|
||||
item2 = ScriptableObject.CreateInstance<PickupItemData>();
|
||||
item2.itemName = "Apple";
|
||||
item2.description = "A different description"; // Different description but same name
|
||||
|
||||
item3 = ScriptableObject.CreateInstance<PickupItemData>();
|
||||
item3.itemName = "Orange";
|
||||
item3.description = "A citrus fruit";
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
// Clean up created ScriptableObjects
|
||||
if (item1 != null) Object.DestroyImmediate(item1);
|
||||
if (item2 != null) Object.DestroyImmediate(item2);
|
||||
if (item3 != null) Object.DestroyImmediate(item3);
|
||||
}
|
||||
|
||||
#region AreEquivalent Tests
|
||||
|
||||
[Test]
|
||||
public void AreEquivalent_SameReference_ReturnsTrue()
|
||||
{
|
||||
// Arrange
|
||||
var item = item1;
|
||||
|
||||
// Act
|
||||
bool result = PickupItemData.AreEquivalent(item, item);
|
||||
|
||||
// Assert
|
||||
Assert.IsTrue(result, "Same reference should be equivalent");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AreEquivalent_SameItemName_ReturnsTrue()
|
||||
{
|
||||
// Arrange - item1 and item2 have the same itemName but different descriptions
|
||||
|
||||
// Act
|
||||
bool result = PickupItemData.AreEquivalent(item1, item2);
|
||||
|
||||
// Assert
|
||||
Assert.IsTrue(result, "Items with the same itemName should be equivalent");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AreEquivalent_DifferentItemName_ReturnsFalse()
|
||||
{
|
||||
// Arrange - item1 and item3 have different itemNames
|
||||
|
||||
// Act
|
||||
bool result = PickupItemData.AreEquivalent(item1, item3);
|
||||
|
||||
// Assert
|
||||
Assert.IsFalse(result, "Items with different itemName should not be equivalent");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AreEquivalent_FirstItemNull_ReturnsFalse()
|
||||
{
|
||||
// Arrange
|
||||
|
||||
// Act
|
||||
bool result = PickupItemData.AreEquivalent(null, item1);
|
||||
|
||||
// Assert
|
||||
Assert.IsFalse(result, "Null item should not be equivalent to a non-null item");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AreEquivalent_SecondItemNull_ReturnsFalse()
|
||||
{
|
||||
// Arrange
|
||||
|
||||
// Act
|
||||
bool result = PickupItemData.AreEquivalent(item1, null);
|
||||
|
||||
// Assert
|
||||
Assert.IsFalse(result, "Non-null item should not be equivalent to a null item");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AreEquivalent_BothItemsNull_ReturnsTrue()
|
||||
{
|
||||
// Arrange
|
||||
|
||||
// Act
|
||||
bool result = PickupItemData.AreEquivalent(null, null);
|
||||
|
||||
// Assert
|
||||
Assert.IsTrue(result, "Two null items should be equivalent (ReferenceEquals)");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ListContainsEquivalent Tests
|
||||
|
||||
[Test]
|
||||
public void ListContainsEquivalent_EmptyList_ReturnsFalse()
|
||||
{
|
||||
// Arrange
|
||||
var list = new List<PickupItemData>();
|
||||
|
||||
// Act
|
||||
bool result = PickupItemData.ListContainsEquivalent(list, item1);
|
||||
|
||||
// Assert
|
||||
Assert.IsFalse(result, "Empty list should not contain any item");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ListContainsEquivalent_ListContainsSameReference_ReturnsTrue()
|
||||
{
|
||||
// Arrange
|
||||
var list = new List<PickupItemData> { item1 };
|
||||
|
||||
// Act
|
||||
bool result = PickupItemData.ListContainsEquivalent(list, item1);
|
||||
|
||||
// Assert
|
||||
Assert.IsTrue(result, "List should contain the same reference");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ListContainsEquivalent_ListContainsEquivalentItem_ReturnsTrue()
|
||||
{
|
||||
// Arrange - item1 and item2 have the same itemName but are different instances
|
||||
var list = new List<PickupItemData> { item1 };
|
||||
|
||||
// Act
|
||||
bool result = PickupItemData.ListContainsEquivalent(list, item2);
|
||||
|
||||
// Assert
|
||||
Assert.IsTrue(result, "List should contain an equivalent item with the same itemName");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ListContainsEquivalent_ListDoesNotContainEquivalentItem_ReturnsFalse()
|
||||
{
|
||||
// Arrange - item1 and item3 have different itemNames
|
||||
var list = new List<PickupItemData> { item1 };
|
||||
|
||||
// Act
|
||||
bool result = PickupItemData.ListContainsEquivalent(list, item3);
|
||||
|
||||
// Assert
|
||||
Assert.IsFalse(result, "List should not contain an item with a different itemName");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ListContainsEquivalent_SearchForNullInNonEmptyList_ReturnsFalse()
|
||||
{
|
||||
// Arrange
|
||||
var list = new List<PickupItemData> { item1, item2 };
|
||||
|
||||
// Act
|
||||
bool result = PickupItemData.ListContainsEquivalent(list, null);
|
||||
|
||||
// Assert
|
||||
Assert.IsFalse(result, "List should not contain a null item");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ListContainsEquivalent_SearchInListWithNull_HandlesNullGracefully()
|
||||
{
|
||||
// Arrange
|
||||
var list = new List<PickupItemData> { item1, null, item3 };
|
||||
|
||||
// Act
|
||||
bool result = PickupItemData.ListContainsEquivalent(list, item2);
|
||||
|
||||
// Assert
|
||||
Assert.IsTrue(result, "List with null element should still find equivalent item");
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
3
Assets/Tests/EditMode/PickupItemDataTests.cs.meta
Normal file
3
Assets/Tests/EditMode/PickupItemDataTests.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5d448a09499f4498894619f2ce2a31cb
|
||||
timeCreated: 1757848750
|
||||
315
Assets/Tests/EditMode/PuzzleGraphUtilityTests.cs
Normal file
315
Assets/Tests/EditMode/PuzzleGraphUtilityTests.cs
Normal file
@@ -0,0 +1,315 @@
|
||||
using NUnit.Framework;
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Tests.EditMode
|
||||
{
|
||||
public class PuzzleGraphUtilityTests
|
||||
{
|
||||
private PuzzleStepSO step1;
|
||||
private PuzzleStepSO step2;
|
||||
private PuzzleStepSO step3;
|
||||
private PuzzleStepSO step4;
|
||||
private PuzzleStepSO step5;
|
||||
|
||||
[SetUp]
|
||||
public void SetUp()
|
||||
{
|
||||
// Create test PuzzleStepSO instances using ScriptableObject.CreateInstance
|
||||
step1 = ScriptableObject.CreateInstance<PuzzleStepSO>();
|
||||
step1.stepId = "step1";
|
||||
step1.displayName = "Step 1";
|
||||
step1.unlocks = new List<PuzzleStepSO>();
|
||||
|
||||
step2 = ScriptableObject.CreateInstance<PuzzleStepSO>();
|
||||
step2.stepId = "step2";
|
||||
step2.displayName = "Step 2";
|
||||
step2.unlocks = new List<PuzzleStepSO>();
|
||||
|
||||
step3 = ScriptableObject.CreateInstance<PuzzleStepSO>();
|
||||
step3.stepId = "step3";
|
||||
step3.displayName = "Step 3";
|
||||
step3.unlocks = new List<PuzzleStepSO>();
|
||||
|
||||
step4 = ScriptableObject.CreateInstance<PuzzleStepSO>();
|
||||
step4.stepId = "step4";
|
||||
step4.displayName = "Step 4";
|
||||
step4.unlocks = new List<PuzzleStepSO>();
|
||||
|
||||
step5 = ScriptableObject.CreateInstance<PuzzleStepSO>();
|
||||
step5.stepId = "step5";
|
||||
step5.displayName = "Step 5";
|
||||
step5.unlocks = new List<PuzzleStepSO>();
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
// Clean up created ScriptableObjects
|
||||
if (step1 != null) Object.DestroyImmediate(step1);
|
||||
if (step2 != null) Object.DestroyImmediate(step2);
|
||||
if (step3 != null) Object.DestroyImmediate(step3);
|
||||
if (step4 != null) Object.DestroyImmediate(step4);
|
||||
if (step5 != null) Object.DestroyImmediate(step5);
|
||||
}
|
||||
|
||||
#region BuildDependencyGraph Tests
|
||||
|
||||
[Test]
|
||||
public void BuildDependencyGraph_EmptyList_ReturnsEmptyDictionary()
|
||||
{
|
||||
// Arrange
|
||||
var steps = new List<PuzzleStepSO>();
|
||||
|
||||
// Act
|
||||
var graph = PuzzleGraphUtility.BuildDependencyGraph(steps);
|
||||
|
||||
// Assert
|
||||
Assert.IsNotNull(graph, "Graph should not be null");
|
||||
Assert.AreEqual(0, graph.Count, "Graph should be empty");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BuildDependencyGraph_NoUnlocks_ReturnsGraphWithEmptyDependencyLists()
|
||||
{
|
||||
// Arrange
|
||||
var steps = new List<PuzzleStepSO> { step1, step2, step3 };
|
||||
// No unlocks set up
|
||||
|
||||
// Act
|
||||
var graph = PuzzleGraphUtility.BuildDependencyGraph(steps);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(3, graph.Count, "Graph should have 3 entries");
|
||||
Assert.IsTrue(graph.ContainsKey(step1), "Graph should contain step1");
|
||||
Assert.IsTrue(graph.ContainsKey(step2), "Graph should contain step2");
|
||||
Assert.IsTrue(graph.ContainsKey(step3), "Graph should contain step3");
|
||||
Assert.AreEqual(0, graph[step1].Count, "step1 should have no dependencies");
|
||||
Assert.AreEqual(0, graph[step2].Count, "step2 should have no dependencies");
|
||||
Assert.AreEqual(0, graph[step3].Count, "step3 should have no dependencies");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BuildDependencyGraph_WithUnlocks_BuildsCorrectDependencyGraph()
|
||||
{
|
||||
// Arrange
|
||||
// Set up unlock relationships:
|
||||
// step1 unlocks step3 and step4
|
||||
// step2 unlocks step3
|
||||
// step3 unlocks step5
|
||||
// step4 has no unlocks
|
||||
// step5 has no unlocks
|
||||
step1.unlocks.Add(step3);
|
||||
step1.unlocks.Add(step4);
|
||||
step2.unlocks.Add(step3);
|
||||
step3.unlocks.Add(step5);
|
||||
|
||||
var steps = new List<PuzzleStepSO> { step1, step2, step3, step4, step5 };
|
||||
|
||||
// Act
|
||||
var graph = PuzzleGraphUtility.BuildDependencyGraph(steps);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(5, graph.Count, "Graph should have 5 entries");
|
||||
|
||||
// Check dependencies (reverse of unlocks)
|
||||
Assert.AreEqual(0, graph[step1].Count, "step1 should have no dependencies");
|
||||
Assert.AreEqual(0, graph[step2].Count, "step2 should have no dependencies");
|
||||
|
||||
Assert.AreEqual(2, graph[step3].Count, "step3 should have 2 dependencies");
|
||||
Assert.IsTrue(graph[step3].Contains(step1), "step3 should depend on step1");
|
||||
Assert.IsTrue(graph[step3].Contains(step2), "step3 should depend on step2");
|
||||
|
||||
Assert.AreEqual(1, graph[step4].Count, "step4 should have 1 dependency");
|
||||
Assert.IsTrue(graph[step4].Contains(step1), "step4 should depend on step1");
|
||||
|
||||
Assert.AreEqual(1, graph[step5].Count, "step5 should have 1 dependency");
|
||||
Assert.IsTrue(graph[step5].Contains(step3), "step5 should depend on step3");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BuildDependencyGraph_WithCyclicUnlocks_BuildsCorrectDependencyGraph()
|
||||
{
|
||||
// Arrange
|
||||
// Set up cyclic unlock relationships:
|
||||
// step1 unlocks step2
|
||||
// step2 unlocks step3
|
||||
// step3 unlocks step1
|
||||
step1.unlocks.Add(step2);
|
||||
step2.unlocks.Add(step3);
|
||||
step3.unlocks.Add(step1);
|
||||
|
||||
var steps = new List<PuzzleStepSO> { step1, step2, step3 };
|
||||
|
||||
// Act
|
||||
var graph = PuzzleGraphUtility.BuildDependencyGraph(steps);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(3, graph.Count, "Graph should have 3 entries");
|
||||
|
||||
// Check dependencies (reverse of unlocks)
|
||||
Assert.AreEqual(1, graph[step1].Count, "step1 should have 1 dependency");
|
||||
Assert.IsTrue(graph[step1].Contains(step3), "step1 should depend on step3");
|
||||
|
||||
Assert.AreEqual(1, graph[step2].Count, "step2 should have 1 dependency");
|
||||
Assert.IsTrue(graph[step2].Contains(step1), "step2 should depend on step1");
|
||||
|
||||
Assert.AreEqual(1, graph[step3].Count, "step3 should have 1 dependency");
|
||||
Assert.IsTrue(graph[step3].Contains(step2), "step3 should depend on step2");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region FindInitialSteps Tests
|
||||
|
||||
[Test]
|
||||
public void FindInitialSteps_EmptyGraph_ReturnsEmptyList()
|
||||
{
|
||||
// Arrange
|
||||
var graph = new Dictionary<PuzzleStepSO, List<PuzzleStepSO>>();
|
||||
|
||||
// Act
|
||||
var initialSteps = PuzzleGraphUtility.FindInitialSteps(graph);
|
||||
|
||||
// Assert
|
||||
Assert.IsNotNull(initialSteps, "Initial steps should not be null");
|
||||
Assert.AreEqual(0, initialSteps.Count, "Initial steps should be empty");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void FindInitialSteps_AllInitial_ReturnsAllSteps()
|
||||
{
|
||||
// Arrange
|
||||
var graph = new Dictionary<PuzzleStepSO, List<PuzzleStepSO>>
|
||||
{
|
||||
{ step1, new List<PuzzleStepSO>() },
|
||||
{ step2, new List<PuzzleStepSO>() },
|
||||
{ step3, new List<PuzzleStepSO>() }
|
||||
};
|
||||
|
||||
// Act
|
||||
var initialSteps = PuzzleGraphUtility.FindInitialSteps(graph);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(3, initialSteps.Count, "All steps should be initial");
|
||||
Assert.IsTrue(initialSteps.Contains(step1), "Initial steps should contain step1");
|
||||
Assert.IsTrue(initialSteps.Contains(step2), "Initial steps should contain step2");
|
||||
Assert.IsTrue(initialSteps.Contains(step3), "Initial steps should contain step3");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void FindInitialSteps_SomeInitial_ReturnsOnlyInitialSteps()
|
||||
{
|
||||
// Arrange
|
||||
// Create a graph where step1 and step2 are initial, but step3 depends on step1
|
||||
var graph = new Dictionary<PuzzleStepSO, List<PuzzleStepSO>>
|
||||
{
|
||||
{ step1, new List<PuzzleStepSO>() },
|
||||
{ step2, new List<PuzzleStepSO>() },
|
||||
{ step3, new List<PuzzleStepSO> { step1 } }
|
||||
};
|
||||
|
||||
// Act
|
||||
var initialSteps = PuzzleGraphUtility.FindInitialSteps(graph);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(2, initialSteps.Count, "There should be 2 initial steps");
|
||||
Assert.IsTrue(initialSteps.Contains(step1), "Initial steps should contain step1");
|
||||
Assert.IsTrue(initialSteps.Contains(step2), "Initial steps should contain step2");
|
||||
Assert.IsFalse(initialSteps.Contains(step3), "Initial steps should not contain step3");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void FindInitialSteps_NoInitial_ReturnsEmptyList()
|
||||
{
|
||||
// Arrange
|
||||
// Create a cyclic dependency graph with no initial steps
|
||||
var graph = new Dictionary<PuzzleStepSO, List<PuzzleStepSO>>
|
||||
{
|
||||
{ step1, new List<PuzzleStepSO> { step3 } },
|
||||
{ step2, new List<PuzzleStepSO> { step1 } },
|
||||
{ step3, new List<PuzzleStepSO> { step2 } }
|
||||
};
|
||||
|
||||
// Act
|
||||
var initialSteps = PuzzleGraphUtility.FindInitialSteps(graph);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(0, initialSteps.Count, "There should be no initial steps");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region FindUnlocks Tests
|
||||
|
||||
[Test]
|
||||
public void FindUnlocks_EmptyList_ReturnsEmptyList()
|
||||
{
|
||||
// Arrange
|
||||
var allSteps = new List<PuzzleStepSO>();
|
||||
|
||||
// Act
|
||||
var unlocks = PuzzleGraphUtility.FindUnlocks(step1, allSteps);
|
||||
|
||||
// Assert
|
||||
Assert.IsNotNull(unlocks, "Unlocks should not be null");
|
||||
Assert.AreEqual(0, unlocks.Count, "Unlocks should be empty");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void FindUnlocks_NoUnlocks_ReturnsEmptyList()
|
||||
{
|
||||
// Arrange
|
||||
var allSteps = new List<PuzzleStepSO> { step1, step2, step3 };
|
||||
// No unlocks set up
|
||||
|
||||
// Act
|
||||
var unlocks = PuzzleGraphUtility.FindUnlocks(step1, allSteps);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(0, unlocks.Count, "No steps should unlock step1");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void FindUnlocks_WithUnlocks_ReturnsCorrectUnlocks()
|
||||
{
|
||||
// Arrange
|
||||
// Set up unlock relationships:
|
||||
// step1 unlocks step3
|
||||
// step2 unlocks step3
|
||||
step1.unlocks.Add(step3);
|
||||
step2.unlocks.Add(step3);
|
||||
|
||||
var allSteps = new List<PuzzleStepSO> { step1, step2, step3 };
|
||||
|
||||
// Act
|
||||
var unlocks = PuzzleGraphUtility.FindUnlocks(step3, allSteps);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(2, unlocks.Count, "2 steps should unlock step3");
|
||||
Assert.IsTrue(unlocks.Contains(step1), "step1 should unlock step3");
|
||||
Assert.IsTrue(unlocks.Contains(step2), "step2 should unlock step3");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void FindUnlocks_StepUnlocksItself_ReturnsCorrectUnlocks()
|
||||
{
|
||||
// Arrange
|
||||
// Set up self-unlock relationship:
|
||||
// step1 unlocks itself and step2
|
||||
step1.unlocks.Add(step1);
|
||||
step1.unlocks.Add(step2);
|
||||
|
||||
var allSteps = new List<PuzzleStepSO> { step1, step2 };
|
||||
|
||||
// Act
|
||||
var unlocks = PuzzleGraphUtility.FindUnlocks(step1, allSteps);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(1, unlocks.Count, "1 step should unlock step1");
|
||||
Assert.IsTrue(unlocks.Contains(step1), "step1 should unlock itself");
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
3
Assets/Tests/EditMode/PuzzleGraphUtilityTests.cs.meta
Normal file
3
Assets/Tests/EditMode/PuzzleGraphUtilityTests.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cfcbd9adec324e99b2753f04bd3fad89
|
||||
timeCreated: 1757848874
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user