Exemple #1
0
    // Use this for initialization

    void Start()
    {
        StartGame.onClick.AddListener(() => {
            Debug.Log("点击开始游戏");
            BaseGameInfo game = new BaseGameInfo();
            game.EnemyLv      = 1;
            SceneManager.LoadScene("game");
        });
    }
Exemple #2
0
    // Use this for initialization
    void Start()
    {
        canvasPart   = canvas.gameObject;
        EnemyUIPart  = FindElementGo(canvasPart, "Game/EnemyUI");
        FellowUIPart = FindElementGo(canvasPart, "Game/FellowUI");
        baseGame     = new BaseGameInfo();
        baseGame.saveInfo();

        fellowNum     = 5;
        myAttackSpeed = new float[fellowNum];
        myHealth      = 0;
        for (int i = 0; i < fellowNum; i++)
        {
            int id = i + 1;
            fellowData.Add(baseGame.fellowInfo[id]);
        }
        fellowFightData = baseGame.calculateAttribute(fellowData);
        for (int i = 0; i < fellowNum; i++)
        {
            myAttackSpeed[i] = fellowFightData[i].AttackSpeed;
        }
        mUpdateMySeconds = new float[fellowNum];
        InitUIPart();
    }