コード例 #1
0
    // 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();
    }
コード例 #2
0
 public void init()
 {
     // DataCtrl初期化
     _dataCtrl = new DataCtrl();
     _dataCtrl.InitData();
     _dataCtrl.checkContent();
 }
コード例 #3
0
ファイル: DataCtrl.cs プロジェクト: KimiaAzizi/Circle
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
     bf           = new BinaryFormatter();
     dataFilePath = Application.persistentDataPath + "/game.bat";
 }
コード例 #4
0
ファイル: DataCtrl.cs プロジェクト: aritrac/SuperPlatformer
    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);
    }
コード例 #5
0
ファイル: DataCtrl.cs プロジェクト: madenmustafa1/Mood
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else
        {
            Destroy(gameObject);
        }

        bf = new BinaryFormatter();

        filePathName = Application.persistentDataPath + "/game.dat";

        Debug.Log(filePathName);
    }
コード例 #6
0
    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
    }
コード例 #7
0
ファイル: DataCtrl.cs プロジェクト: ugurpolat/Free-Cat
    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);
    }
コード例 #8
0
    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);
    }
コード例 #9
0
 void InitData()
 {
     _dataCtrl = new DataCtrl();
     _dataCtrl.InitData();
     _dataCtrl.checkContent();
 }