Ejemplo n.º 1
0
    void Start()
    {
        #region variables declared
        speed    = 7f;
        movement = 0f;
        #endregion

        #region Getting components
        SRender = GetComponent <SpriteRenderer>();
        myHP    = GetComponent <PlayerHealth>();
        rigid   = GetComponent <Rigidbody2D>();
        scenes  = GetComponent <LevelColl>();
        mcoll   = GetComponent <Collider2D>();
        stats   = GetComponent <Stats>();
        hang    = GetComponent <Hanging>();
        #endregion

        #region Level System
        LevelSystem levelSystem = new LevelSystem();
        #endregion

        DontDestroyOnLoad(this.gameObject);

        inventory = new Inventory();
    }
Ejemplo n.º 2
0
    public static void SaveScene(LevelColl levels)
    {
        BinaryFormatter formatter = new BinaryFormatter();
        string          path      = Application.persistentDataPath + "/scene.save";
        FileStream      stream    = new FileStream(path, FileMode.Create);

        PlayerData data = new PlayerData(levels);

        formatter.Serialize(stream, data);
        stream.Close();
    }
Ejemplo n.º 3
0
 private void Awake()
 {
     scenes = GetComponent <LevelColl>();
     stats  = GetComponent <Stats>();
 }
Ejemplo n.º 4
0
 // Level saved.
 public PlayerData(LevelColl levels)
 {
     currentScene = levels.currentScene;
 }