-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInterSceneData.cs
51 lines (44 loc) · 1.19 KB
/
InterSceneData.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using UnityEngine;
using System.Collections;
public class InterSceneData : MonoBehaviour {
// Static references
public static InterSceneData main;
// Position data
public float posX;
public float posY;
public Vector2 heading;
public string lastScene;
public string lastArea;
public string destinatedSpawn;
// Battle information
public Pokemon battle_opponent;
public Pokemon battle_friendly;
public uint battle_trainer;
public bool battle_isTrainer;
// Player information
public Inventory inventory;
public Pokemons pokemons;
public string collectedItems;
public string defeatedTrainers;
public string playerName;
public float minutesPlayed;
public int money;
public int badges;
// Initialisation
void Awake () {
// If no instance, initialize one
if (main == null) {
DontDestroyOnLoad(gameObject);
main = this;
this.destinatedSpawn = "DEFAULT";
this.collectedItems = ";";
this.defeatedTrainers = ";";
this.inventory = gameObject.AddComponent<Inventory> ();
this.pokemons = gameObject.AddComponent<Pokemons> ();
this.battle_opponent = new Pokemon ();
this.battle_friendly = new Pokemon ();
} else if (main != this) {
Destroy(gameObject);
}
}
}