Quests not loading (they are saving though)
-
- Posts: 19
- Joined: Tue Jan 01, 2019 12:53 am
Re: Quests not loading (they are saving though)
Absolute legend <3
-
- Posts: 19
- Joined: Tue Jan 01, 2019 12:53 am
Re: Quests not loading (they are saving though)
Thanks Tony!!
-
- Posts: 19
- Joined: Tue Jan 01, 2019 12:53 am
Re: Quests not loading (they are saving though)
I made a little editor script also that might help some people
just means i dont have to go in and add everything manually !
just means i dont have to go in and add everything manually !
Code: Select all
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using PixelCrushers;
using PixelCrushers.QuestMachine;
using UnityEditor;
class MultiActiveSaverEditor : EditorWindow
{
public MultiActiveSaver value;
[MenuItem("Window/JOSH-ADDALL OBJECTS FOR SAVE")]
public static void ShowWindow()
{
GetWindow<MultiActiveSaverEditor>("Add All Items to multi saver");
}
private void OnGUI()
{
EditorGUILayout.BeginHorizontal();
EditorGUILayout.LabelField("MultiActiveSaverObject");
value = EditorGUILayout.ObjectField(value, typeof(MultiActiveSaver), true) as MultiActiveSaver;
EditorGUILayout.EndHorizontal();
EditorGUILayout.BeginVertical();
if (GUILayout.Button("Run Function"))
{
OnInspectorGUIs();
}
EditorGUILayout.EndVertical();
}
public void OnInspectorGUIs ()
{
// specifiedObject is the 'parent', with whos children you want to populate the array. has to be public
if (value.gameObject == null)
{
// throw new Exception ("Specified object is null");
}
// targetArray is the array you want to populate with children. has to be public
// simple population alg
// value.gameObjectsToWatch = new GameObject[value.Referenceobj.transform.childCount];
// for (int i = 0; i < value.gameObject.transform.childCount; i++)
// {
// value.gameObjectsToWatch[ i ] = value.Referenceobj.transform.GetChild( i ).gameObject;
// }
Transform[] t = value.Referenceobj.GetComponentsInChildren<Transform>(true);
value.gameObjectsToWatch = new GameObject[t.Length];
int i = 0;
foreach (Transform yourScript in t) {
value.gameObjectsToWatch[i] = yourScript.gameObject;
i++;
}
}
}
Re: Quests not loading (they are saving though)
Thanks for sharing!