REname to AppleMachine
This commit is contained in:
@@ -157,7 +157,7 @@ namespace Editor
|
||||
var componentType = component.GetType();
|
||||
if (componentType.Name == "StateMachine" && componentType.Namespace == "Pixelplacement")
|
||||
{
|
||||
bool isAlreadySaveable = component is SaveableStateMachine;
|
||||
bool isAlreadySaveable = component is AppleMachine;
|
||||
foundStateMachines.Add(new StateMachineInfo
|
||||
{
|
||||
name = component.gameObject.name,
|
||||
@@ -189,7 +189,7 @@ namespace Editor
|
||||
var componentType = component.GetType();
|
||||
if (componentType.Name == "StateMachine" && componentType.Namespace == "Pixelplacement")
|
||||
{
|
||||
bool isAlreadySaveable = component is SaveableStateMachine;
|
||||
bool isAlreadySaveable = component is AppleMachine;
|
||||
foundStateMachines.Add(new StateMachineInfo
|
||||
{
|
||||
name = component.gameObject.name,
|
||||
@@ -336,7 +336,7 @@ namespace Editor
|
||||
var componentType = component.GetType();
|
||||
if (componentType.Name == "StateMachine" &&
|
||||
componentType.Namespace == "Pixelplacement" &&
|
||||
!(component is SaveableStateMachine))
|
||||
!(component is AppleMachine))
|
||||
{
|
||||
if (MigrateComponent(component.gameObject, component))
|
||||
{
|
||||
@@ -369,7 +369,7 @@ namespace Editor
|
||||
var componentType = component.GetType();
|
||||
if (componentType.Name == "StateMachine" &&
|
||||
componentType.Namespace == "Pixelplacement" &&
|
||||
!(component is SaveableStateMachine))
|
||||
!(component is AppleMachine))
|
||||
{
|
||||
bool success = MigrateComponent(gameObject, component);
|
||||
|
||||
@@ -412,7 +412,7 @@ namespace Editor
|
||||
Object.DestroyImmediate(oldComponent);
|
||||
|
||||
// Add new component
|
||||
var newSM = gameObject.AddComponent<SaveableStateMachine>();
|
||||
var newSM = gameObject.AddComponent<AppleMachine>();
|
||||
|
||||
// Restore data using SerializedObject
|
||||
SerializedObject newSO = new SerializedObject(newSM);
|
||||
|
||||
@@ -6,7 +6,7 @@ using Core.SaveLoad;
|
||||
using Pixelplacement;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
public class GardenerChaseBehavior : SaveableState
|
||||
public class GardenerChaseBehavior : AppleState
|
||||
{
|
||||
private static readonly int Property = Animator.StringToHash("IsIdle?");
|
||||
public Spline chaseSpline;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Core.SaveLoad
|
||||
/// Inherits from Pixelplacement.StateMachine and adds save/load functionality.
|
||||
/// Use SaveableState (not State) for child states to get save/load hooks.
|
||||
/// </summary>
|
||||
public class SaveableStateMachine : StateMachine, ISaveParticipant
|
||||
public class AppleMachine : StateMachine, ISaveParticipant
|
||||
{
|
||||
[SerializeField]
|
||||
[Tooltip("Optional custom save ID. If empty, will auto-generate from scene name and hierarchy path.")]
|
||||
@@ -36,7 +36,7 @@ namespace Core.SaveLoad
|
||||
// If not restoring and change was successful, call OnEnterState
|
||||
if (!IsRestoring && result != null && currentState != null)
|
||||
{
|
||||
var saveableState = currentState.GetComponent<SaveableState>();
|
||||
var saveableState = currentState.GetComponent<AppleState>();
|
||||
if (saveableState != null)
|
||||
{
|
||||
saveableState.OnEnterState();
|
||||
@@ -53,7 +53,7 @@ namespace Core.SaveLoad
|
||||
// If not restoring and change was successful, call OnEnterState
|
||||
if (!IsRestoring && result != null && currentState != null)
|
||||
{
|
||||
var saveableState = currentState.GetComponent<SaveableState>();
|
||||
var saveableState = currentState.GetComponent<AppleState>();
|
||||
if (saveableState != null)
|
||||
{
|
||||
saveableState.OnEnterState();
|
||||
@@ -70,7 +70,7 @@ namespace Core.SaveLoad
|
||||
// If not restoring and change was successful, call OnEnterState
|
||||
if (!IsRestoring && result != null && currentState != null)
|
||||
{
|
||||
var saveableState = currentState.GetComponent<SaveableState>();
|
||||
var saveableState = currentState.GetComponent<AppleState>();
|
||||
if (saveableState != null)
|
||||
{
|
||||
saveableState.OnEnterState();
|
||||
@@ -158,8 +158,8 @@ namespace Core.SaveLoad
|
||||
return JsonUtility.ToJson(new StateMachineSaveData { stateName = "", stateData = "" });
|
||||
}
|
||||
|
||||
SaveableState saveableState = currentState.GetComponent<SaveableState>();
|
||||
string stateData = saveableState?.SerializeState() ?? "";
|
||||
AppleState appleState = currentState.GetComponent<AppleState>();
|
||||
string stateData = appleState?.SerializeState() ?? "";
|
||||
|
||||
var saveData = new StateMachineSaveData
|
||||
{
|
||||
@@ -203,10 +203,10 @@ namespace Core.SaveLoad
|
||||
// Now explicitly call OnRestoreState with the saved data
|
||||
if (currentState != null)
|
||||
{
|
||||
SaveableState saveableState = currentState.GetComponent<SaveableState>();
|
||||
if (saveableState != null)
|
||||
AppleState appleState = currentState.GetComponent<AppleState>();
|
||||
if (appleState != null)
|
||||
{
|
||||
saveableState.OnRestoreState(saveData.stateData);
|
||||
appleState.OnRestoreState(saveData.stateData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Core.SaveLoad
|
||||
/// Base class for states that need save/load functionality.
|
||||
/// Inherit from this instead of Pixelplacement.State for states in SaveableStateMachines.
|
||||
/// </summary>
|
||||
public class SaveableState : State
|
||||
public class AppleState : State
|
||||
{
|
||||
/// <summary>
|
||||
/// Called when this state is entered during normal gameplay.
|
||||
@@ -5,7 +5,7 @@ using Pixelplacement;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
public class GardenerBehaviour : SaveableStateMachine
|
||||
public class GardenerBehaviour : AppleMachine
|
||||
{
|
||||
public void stateSwitch (string StateName)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using Core;
|
||||
using Core.SaveLoad;
|
||||
using Pixelplacement;
|
||||
|
||||
public class LawnMowerBehaviour : SaveableStateMachine
|
||||
public class LawnMowerBehaviour : AppleMachine
|
||||
{
|
||||
public void mowerTouched()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using Core.SaveLoad;
|
||||
using UnityEngine;
|
||||
using Pixelplacement;
|
||||
|
||||
public class LawnMowerChaseBehaviour : SaveableState
|
||||
public class LawnMowerChaseBehaviour : AppleState
|
||||
{
|
||||
public Spline ChaseSpline;
|
||||
public Transform LawnMowerObject;
|
||||
|
||||
Reference in New Issue
Block a user