Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System;
  5.  
  6. using MonsterSystem;
  7. using GameDatabase;
  8.  
  9. [Serializable]
  10. public class MyMonsterDatabase
  11. {
  12.     //[SerializeField]
  13.     public static MonsterData[] db = new MonsterData[]
  14.     {
  15.         new MonsterData(0, new BaseStats(42, 32, 42, 32, 30, 52), 0, 1.5f, 10, 0)
  16.     };
  17.  
  18.     public List<MonsterData> al = new List<MonsterData>();
  19.  
  20. }
  21.  
  22.  
  23. public class DBTest : MonoBehaviour
  24. {
  25.     // Start is called before the first frame update
  26.     void Start()
  27.     {
  28.         Debug.Log("H");
  29.         //string json = JsonUtility.ToJson(MyMonsterDatabase.db);
  30.  
  31.         MyMonsterDatabase tdb = new MyMonsterDatabase();
  32.         tdb.al.Add(new MonsterData(0, new BaseStats(42, 32, 42, 32, 30, 52), 0, 1.5f, 10, 0));
  33.         string json2 = JsonUtility.ToJson(tdb);
  34.  
  35.         Debug.Log(json2);
  36.     }
  37.  
  38.     // Update is called once per frame
  39.     void Update()
  40.     {
  41.        
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement