Beispiel #1
0
    // Start is called before the first frame update
    void Start()
    {
        Manage         = GameObject.Find("Manage").GetComponent <Manage>();
        Playeraudio    = GameObject.Find("Playeraudio").GetComponent <AudioSource>();
        Hearthaudio    = GameObject.Find("Hearthaudio").GetComponent <AudioSource>();
        Stoneaudio     = GameObject.Find("Stoneaudio").GetComponent <AudioSource>();
        QuestionScreen = GameObject.Find("SceneController").GetComponent <QuestionScreen>();
        Manage.Player  = gameObject;
        Rgb2d          = GetComponent <Rigidbody2D>();
        Anim           = GetComponent <Animator>();
        Cam            = GameObject.Find("Main Camera");
        Manage.Cam     = Cam;
        Items          = GameObject.Find("Barlife").GetComponent <Barlife>();

        if (Manage.Sunglass > 0)
        {
            Sunglass[Manage.Sunglass - 1].SetActive(true);
        }
        if (Manage.Cap > 0)
        {
            Cap[Manage.Cap - 1].SetActive(true);
        }
        Myspeed          = 0;
        Manage.Moveleft  = false;
        Manage.Moveright = false;
    }
Beispiel #2
0
        /// <summary>
        /// Event handler for when the Ask Question menu entry is selected.
        /// </summary>
        private async void QuestionMenuEntrySelected(object sender, ClickEventArgs e)
        {
            //Ask a simple question.
            var screen = new QuestionScreen(_cards, null, fontSmall, fontMedium);

            screen.QuestionAnswered += QuestionAnswered;
            await ScreenManager.AddScreen(screen);
        }
    private void Start()
    {
        levelmanager   = FindObjectOfType <LevelManager>();
        deckHolder     = FindObjectOfType <DeckHolder>();
        questionScreen = FindObjectOfType <QuestionScreen>();
        questionScreen.gameObject.SetActive(false);

        // TO DO may need to organize when to grab these cards in case they are disabled before reaching them
    }
Beispiel #4
0
        static void Main(string[] args)
        {
            var context = new Context();

            // rules
            var re = new ProductionRuleEngine <Context>(new List <IProductionRule <Context> >()
            {
                new SunShiningRule(), new SuperNovaRule()
            });

            var screen1 = new SimpleWizard.QuestionScreen <Context>()
            {
                QuestionText  = "Shining?",
                QuestionType  = typeof(bool),
                ReflectAnswer = (a, c) => c.IsSunShining = (bool)a
            };

            var screen2 = new SimpleWizard.QuestionScreen <Context>()
            {
                QuestionText  = "Likes sun?",
                QuestionType  = typeof(bool),
                ReflectAnswer = (a, c) => c.PersonLikesSun = (bool)a
            };

            var screen3 = new QuestionScreen <Context>()
            {
                QuestionText  = "Sun gone nova?",
                QuestionType  = typeof(bool),
                ReflectAnswer = (a, c) => c.SunGoneNova = (bool)a
            };

            var edge = new ScreenLink <Context>()
            {
                Source = screen1, Target = screen2, TraverseCondition = c => !c.IsPersonHappy.HasValue
            };
            var edge2 = new ScreenLink <Context>()
            {
                Source = screen2, Target = screen3, TraverseCondition = c => c.IsPersonHappy == true
            };

            var wm = new WizardManager <Context>(new[] { screen1, screen2, screen3 }, new[] { edge, edge2 }, c => re.Run(c));

            var cc = new ConsoleWizardClient <Context>(wm, context);

            cc.Start();
            var outcome = context.IsPersonHappy;

            Console.WriteLine("Outcome: " + outcome);
            Console.ReadKey();
        }