Exemplo n.º 1
0
 public void Show(string msg)
 {
     rootObject.gameObject.SetActive(true);
     msgText.text = msg;
     cg.DOFade(1, .5f);
     GlowTimer.SetTimer(2, () => Hide());
 }
Exemplo n.º 2
0
 /// <summary>
 /// build card decks, activate optional deployment
 /// </summary>
 void StartNewGame()
 {
     fameButton.interactable = DataStore.sessionData.useAdaptiveDifficulty;
     //create deployment hand and manual deploy list
     DataStore.CreateDeploymentHand();
     //foreach ( var d in dh )
     //	Debug.Log( "DH: " + d.name );
     DataStore.CreateManualDeployment();
     //deploy heroes
     for (int i = 0; i < DataStore.sessionData.MissionHeroes.Count; i++)
     {
         dgManager.DeployHeroAlly(DataStore.sessionData.MissionHeroes[i]);
     }
     if (DataStore.sessionData.MissionHeroes.Count == 3)
     {
         Debug.Log("Creating dummy hero");
         dgManager.DeployHeroAlly(new CardDescriptor()
         {
             isDummy = true
         });
     }
     //deploy ally
     if (DataStore.sessionData.selectedAlly != null)
     {
         dgManager.DeployHeroAlly(DataStore.sessionData.selectedAlly);
     }
     //lay out starting groups
     dgManager.DeployStartingGroups();
     //perform option deployment if it's toggled
     if (DataStore.sessionData.optionalDeployment == YesNo.Yes)
     {
         GlowTimer.SetTimer(1, () => deploymentPopup.Show(DeployMode.Landing, false, true));
     }
 }
Exemplo n.º 3
0
 public void ShowError(string err)
 {
     errorText.text = err;
     Debug.Log(err);
     GlowTimer.SetTimer(5, () =>
     {
         errorText.text = "";
     });
 }
Exemplo n.º 4
0
 /// <summary>
 /// Toggles mouse/touch input with a delay
 /// </summary>
 public void ToggleInput(bool disabled)
 {
     //the delay avoids things being re-enabled on the same frame
     if (disabled == true)
     {
         disableInput = true;
     }
     else
     {
         GlowTimer.SetTimer(1, () => { disableInput = false; });
     }
 }
Exemplo n.º 5
0
    //new game->select save->select journey (scenario)->select heroes->show pre-game message->start game

    //new game->select save->select journey (campaign)->select heroes->show campaign screen->start game

    //load game->select save->start game OR campaign screen

    private void Start()
    {
        var          settings = Bootstrap.LoadSettings();
        Vignette     v;
        ColorGrading cg;

        if (volume.profile.TryGetSettings(out v))
        {
            v.active = settings.Item2 == 1;
        }
        if (volume.profile.TryGetSettings(out cg))
        {
            cg.active = settings.Item3 == 1;
        }
        music.enabled = settings.Item1 == 1;

        newBcg  = newButton.GetComponent <CanvasGroup>();
        loadBcg = loadButton.GetComponent <CanvasGroup>();

        selectJourney.AddScenarioPrefabs();

        //find campaign packages and unzip them into folders
        FileManager.UnpackCampaigns();

        if (Bootstrap.returnToCampaign)
        {
            skipped = true;
            finalFader.DOFade(1, .5f).OnComplete(() =>
            {
                campaignScreen.ActivateScreen(new TitleMetaData()
                {
                    slotMode                = 1,
                    campaignState           = Bootstrap.campaignState,
                    skippedToCampaignScreen = true
                });
            });
        }
        else
        {
            GlowTimer.SetTimer(5, () =>
            {
                newButton.transform.DOLocalMoveX(-700, .75f);
                loadButton.transform.DOLocalMoveX(-700, .75f);
                newBcg.interactable  = true;
                loadBcg.interactable = true;
            });
        }
    }
