Resources stuff
This commit is contained in:
parent
97557bfb47
commit
1001ba58a3
9 changed files with 18 additions and 1 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -26,6 +26,18 @@ public class MonsterManager : MonoBehaviour {
|
|||
|
||||
public void saveMonster()
|
||||
{
|
||||
GameObject[] monsterParts = GameObject.FindGameObjectsWithTag("MonsterPart");
|
||||
|
||||
StringBuilder pos = new StringBuilder ();
|
||||
string savedString;
|
||||
|
||||
for (int i = 0; i < monsterParts.Length; i++) {
|
||||
pos = new StringBuilder ();
|
||||
pos.Append(GameObject.Find(monsterParts[i].name).transform.position.x).Append(" ").Append(GameObject.Find(monsterParts[i].name).transform.position.y).Append(" ").Append(GameObject.Find(monsterParts[i].name).transform.position.z);
|
||||
savedString = pos.ToString ();
|
||||
PlayerPrefs.SetString(SceneManager.GetActiveScene().name + monsterParts[i].name, savedString);
|
||||
}
|
||||
/*
|
||||
StringBuilder eyePos = new StringBuilder();
|
||||
|
||||
eyePos.Append(GameObject.Find("circle_eye").transform.position.x).Append(" ").Append(GameObject.Find("circle_eye").transform.position.y).Append(" ").Append(GameObject.Find("circle_eye").transform.position.z);
|
||||
|
@ -61,10 +73,15 @@ public class MonsterManager : MonoBehaviour {
|
|||
nosePos.Append(GameObject.Find("pig_nose").transform.position.x).Append(" ").Append(GameObject.Find("pig_nose").transform.position.y).Append(" ").Append(GameObject.Find("pig_nose").transform.position.z);
|
||||
savedString = nosePos.ToString();
|
||||
PlayerPrefs.SetString(SceneManager.GetActiveScene().name + "nosePosition", savedString);
|
||||
*/
|
||||
}
|
||||
|
||||
public void loadMonster ()
|
||||
{
|
||||
string savedString;
|
||||
string[] values;
|
||||
|
||||
/*
|
||||
string savedString = PlayerPrefs.GetString(SceneManager.GetActiveScene().name + "eyePosition");
|
||||
string[] values = savedString.Split(' ');
|
||||
|
||||
|
@ -94,6 +111,6 @@ public class MonsterManager : MonoBehaviour {
|
|||
values = savedString.Split(' ');
|
||||
|
||||
GameObject.Find("pig_nose").transform.position = new Vector3(float.Parse(values[0]),float.Parse(values[1]),float.Parse(values[2]));
|
||||
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Reference in a new issue