Beispiel #1
0
    public override void Activate()
    {
        modalPanel = ModalPanel.Instance();

        button1Action = new UnityAction(buildAdditionalBlock);
        button2Action = new UnityAction(base.ExitBuildState);
    }
Beispiel #2
0
    private void InitAlertBox()
    {
        _modalPanel = ModalPanel.Instance();

        Transform modalPanel = Instantiate(Resources.Load("HomeScreen/ModalYesNoPanel", typeof(Transform))) as Transform;

        modalPanel.position = new Vector3(0, 0, 0);
        modalPanel.transform.localPosition = new Vector3(0, 0, 0);
        modalPanel.gameObject.SetActive(false);
        modalPanel.SetParent(_stage.transform, false);

        GameObject panel = modalPanel.transform.Find("Panel").gameObject;

        _modalPanel.title   = panel.transform.Find("TitleText").GetComponent <Text>();
        _modalPanel.message = panel.transform.Find("MessageText").GetComponent <Text>();
        GameObject buttonsPanel = panel.transform.Find("ButtonsPanel").gameObject;

        _modalPanel.yesButton        = buttonsPanel.transform.Find("YesBtn").GetComponent <Button>();
        _modalPanel.noButton         = buttonsPanel.transform.Find("NoBtn").GetComponent <Button>();
        _modalPanel.modalPanelObject = modalPanel.gameObject;

        // Initialize Actions
        _mAcceptChallengeYesAction          = new UnityAction(OnAcceptChallengeYesAction);
        _mIngoreChallengeYesAction          = new UnityAction(OnIgnoreChallengeYesAction);
        _mCurrentPlayChallengeYesAction     = new UnityAction(OnCurrentPlayChallengeYesAction);
        _mRematchChallengeYesAction         = new UnityAction(OnRematchChallengeYesAction);
        _mClearChallengesYesAction          = new UnityAction(OnClearChallengesYesAction);
        _mChallengeAcceptedPlayNowYesAction = new UnityAction(OnChallengeAcceptedPlayNowYesAction);
        _mChallengeNoAction = new UnityAction(OnChallengeNoAction);
    }
Beispiel #3
0
    void Awake()
    {
        modalPanel = ModalPanel.Instance();

        firstCandidate  = new UnityAction(firstChoice);
        secondCandidate = new UnityAction(secondChoice);
    }
Beispiel #4
0
    private void EndTurn()
    {
        if (OnTurnEnd != null)
        {
            OnTurnEnd(m_currentPlayer, m_playerCounter);
        }

        m_playerCounter = m_playerCounter == PlayerNum.Player1 ? PlayerNum.Player2 : PlayerNum.Player1;

        turn_active = false;
        //TODO: unregister EndTurn from current player
        m_currentPlayer.OnTurnEnd -= this.EndTurn;

        PlayerNum winner = PlayerNum.Player1;

        if (GameDone(out winner))
        {
            game_done = true;
            EndGame(winner);
        }
        else
        {
            if (GameObject.ReferenceEquals(m_p1.GetCurrentTile(), m_p2.GetCurrentTile()))
            {
                minigame_in_progress = true;
                ModalPanel.Instance().Activate();
            }

            this.GetComponent <Animator>().SetTrigger("TurnWait");
            //Activate waiting camera
            //StartTurn();
        }
    }
Beispiel #5
0
    public void DeleteProfiles()
    {
        //Confirm that profiles are going to be deleted.
        ModalPanel modalPanel = ModalPanel.Instance();

        modalPanel.Choice("Delete profiles?", ConfirmProfileDeletion, AbortAction);
    }
Beispiel #6
0
 void Awake()
 {
     modalPanel     = ModalPanel.Instance();
     myYesAction    = new UnityAction(TestYesFuncion);
     myNoAction     = new UnityAction(TestNoFunction);
     myCancelAction = new UnityAction(TestCancelFunction);
 }
Beispiel #7
0
    private void Awake()
    {
        modalPanel     = ModalPanel.Instance();
        displayManager = DisplayManager.Instance();

        onWonOk = new UnityAction(OnWonOk);
    }
 void Awake()
 {
     modalPanel               = ModalPanel.Instance();
     displayManager           = DisplayManager.Instance();
     inGameUIManagerTimerClue = InGameUIManagerTimerClue.Instance();
     finderController         = FinderController.Instance();
 }
 private void Awake()
 {
     modalPanel     = ModalPanel.Instance();
     PlayerMovement =
         GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>();
     player = GameObject.FindWithTag("Player");
 }
 public void Start()
 {
     _testModal     = new TestModalWindow();
     _visual        = _waypoints.GetComponent <VisualConnections>();
     modalPanel     = ModalPanel.Instance();
     displayManager = DisplayManager.Instance();
 }
