Example #1
0
    // Use this for initialization
    void Start()
    {
        god = this;

        // 静态状态初始化
        prepareState         = new PrepareState();
        emptyState           = new EmptyState();
        roundExchangeState   = new RoundExchangeState();
        attackPrepareState   = new AttackPrepareState();
        attackCompletedState = new AttackCompletedState();
        cardSelectedState    = new CardSelectedState();
        targetSelectedState  = new TargetSelectedState();
        cardCastedState      = new CardCastedState();
        gameOverState        = new GameOverState();

        //UI实例
        UI = GameObject.Find("Canvas").GetComponent <UserInterface>();
        UI.next_round.onClick.AddListener(delegate()
        {
            ExchangeRound();
        });

        // 设置初始状态
        currentState = prepareState;
        isFree       = true;

        init();
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        god = this;

        // 静态状态初始化
        prepareState         = new PrepareState();
        emptyState           = new EmptyState();
        roundExchangeState   = new RoundExchangeState();
        attackPrepareState   = new AttackPrepareState();
        attackCompletedState = new AttackCompletedState();
        cardSelectedState    = new CardSelectedState();
        targetSelectedState  = new TargetSelectedState();
        cardCastedState      = new CardCastedState();
        gameOverState        = new GameOverState();

        // 设置初始状态
        currentState = prepareState;
        isFree       = true;

        init();
    }