Exemplo n.º 6
0
    void Start()
    {
        cam = Camera.main;

        GlowTimer.SetTimer(8, () =>
        {
            try
            {
                GetComponent <Animator>().enabled = false;
                button1.DOLocalMoveX(-700, 1).SetEase(Ease.InOutQuad);
                button2.DOLocalMoveX(-700, 1).SetEase(Ease.InOutQuad).SetDelay(1);
                optionButton.DOLocalMoveX(880, 1).SetEase(Ease.InOutQuad);

                gotime = true;
                InvokeRepeating(nameof(animateCam), 0, 8);
            }
            catch { }
        });
    }
Exemplo n.º 7
0
    void FinishChapterTrigger(Chapter c, bool firstChapter)
    {
        string s = "Prepare the following tiles:\r\n\r\n";

        foreach (HexTile ht in c.tileObserver)
        {
            s += ht.idNumber + ", ";
        }
        s = s.Substring(0, s.Length - 2);

        FindObjectOfType <InteractionManager>().GetNewTextPanel().ShowOkContinue(s, ButtonIcon.Continue, () =>
        {
            //TileGroup tg = FindObjectOfType<TileManager>().CreateGroupFromChapter( c );
            TileGroup tg = c.tileGroup;

            if (tg == null)
            {
                Debug.Log("FinishChapterTrigger::WARNING::Chapter has no tiles: " + c.dataName);
                return;
            }

            tg.ActivateTiles();
            FindObjectOfType <Engine>().RemoveFog(tg.GetChapter().dataName);

            //attempt to attach this tg, but only if it IS dynamic
            //fall back to using random tg if it doesn't fit
            if (c.isDynamic)
            {
                StartCoroutine(AttachTile(tg));

                ////get ALL explored tilegroups in play
                //var tilegroups = ( from ch in chapterList
                //									 where ch.tileGroup.isExplored
                //									 select ch.tileGroup ).ToList();

                //bool success = false;

                //if ( previousGroup != null )
                //{
                //	success = tg.AttachTo( previousGroup );
                //	//remove so not attempted again below
                //	tilegroups.Remove( previousGroup );
                //}
                //else
                //{
                //	int randIdx = GlowEngine.GenerateRandomNumbers( tilegroups.Count )[0];
                //	TileGroup randGroup = tilegroups[randIdx];
                //	success = tg.AttachTo( randGroup );
                //	//remove so not attempted again below
                //	tilegroups.RemoveAt( randIdx );
                //}

                //if ( !success )
                //{
                //	Debug.Log( "***SEARCHING for random tilegroup to attach to..." );
                //	foreach ( TileGroup _tg in tilegroups )
                //	{
                //		success = tg.AttachTo( _tg );
                //		if ( success )
                //			break;
                //	}
                //}
            }

            tg.AnimateTileUp(c);

            previousGroup = tg;

            if (firstChapter && c.isPreExplored)
            {
                tg.Colorize();
                tg.isExplored = true;
            }

            FindObjectOfType <CamControl>().MoveTo(tg.groupCenter);

            //check triggered token queue
            var foo = from tname in tokenTriggerQueue from tile in tg.tileList.Where(x => x.HasTriggeredToken(tname)) select new { tile, tname };
            //if ( foo.Count() > 0 )
            //Debug.Log( "FinishChapterTrigger::" + foo.Count() );
            foreach (var item in foo)
            {
                item.tile.EnqueueTokenTrigger(item.tname);
                //tokenTriggerQueue.Remove( item.tname );
            }

            if (tg.startPosition.x != -1000)
            {
                GlowTimer.SetTimer(1, () =>
                {
                    startMarker.Spawn(tg.startPosition);
                    if (firstChapter && !c.isPreExplored)
                    {
                        tg.Colorize(true);
                        tg.isExplored = true;
                    }
                });
                FindObjectOfType <InteractionManager>().GetNewTextPanel().ShowOkContinue("Place your Heroes in the indicated position.", ButtonIcon.Continue);
            }
        });
    }