Beispiel #11
0
    void Start()
    {
        water = new List <AudioClip>(new AudioClip[] { sound1, sound2, sound3, sound4, sound5, sound6, sound7, sound8, sound9,
                                                       sound10, sound11, sound12, sound13, sound14, sound15, sound16 });
        wood = new List <AudioClip>(new AudioClip[] { sound17, sound18, sound19, sound20, sound21, sound22, sound23, sound24, sound25,
                                                      sound26, sound27, sound28, sound29, sound30, sound31, sound32 });
        iron = new List <AudioClip>(new AudioClip[] { sound33, sound34, sound35, sound36, sound37, sound38, sound39, sound40, sound41,
                                                      sound42, sound43, sound44, sound45, sound46, sound47, sound48 });
        earth = new List <AudioClip>(new AudioClip[] { sound49, sound50, sound51, sound52, sound53, sound54, sound55, sound56, sound57,
                                                       sound58, sound59, sound60, sound61, sound62, sound63, sound64 });
        fire = new List <AudioClip>(new AudioClip[] { sound65, sound66, sound67, sound68, sound69, sound70, sound71, sound72, sound73,
                                                      sound74, sound75, sound76, sound77, sound78, sound79, sound80 });
        modalPanel = ModalPanel.Instance();
        //water
        watersoundpicker();
        wateractioncreated();
        //wood
        woodsoundpicker();
        woodactioncreated();
        //iron
        ironsoundpicker();
        ironactioncreated();
        //earth
        earthsoundpicker();
        earthactioncreated();
        //fire
        firesoundpicker();
        fireactioncreated();

        gameObject.AddComponent <AudioSource>();
        //source.playOnAwake = false;

        sceneCam = GameObject.Find("Main Camera");
    }
Beispiel #12
0
    public void OpenImportOps()
    {
        List <KeyValuePair <string, UnityAction> > importOptions =
            new List <KeyValuePair <string, UnityAction> >();

        GameInterface GI = GameInterface.instance;


        importOptions.Add(new KeyValuePair <string, UnityAction>("JSON Array - Don't use if attackers and defenders share troop types", () => {
            GI.textInputPanel.SetPanelInfo("JSON Text to Import", "insert the JSON string here", "", "Import", () => {
                SerializedTroop[] readTroops = JsonHandlingUtils.JsonToSerializedTroopArray
                                                   (GI.textInputPanel.theInputField.text);
                if (readTroops == null)
                {
                    ModalPanel.Instance().OkBox("Json Import Failed", "Please check your JSON string, it must be something like [{'name':'troop', 'amount':5}]");
                    return;
                }

                TroopList attackersRemaining = new TroopList(),
                defendersRemaining           = new TroopList();

                foreach (SerializedTroop tnp in readTroops)
                {
                    //Debug.Log("got this kvp: " + tnp.name + " : " + tnp.amount);

                    TroopNumberPair convertedTNP = JsonHandlingUtils.SerializedTroopToTroopNumberPair(tnp);
                    if (convertedTNP.troopAmount > 0)
                    {
                        if (battlePhase.battleData.defenderSideInfo.sideArmy.IndexOfTroopInThisList(convertedTNP.troopTypeID) != -1)
                        {
                            defendersRemaining.Add(convertedTNP);
                        }
                        else if (battlePhase.battleData.attackerSideInfo.sideArmy.IndexOfTroopInThisList(convertedTNP.troopTypeID) != -1)
                        {
                            attackersRemaining.Add(convertedTNP);
                        }
                    }
                }

                battlePhase.battleData.defenderSideInfo.SetPostBattleArmyData_RemainingArmy(defendersRemaining);
                battlePhase.battleData.attackerSideInfo.SetPostBattleArmyData_RemainingArmy(attackersRemaining);

                if (!battlePhase.battleData.BattleEndCheck())
                {
                    //we only need to update side info displays if the battle hasn't ended yet,
                    //because the delegate would take care of it otherwise
                    UpdateArmyDisplays();
                }

                GI.textInputPanel.Close();
            });
            GI.textInputPanel.Open();
            GI.exportOpsPanel.gameObject.SetActive(false);
        }));


        //when done preparing options, open the import ops panel
        GI.exportOpsPanel.Open("Remaining Armies: Import Options", importOptions);
    }
Beispiel #13
0
    // Use this for initialization
    public override void Activate()
    {
        modalPanel      = ModalPanel.Instance();
        buildBeforeMove = false;

        button1Action = new UnityAction(BuildBeforeMove);
        button2Action = new UnityAction(base.ExitState);
    }
    public GameObject salsaRecipe;                                        //assign a gameobject in the editor

    /*Initializes the panel*/
    private void Awake()
    {
        modalPanel = ModalPanel.Instance();                         //set modal panel to a new instance

        myYesAction  = new UnityAction(YesFunction);                //assign the action for Yes
        myNoAction   = new UnityAction(NoFunction);                 //assign the action for No
        myOkayAction = new UnityAction(OkayFunction);               //assign the action for Okay
    }
