示例#1
0
    // Use this for initialization
    void Start()
    {
        gameplay = this;

        _MainCamera = (Camera)gameObject.GetComponent("Camera");

        _SelectionListWindow = new SelectionListWindow(Screen.width / 2, Screen.height / 2 + 100);

        _AbilityManagerList = new SelectionListGenericWindow(Screen.width / 2, Screen.height / 2 + 100);

        _SelectionCardNameWindow = new SelectionCardNameWindow(Screen.width / 2 - 50, Screen.height / 2);
        _SelectionCardNameWindow.CreateCardList();
        _SelectionCardNameWindow.SetGame(this);

        _DecisionWindow = new DecisionWindow(Screen.width / 2, Screen.height / 2 + 100);
        _DecisionWindow.SetGame(this);

        _NotificationWindow = new NotificacionWindow(Screen.width / 2, Screen.height / 2 + 100);
        _NotificationWindow.SetGame(this);

        FromHandToBindList = new List<Card>();

        AttackedList = new List<Card>();

        UnitsCalled = new List<Card>();

        EnemySoulBlastQueue = new List<Card>();

        _PopupNumber = new PopupNumber();

        _MouseHelper = new MouseHelper(this);
        GameChat = new Chat();

        opponent = PlayerVariables.opponent;

        playerHand = new PlayerHand();
        enemyHand = new EnemyHand();

        field = new Field(this);
        enemyField = new EnemyField(this);
        guardZone = new GuardZone();
        guardZone.SetField(field);
        guardZone.SetEnemyField(enemyField);
        guardZone.SetGame(this);

        fieldInfo = new FieldInformation();
        EnemyFieldInfo = new EnemyFieldInformation();

        Data = new CardDataBase();
        List<CardInformation> tmpList = Data.GetAllCards();
        for(int i = 0; i < tmpList.Count; i++)
        {
            _SelectionCardNameWindow.AddNewNameToTheList(tmpList[i]);
        }

        //camera = (CameraPosition)GameObject.FindGameObjectWithTag("MainCamera").GetComponent("CameraPosition");
        //camera.SetLocation(CameraLocation.Hand);

        LoadPlayerDeck();
        LoadEnemyDeck();

        gamePhase = GamePhase.CHOOSE_VANGUARD;

        bDrawing = true;
        bIsCardSelectedFromHand = false;
        bPlayerTurn = false;

        bDriveAnimation = false;
        bChooseTriggerEffects = false;
        DriveCard = null;

        //Texture showed above a card when this is selected for an action (An attack, for instance)
        CardSelector = GameObject.FindGameObjectWithTag("CardSelector");
        _CardMenuHelper = (CardHelpMenu)GameObject.FindGameObjectWithTag("CardMenuHelper").GetComponent("CardHelpMenu");
        _GameHelper = (GameHelper)GameObject.FindGameObjectWithTag("GameHelper").GetComponent("GameHelper");

        bPlayerTurn = PlayerVariables.bFirstTurn;

        //ActivePopUpQuestion(playerDeck.DrawCard());
        _CardMenu = new CardMenu(this);

        _AbilityManager = new AbilityManager(this);
        _AbilityManagerExt = new AbilityManagerExt();

        _GameHelper.SetChat(GameChat);
        _GameHelper.SetGame(this);

        EnemyTurnStackedCards = new List<Card>();

        dummyUnitObject = new UnitObject();
        dummyUnitObject.SetGame(this);

        stateDynamicText = new DynamicText();
    }
    // Use this for initialization
    void Start()
    {
        Debug.Log("Start Method() Called.");

        textStyle = new GUIStyle();

        _xWindowScale = Screen.width / 1024.0f;
        _yWindowScale = Screen.height / 768.0f;

        textStyle.fontSize = (int)(textStyle.fontSize * _xWindowScale);
        textStyle.normal.textColor = Color.white;

        _CardHelper = (CardHelpMenu)GameObject.FindGameObjectWithTag("DeckEditorManager").GetComponent("CardHelpMenu");
        _CardHelper.bRenderGamePhases = false;

        _DeckSearcher = new DeckSearcher(800.0f, 230.0f, this);
        _DeckInformation = new DeckInformation(342.0f, 0.0f, this);
        _DeckWatcher = new DeckWatcher(342.0f, 85.0f, this);
    }