// Use this for initialization void Start() { _gameManager = GameObject.Find("GameCtrl").GetComponent <GameManager>(); setEdges(); setAnimation(); _blockList = new List <Block>(); blockCount = this.transform.childCount; if (blockCount > 0) { for (int i = 0; i < blockCount; i++) { Block block = transform.GetChild(i).GetComponent <Block>(); _blockList.Add(block); } } // RATE_SETTINGS RATE_LIST = new List <float> (); dataCtrl = new DataCtrl(); dataCtrl.InitData(); total = getTotalValue(); // SCORE InitScoreLevel(); }
public void init() { // DataCtrl初期化 _dataCtrl = new DataCtrl(); _dataCtrl.InitData(); _dataCtrl.checkContent(); }
void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } bf = new BinaryFormatter(); dataFilePath = Application.persistentDataPath + "/game.bat"; }
BinaryFormatter bf; //helps save/load data in binary files private void Awake() { //code to make a singleton if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); //loads the gameObject dataCtrl for every game scene } else { Destroy(gameObject); //if a scene already has a gameObject dataCtrl, then delete that instance. Makes sure only one instance is available } bf = new BinaryFormatter(); dataFilePath = Application.persistentDataPath + "/game.dat"; Debug.Log(dataFilePath); }
private void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } bf = new BinaryFormatter(); filePathName = Application.persistentDataPath + "/game.dat"; Debug.Log(filePathName); }
public void BlockRateTest() { DataCtrl dataCtrl = new DataCtrl(); dataCtrl.InitItemMasterData(); float timeNow = 11.4f; List <float> fl = dataCtrl.getRateList(timeNow); Assert.AreEqual(1, fl [0]); Assert.AreEqual(3, fl [1]); Assert.AreEqual(1, fl [2]); Assert.AreEqual(1, fl [3]); Assert.AreEqual(1, fl [4]); Assert.AreEqual(0, fl [5]); Assert.AreEqual(1, fl [6]); Assert.AreEqual(8, fl [7]); // 11,1,3,1,1,1,0,1,8 }
BinaryFormatter bf; // helps save/load data in binary files void Awake() { //code to make a singleton if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } bf = new BinaryFormatter(); dataFilePath = Application.persistentDataPath + "/game.dat"; //Debug.Log(dataFilePath); }
public void binarySearchTest() { _dataCtrl = new DataCtrl(); _dataCtrl.InitData(); _dataCtrl.checkContent(); List <int> cmList = new List <int> (); int n = 10000; for (int i = 0; i < n; i++) { cmList.Add(i); } DebugLogger.Log("linear START"); testCommentList(cmList, false); DebugLogger.Log("half START"); testCommentList(cmList, true); }
void InitData() { _dataCtrl = new DataCtrl(); _dataCtrl.InitData(); _dataCtrl.checkContent(); }