Пример #1
0
        protected override void OnInitComponent()
        {
            m_lbtips   = GetControl <Text>("WindowContent/lbtips");
            m_btnLogin = GetControl <Button>("WindowContent/btnLogin");

            UIInterface.AddListener(m_btnLogin, UIEventType.onClick, OnClickLogin);
        }
Пример #2
0
        public async static Task<CoreTask> GetCoreTask(string userName, string pw, UIInterface ui)
        {
            if (!coreTasks.Keys.Contains(userName))
            {

                CoreTask ct = new CoreTask();
                await ct.Init(userName, pw, ui);
                if (ct.instance != null)
                {
                    coreTasks[userName] = ct;
                    return ct;

                }
                return null;
            }
            else
            {

                if (pw == coreTasks[userName].pw)
                {
                    return coreTasks[userName];
                }
                else
                    return null;


            }
        }
Пример #3
0
        /// <summary>
        /// Receives the client's choice
        /// and retrieves the product's price.
        /// </summary>
        /// <returns>Price of selected product.</returns>
        /// <exception cref="VendingMachine.Exceptions.SoldOutException">Thrown when product is sold out.</exception>
        /// <param name="i_VendingMachine">Vending machine instance.</param>
        /// <param name="i_Product">Selected product.</param>
        private static int selectProductAndGetPrice(NewVendingMachine i_VendingMachine, eProduct i_Product)
        {
            bool isAvailable = true;

            do
            {
                try
                {
                    if (i_VendingMachine.ProductInventory.getQuantity(i_Product) > 0)
                    {
                        i_VendingMachine.CurrentProduct = i_Product;
                    }
                    else
                    {
                        isAvailable = false;
                        throw new SoldOutException();
                    }
                }
                catch (SoldOutException SoldOut)
                {
                    UIInterface.PrintToCMD(SoldOut.Message);
                }
            }while (!isAvailable);

            return((int)i_Product);
        }
Пример #4
0
        private static void invalidMessage()
        {
            string message = string.Format(
                @"Invalid Input!{0}",
                Environment.NewLine);

            UIInterface.PrintToCMD(message);
        }
Пример #5
0
        /// <summary>
        /// Prompts the client to enter specific amount of money.
        /// </summary>
        /// <param name="i_Amount">Amount to pay by the client.</param>
        private static void enterAmountMessage(int i_Amount)
        {
            string message = string.Format(
                @"Please enter {1} Shekels:{0} ",
                Environment.NewLine,
                i_Amount);

            UIInterface.PrintToCMD(message);
        }
Пример #6
0
        /// <summary>
        /// Prompts the client of the amount left to pay.
        /// </summary>
        /// <param name="i_AmountLeft">Amount left to pay by the client.</param>
        private static void showAmountLeft(int i_AmountLeft)
        {
            string message = string.Format(
                @"You need {0} more shekels to complete the purchase{1}",
                i_AmountLeft,
                Environment.NewLine);

            UIInterface.PrintToCMD(message);
        }
Пример #7
0
 void Start()
 {
     initCards();
     GAME      = this;
     uiManager = GetComponent <UIInterface>();
     board     = GetComponent <GridGenerator>().GenerateGrid();
     floatingTextController.init();
     uiManager.init();
 }
Пример #8
0
        protected override void OnInitComponent()
        {
            m_btnExecute = GetControl <Button>("WindowContent/btnexecute");
            m_btnHide    = GetControl <Button>("WindowContent/btnhide");
            m_txtCmd     = GetControl <InputField>("WindowContent/txtcmd");

            m_txtCmd.text = "open XXX";
            UIInterface.AddListener(m_btnExecute, UIEventType.onClick, OnClickExecute);
            UIInterface.AddListener(m_btnHide, UIEventType.onClick, OnHide);
        }
Пример #9
0
        /// <summary>
        /// Prompts the client to enter a coin.
        /// </summary>
        /// <returns>String representation of the client's coin.</returns>
        private static string getCoinFromUser()
        {
            string coinFromClient = string.Empty;
            string message        = string.Format(
                @"Please enter coin:{0}",
                Environment.NewLine);

            UIInterface.PrintToCMD(message);
            coinFromClient = UIInterface.GetInputFromUser();

            return(coinFromClient);
        }
Пример #10
0
    private void Awake()
    {
        if (_instance != null)
        {
            return;
        }
        _instance = this;

        btnPause.onClick.AddListener(() =>
        {
            OnlineGameManager.Instance.OnPauseGame();
        });
    }
Пример #11
0
 protected override void Awake()
 {
     base.Awake();
     max_distance      = 300;
     distance          = max_distance;
     skillFlag         = false;
     _player           = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>();
     bgm               = GameObject.FindGameObjectWithTag("BackgroundRoot").GetComponent <BackGroundMove>();
     Obstacles         = GameObject.FindGameObjectsWithTag("obstacle"); // 장애물 모두 받아오기
     characterAltitude = transform.position.y;
     ourInterface      = GameObject.FindGameObjectWithTag("Canvas").GetComponent <Canvas>().GetComponent <UIInterface>();
     obsPos_mid        = GameObject.FindGameObjectWithTag("obstaclePos3");
 }