Beispiel #15
0
    void Awake()
    {
        mp = ModalPanel.Instance();

        yeAct   = new UnityAction(TestYesFunc);
        noAct   = new UnityAction(TestNoFunc);
        maybAct = new UnityAction(TestMaybeFunc);
    }
    void Awake()
    {
        hintUIController = GameObject.Find("HintCanvas").GetComponent <ToggleHintUI>();
        hintUIController.toggleHint();

        modalPanel = ModalPanel.Instance();
        entered    = false;
    }
Beispiel #17
0
    void Awake()
    {
        Library.initializeGameData();

        modalPanel = ModalPanel.Instance();
        quitAction = new UnityAction(QuitAction);
        logEvent   = new StringEvent();
    }
Beispiel #18
0
    private void InitAlertBox()
    {
        _modalPanel = ModalPanel.Instance();

        // Initialize Actions
        _mPlayYesAction = new UnityAction(OnPlayYesAction);
        _mPlayNoAction  = new UnityAction(OnPlayNoAction);
    }
Beispiel #19
0
    void Awake()
    {
        modalPanel = ModalPanel.Instance();
        //personPanelPrefab = Resources.LoadAssetAtPath<GameObject>("Assets/GroupManagement/Prefabs/PersonListItem.prefab");

        personsListContent = personsListPanel.FindComponentInChildWithTag <RectTransform>("ListViewContent");
        listHeaderText     = personsListPanel.FindComponentInChildWithTag <Text>("ListHeaderText");
    }
    GameObject menu_panel = default;        // Reference to return panel

    private void Awake()
    {
        modal_panel = ModalPanel.Instance();
        // Get the reference to the GameFilesHandler game object
        GameObject game_files = GameObject.FindGameObjectWithTag("GameFiles");

        files_handler = game_files.GetComponent <GameFilesHandler>();
    }
Beispiel #21
0
    void Awake()
    {
        modalPanel = ModalPanel.Instance();

        yesEvent    = new UnityAction(Testbutton1);
        noEvent     = new UnityAction(Testbutton2);
        cancelEvent = new UnityAction(TestCancel);
    }
Beispiel #22
0
    private void Awake()
    {
        modalPanel     = ModalPanel.Instance();
        displayManager = DisplayManager.Instance();

        myOkAction   = new UnityAction(TestOkFunction);
        myExitAction = new UnityAction(TestExitFunction);
    }
Beispiel #23
0
    public override void Activate()
    {
        firstBuild      = true;
        firstBuildSpace = null;
        modalPanel      = ModalPanel.Instance();

        button1Action = new UnityAction(ExitFirstBuildState);
        button2Action = new UnityAction(base.ExitBuildState);
    }
Beispiel #24
0
    public void PopUpNotification()
    {
        modalPanel = ModalPanel.Instance();

        myOkAction     = new UnityAction(TestOkFunction);
        myCancelAction = new UnityAction(TestCancelFunction);

        TestOptions();
    }
    private void InitAlertBox()
    {
        _modalPanel = ModalPanel.Instance();

        // Initialize Actions
        _mRandomChallengeYesAction = new UnityAction(OnRandomChallengeYesAction);
        _mChallengeYesAction       = new UnityAction(OnChallengePlayerYesAction);
        _mNoAction = new UnityAction(OnNoAction);
    }
Beispiel #26
0
    void Awake()
    {
        modalPanel     = ModalPanel.Instance();
        displayManager = DisplayManager.Instance();

        myYesAction  = new UnityAction(TestYesFunction);
        myNoAction   = new UnityAction(TestNoFunction);
        myOkayAction = new UnityAction(TestOkayFunction);
    }
    // Use this for initialization
    void Start()
    {
        scream    = Resources.Load <AudioClip>("scream");
        breathing = Resources.Load <AudioClip>("rampBreathing2");
        originalAmbientIntensity = RenderSettings.ambientIntensity;

        modalPanel = ModalPanel.Instance();
        endPanel   = EndPanel.Instance();
    }
Beispiel #28
0
    void Awake()
    {
        modalPanel     = ModalPanel.Instance();
        displayManager = DisplayManager.Instance();

        yeAct   = new UnityAction(TestYesFunc);
        noAct   = new UnityAction(TestNoFunc);
        maybAct = new UnityAction(TestMaybeFunc);
    }
    void Awake()
    {
        modalPanel     = ModalPanel.Instance();
        displayManager = DisplayManager.Instance();

        myResumeAction  = new UnityAction(TestResumeFunction);
        myRestartAction = new UnityAction(TestRestartFunction);
        myQuitAction    = new UnityAction(TestQuitFunction);
    }
Beispiel #30
0
    void Start()
    {
        mAudioSource = GetComponent <AudioSource> ();

        modalPanel = ModalPanel.Instance();           // This panel is required for Notifications

        myOkAction     = new UnityAction(GoToTask);   // We have to assign the function, once the "Ok" button is clicked on the Notification
        myCancelAction = new UnityAction(CancelTask); // The same applies to "Cancel"
    }