示例#1
0
    private void Awake()
    {
        if (_instance != null && _instance != this)
        {
            Destroy(gameObject);
        }
        else
        {
            _instance = this;
        }

        _miniWait   = new WaitForSeconds(_miniDelayLength);
        _shortWait  = new WaitForSeconds(_shortDelayLength);
        _mediumWait = new WaitForSeconds(_mediumDelayLength);
        _longWait   = new WaitForSeconds(_longDelayLength);

        informationManager = GameObject.Find("InformationManager").GetComponent <InformationManager>();
        scenarioManager    = GameObject.Find("ScenarioManager").GetComponent <ScenarioManager>();
        audioManager       = GameObject.Find("AudioManager").GetComponent <AudioManager>();
        characterHandler   = GetComponent <CharacterHandler>();
        itemHandler        = GetComponent <ItemHandler>();
        interfaceHandler   = GetComponent <InterfaceHandler>();
        eventHandler       = GetComponent <EventHandler>();
        pollHandler        = GetComponent <PollHandler>();
        arrowHandler       = GetComponent <ArrowHandler>();
        twitchManager      = GameObject.Find("TwitchManager").GetComponent <TwitchManager>();

        OnRessourceValueChange += VariableChangeRessourcesHandler;
    }
        public void Run(ArrowHandler left, ArrowHandler right, ArrowHandler up, ArrowHandler down)
        {
            while (true)
            {
                var key = Console.ReadKey(true);
                switch (key.Key)
                {
                case ConsoleKey.LeftArrow:
                    left();
                    break;

                case ConsoleKey.RightArrow:
                    right();
                    break;

                case ConsoleKey.UpArrow:
                    up();
                    break;

                case ConsoleKey.DownArrow:
                    down();
                    break;
                }
            }
        }
示例#3
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(gameObject);
         return;
     }
 }
示例#4
0
 /// <summary>
 /// Method says what to do when button is pressed
 /// </summary>
 /// <param name="left">left</param>
 /// <param name="right">right</param>
 /// <param name="up">up</param>
 /// <param name="down">down</param>
 public void Move(ArrowHandler up, ArrowHandler down, ArrowHandler left, ArrowHandler right)
 {
     while (true)
     {
         var button = Console.ReadKey(true);
         switch (button.Key)
         {
             case ConsoleKey.UpArrow:
                 up();
             break;
             case ConsoleKey.DownArrow:
                 down();
             break;
             case ConsoleKey.LeftArrow:
                 left();
             break;
             case ConsoleKey.RightArrow:
                 right();
             break;
         }
     }
 }
 public void Run(ArrowHandler left, ArrowHandler right, ArrowHandler up, ArrowHandler down)
 {
     while (true)
     {
         var key = Console.ReadKey(true);
         switch (key.Key)
         {
             case ConsoleKey.LeftArrow:
                 left();
                 break;
             case ConsoleKey.RightArrow:
                 right();
                 break;
             case ConsoleKey.UpArrow:
                 up();
                 break;
             case ConsoleKey.DownArrow:
                 down();
                 break;
         }
     }
 }
示例#6
0
 private void Start()
 {
     arrowHandler = FindObjectOfType <ArrowHandler>();
     arrowHandler.gameObject.SetActive(false);
 }
示例#7
0
 public void SetArrowHandler(ArrowHandler arrowHandler)
 {
     this.arrowHandler = arrowHandler;
 }