Пример #12
0
        /// <summary>
        /// Prompts the client to confirm the purchase or get a refund.
        /// </summary>
        /// <returns>Correlating int input.</returns>
        private static int clientConfirmPurchaseOrRefund()
        {
            string userInput;

            string message = string.Format(
                @"Choose 'Confirm' to complete the purchase or 'Refund' to cancel:{0}
 1. Confirm{0}
 2. Refund{0}",
                Environment.NewLine);

            UIInterface.PrintToCMD(message);
            userInput = UIInterface.GetInputFromUser();

            return(int.Parse(userInput));
        }
Пример #13
0
    protected override void Awake()
    {
        base.Awake();
        max_distance = 300;
        distance = max_distance;
        skillFlag = false;
        _player = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController>();
        bgm = GameObject.FindGameObjectWithTag("BackgroundRoot").GetComponent<BackGroundMove>();
        Obstacles = GameObject.FindGameObjectsWithTag("obstacle");  // 장애물 모두 받아오기
        characterAltitude = transform.position.y;
        ourInterface = GameObject.FindGameObjectWithTag("Canvas").GetComponent<Canvas>().GetComponent<UIInterface>();
        obsPos_mid = GameObject.FindGameObjectWithTag("obstaclePos3");
        

    }
Пример #14
0
 // Use this for initialization
 void Awake()
 {
     if (!once)
     {
         DontDestroyOnLoad(gameObject);
         once = true;
     }
     else
     {
         Destroy(gameObject);
     }
     m_dialog      = GameObject.FindObjectOfType <DialogManage>();
     m_frag        = GameObject.FindObjectOfType <FragmentSystem>();
     m_ui          = GameObject.FindObjectOfType <UIInterface>();
     m_pubSwitches = GameObject.FindObjectOfType <SwitchGroup>();
     m_sceneData   = GameObject.FindObjectOfType <SceneSaveData>();
 }
Пример #15
0
    public T GetUI <T>(string uiName) where T : MonoBehaviour
    {
        UIInterface uiInterface = null;

        if (uis.TryGetValue(uiName, out uiInterface))
        {
        }
        else
        {
            GameObject uiPrefab = Resources.Load <GameObject>(UIManagerPath.FGUIPath + uiName);
            if (uiPrefab == null)
            {
                uiPrefab = Resources.Load <GameObject>(UIManagerPath.SpinePath + uiName);
            }

            if (uiPrefab != null)
            {
                var uiObj = Instantiate(uiPrefab, FGUIParent);

                if (!objs.ContainsKey(uiName))
                {
                    objs.Add(uiName, uiObj);
                }

                uiInterface = uiObj.GetComponent <UIInterface>();
                if (uiInterface != null)
                {
                    // uiInterface.Init();
                    if (!uis.ContainsKey(uiName))
                    {
                        uis.Add(uiName, uiInterface);
                    }
                }
                else
                {
                    Debug.LogError("UI不为UIInterface类型: " + uiName);
                }
            }
            else
            {
                Debug.LogError("UI找不到: " + uiName);
            }
        }

        return(uiInterface as T);
    }
Пример #16
0
        public async Task Init(string userName, string pw, UIInterface ui)
        {

            instance = await InstanceManager.GetInstance(userName, pw, ui);
            isRunning = false;
            if (instance != null)
            {

                this.userName = userName;
                this.pw = pw;
                actionTimer.Elapsed += actionTimer_Elapsed;
                actionTimer.Interval = 1000 * 30;
                actionTimer.AutoReset = true;
                actionTimer.Enabled = true;
            }

        }
Пример #17
0
    // Use this for initialization
    void Start()
    {
        UI = this;

        image_progressBar.fillMethod = Image.FillMethod.Horizontal;
        image_progressBar.type       = Image.Type.Filled;

        image_hungerBar.fillMethod = Image.FillMethod.Horizontal;
        image_hungerBar.type       = Image.Type.Filled;

        image_detectionBar.enabled = image_detectionBarDark.enabled = detectionOn;

        if (detectionOn)
        {
            image_detectionBar.fillMethod = Image.FillMethod.Horizontal;
            image_detectionBar.type       = Image.Type.Filled;
            SetDetectionBar(SecurityDetection.Instance.detectionPercent);
        }
    }
Пример #18
0
 protected BaseController()
 {
     UIInterface = new UIInterface();
 }
Пример #19
0
 public Presenter(UIInterface view)
 {
     IView     = view;
     gameModel = new TicTacToeModel();
     StartGame();
 }
Пример #20
0
 protected override void OnDestroy()
 {
     UIInterface.RemoveListener(m_btnExecute, UIEventType.onClick);
     UIInterface.RemoveListener(m_btnHide, UIEventType.onClick);
 }
Пример #21
0
 private static void showMessage(string i_message)
 {
     UIInterface.PrintToCMD(i_message);
 }
Пример #22
0
 public virtual void showPreview(UIInterface uiManager)
 {
 }
Пример #23
0
 protected override void OnDestroy()
 {
     UIInterface.RemoveListener(m_BtnMask, UIEventType.onClick);
 }
Пример #24
0
 public Spider(UIInterface ui)
 {
     this.ui = ui;
 }
Пример #25
0
 protected override void OnInitComponent()
 {
     m_BtnMask = GetControl <Button>("WindowContent/mask");
     UIInterface.AddListener(m_BtnMask, UIEventType.onClick, OnClose);
 }