コード例 #1
0
 // Use this for initialization
 void Start()
 {
     //ply = FindObjectOfType<Player>();
     diceRoll = FindObjectOfType <DiceRollCtrl>();
     //		UIrollPlane.SetActive (false);
     msgUI = msgGO.GetComponent <MessageUI>();
 }
コード例 #2
0
        protected override async Task OnInitializedAsync()
        {
            messageUI = new MessageUI(MessageDataService, mapper, UserName);
            messages  = await messageUI.GetList();

            MessageCount = messages.Count();
        }
コード例 #3
0
    void DisplayPlayerMessage(Channel MessageChannel, string MessageContent)
    {
        GameObject message;

        message = GameObject.Instantiate(MessageChannel.OutgoingMessagePrefab, MessageChannel.ContentPanel.transform);
        MessageUI M = message.GetComponent <MessageUI>();

        //Player messages don't have a name or portrait to worry about
        M.MessageText.text = MessageContent;
        M.MessageText.ForceMeshUpdate();
        M.CharacterName         = "Player";
        M.BackgroundImage.color = PlayerMessageColor;
        //Canvas.ForceUpdateCanvases();
        float TextHeight = M.MessageText.preferredHeight;
        int   linecount  = M.MessageText.textInfo.lineCount;

        //Debug.Log("Message height: " + TextHeight + " line count: " + linecount);
        //This is here to work around a bug in TMP where it doesn't always provide an accurate linecount/height if text is very close to the limit
        //A character count is a terribly rough way to do this, but worst case is it makes extra-wide messages when they're not needed, which is
        //better than overflowing
        if (linecount == 1 && MessageContent.Length >= 36)
        {
            TextHeight *= 2;
        }
        RectTransform rt = M.gameObject.transform as RectTransform;

        rt.sizeDelta = new Vector2(rt.rect.width, TextHeight + 10);
        CleanCanvases(MessageChannel);
        MessageChannel.PlayerTextArea.text = "";
        WaitingForPlayerInput = false;
        //audio player sends message
        AkSoundEngine.PostEvent("Reply", gameObject);
    }
コード例 #4
0
 // Use this for initialization
 void Start()
 {
     ply    = FindObjectOfType <Player>();
     msgUI  = FindObjectOfType <MessageUI>();
     rollUI = FindObjectOfType <RollDiceUIManager>();
     isRoll = false;
 }
コード例 #5
0
 public void OnCursorEnter()
 {
     //Debug.Log (IsOpen);
     if (IsOpen)
     {
         //Debug.Log ("enter");
         if (!m_repeat && IsClose)
         {
             return;
         }
         m_isTrigger = true;
         CursorManager.SetCursor(m_cursor);
                     #if UNITY_STANDALONE_WIN || UNITY_EDITOR
         if (!string.IsNullOrEmpty(m_hint))
         {
             m_msgCtr = MessageUI.AutoShowMessage(m_hint, false, () => {
                 if (null != m_msgCtr)
                 {
                     GameObject.Destroy(m_msgCtr.gameObject);
                     m_msgCtr = null;
                 }
             }, 1);
         }
                     #endif
     }
 }
コード例 #6
0
ファイル: BattleMenuUI.cs プロジェクト: dachongqing/Assets0.2
 // Use this for initialization
 void Start()
 {
     uiManager       = FindObjectOfType <RollDiceUIManager>();
     bagUIManager    = FindObjectOfType <BagUIManager>();
     messageUI       = FindObjectOfType <MessageUI>();
     mouseMoveManger = FindObjectOfType <MouseMoveManger>();
 }
コード例 #7
0
    IEnumerator EndAnimation(MessageUI MUI)
    {
        yield return(new WaitForSeconds(MUI.AnimationWaitTime));

        StartCoroutine(PreFinishAnimation(MUI));
        //audio
        AkSoundEngine.PostEvent("StopIsTyping", gameObject);
    }
コード例 #8
0
        protected override async Task OnInitializedAsync()
        {
            doctorUI = new DoctorUI(DoctorDataService);
            Doctors  = await doctorUI.GetList();

            messageUI = new MessageUI(MessageDataService, mapper, UserName);
            ResetDialog();
        }
コード例 #9
0
 public void Activate()
 {
     isDeactivated = false;
     gameObject.SetActive(true);
     if (SimulationSession.Current.simulationMode == SimulationMode.Manual)
     {
         MessageUI.DisplayMessage("Cortinas de luz reactivadas");
     }
 }
コード例 #10
0
    void Awake()
    {
        constructTowerMenu = constructTowerMenuPublic;
        turretDetailMenu   = turretDetailMenuPublic;
        currencyUI         = currencyUIPublic;
        messageUI          = messageUIPublic;
        livesUI            = livesUIPublic;
        winLoseUI          = winLoseUIPublic;

        menus = new Menu[] { constructTowerMenu, turretDetailMenu };
    }
コード例 #11
0
ファイル: MessageUI.cs プロジェクト: tomizawayuta2019/Valuta
 private void Awake()
 {
     Message = this;
     //text.gameObject.SetActive(false);
     back.gameObject.SetActive(false);
     tColor  = text.color;
     bColor  = back.color;
     b2Color = back2.color;
     messageImage.gameObject.SetActive(false);
     imageBack.gameObject.SetActive(false);
 }
コード例 #12
0
    IEnumerator PreFinishAnimation(MessageUI MUI)
    {
        //Debug.Log("PreFinishAnim " + MUI.MessageText.text);
        MUI.animator.StopPlayback();
        MUI.animator.enabled = false;
        MUI.TypingPrefab.SetActive(false);
        MUI.MessagePrefab.SetActive(true);
        yield return(new WaitForEndOfFrame());

        OnAnimationFinished(MUI);
    }
コード例 #13
0
ファイル: WoodDoor.cs プロジェクト: dachongqing/Assets0.2
    // Use this for initialization
    void Start()
    {
        eventController = FindObjectOfType <EventController>();

        roundController = FindObjectOfType <RoundController>();

        roomContraller = FindObjectOfType <RoomContraller>();

        camCtrl = FindObjectOfType <CameraCtrl>();

        msgUI = FindObjectOfType <MessageUI>();
    }
コード例 #14
0
 // Use this for initialization
 void Start()
 {
     roundController = FindObjectOfType <RoundController>();
     messageUI       = FindObjectOfType <MessageUI>();
     this.setIsEmpty(false);
     this.listenRoll = false;
     this.phase      = 1;
     uiManager       = FindObjectOfType <RollDiceUIManager>();
     item            = new ItemTask(ItemConstant.ITEM_CODE_SPEC_Y0006
                                    , ItemDesConstant.ITEM_CODE_SPEC_Y0006_NAME, ItemDesConstant.ITEM_CODE_SPEC_Y0006_NAME);
     this.setThingCode(ThingConstant.COMPUTER_01_CODE);
 }
コード例 #15
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (!Page.IsValid)
            {
                return;
            }

            MessageUI MessageUI = new MessageUI();

            MessageUI.Description = txtDescription.Text;

            if (IsNewMode)
            {
                List <string> SendTo = new List <string>();
                foreach (ListItem item in ddlSendTo.Items)
                {
                    if (item.Selected)
                    {
                        SendTo.Add(item.Value);
                    }
                }

                MessageId = MessagesController.CreateNewMessage(MessageUI);

                if ((SendTo.Count == 1 && SendTo[0] == "Suppliers") || SendTo.Count == 0 || SendTo.Count == 2)
                {
                    SupplierNotification.SendNotificationNewMessage(MessageUI.Description);
                }
                if ((SendTo.Count == 1 && SendTo[0] == "AppUsers") || SendTo.Count == 0 || SendTo.Count == 2)
                {
                    //  int results = FcmService.SendFcmNotification(MessageUI.Description);
                    // Notification.SendNotificationNewMessageToAllDevices(MessageUI.Description);
                    //var result =  FcmService.SendFcmNotification(MessageUI.Description);
                }
            }

            if (IsNewMode)
            {
                string successMessage = MessagesStrings.GetText(@"MessageMessageCreated");
                string url            = @"EditMessage.aspx?ID=" + MessageId.ToString();
                url += @"&message-success=" + Server.UrlEncode(successMessage);
                Response.Redirect(url, true);
            }
            else
            {
                string successMessage = MessagesStrings.GetText(@"MessageMessageSaved");

                string url = @"EditMessage.aspx?message-success=" + Server.UrlEncode(successMessage);
                url += @"&ID=" + MessageId.ToString();
                Response.Redirect(url, true);
            }
        }
コード例 #16
0
    public static MessageUI AutoShowMessage(string msg, bool hasMask, MessageCallbackEvent e, float showTime)
    {
        //Debug.Log("msg uui");
        if (null == prefab)
        {
            prefab = Resources.Load("MessageCanvas") as GameObject;
        }
        GameObject go    = GameObject.Instantiate(prefab);
        MessageUI  uiCtr = go.GetComponent <MessageUI> ();

        uiCtr.ShowMessage(msg, hasMask, e, showTime);
        return(uiCtr);
    }
コード例 #17
0
    private void Awake()
    {
        if (instance != null)
        {
            Debug.LogWarning("More than one instance of MessageUI found");
            return;
        }
        instance = this;

        QuestEvents.OnGoalComplete  += GoalCompleted;
        QuestEvents.OnEnemyKilled   += EnemyKilled;
        QuestEvents.OnQuestComplete += QuestCompleted;
    }
コード例 #18
0
 public override void Play(int eventID)
 {
     if (m_isPlaying)
     {
         return;
     }
     else
     {
         m_isPlaying = true;
     }
     MessageUI.AutoShowMessage(msg, true, OnShowMessageOver, 2);
     m_quiltGO.SetActive(false);
 }
コード例 #19
0
 public void OnCursorExit()
 {
     //Debug.Log ("exit");
     if (m_isTrigger)
     {
         if (null != m_msgCtr)
         {
             GameObject.Destroy(m_msgCtr.gameObject);
             m_msgCtr = null;
         }
         m_isTrigger = false;
         CursorManager.SetCursor(CursorManager.CursorState.DEFAULT);
     }
 }
コード例 #20
0
ファイル: LevelController.cs プロジェクト: tomlangan/VRTD
    private void ShowCountdownUI()
    {
        CountdownUI = Instantiate <MessageUI>(MessageUITemplate);

        CountdownUI.Title     = "Get ready!";
        CountdownUI.Message   = "";
        CountdownUI.Countdown = "5";

        Vector3 uiPos     = new Vector3(0.0F, 5.0F, -8.0F);
        Vector3 uiForward = (uiPos - TargetManager.transform.position).normalized;

        CountdownUI.transform.gameObject.SetActive(true);
        CountdownUI.transform.gameObject.transform.position = uiPos;
        CountdownUI.transform.gameObject.transform.forward  = uiForward;
    }
コード例 #21
0
 public void OnCursorSelect()
 {
     if (m_isTrigger)
     {
         if (!string.IsNullOrEmpty(m_triggerMsg))
         {
             m_triggerMsgCtr = MessageUI.AutoShowMessage(m_triggerMsg, true, () => {
                 if (null != m_triggerMsgCtr)
                 {
                     GameObject.Destroy(m_triggerMsgCtr.gameObject);
                     m_triggerMsgCtr = null;
                 }
             }, 2);
         }
         Play();
     }
 }
コード例 #22
0
    private void Awake()
    {
        if (instance != null)
        {
            Debug.LogWarning("There should only be one instance of MessageUI in the scene!");
            return;
        }

        instance = this;

        messages     = new Queue <Message>();
        messageLines = GetComponentsInChildren <Text>();

        for (int i = 0; i < messageLines.Length; i++)
        {
            messages.Enqueue(new Message("", Color.white));
        }
    }
コード例 #23
0
 // Use this for initialization
 void Start()
 {
     roundController = FindObjectOfType <RoundController>();
     messageUI       = FindObjectOfType <MessageUI>();
     if (roundController.newOrLoad)
     {
         this.setIsEmpty(false);
     }
     else
     {
         loadInfo();
     }
     this.listenRoll = false;
     this.phase      = 1;
     uiManager       = FindObjectOfType <RollDiceUIManager>();
     item            = new ItemTask(ItemConstant.ITEM_CODE_SPEC_Y0007
                                    , ItemDesConstant.ITEM_CODE_SPEC_Y0007_NAME, ItemDesConstant.ITEM_CODE_SPEC_Y0007_DES);
     this.setThingCode(ThingConstant.SAFE_BOX_01_CODE);
 }
コード例 #24
0
ファイル: Box.cs プロジェクト: dachongqing/Assets0.2
 public override void init(int[] xyz)
 {
     roundController = FindObjectOfType <RoundController>();
     messageUI       = FindObjectOfType <MessageUI>();
     this.setRoom(xyz);
     this.listenRoll = false;
     this.phase      = 1;
     uiManager       = FindObjectOfType <RollDiceUIManager>();
     item            = new ItemTask(ItemConstant.ITEM_CODE_SPEC_00001
                                    , "黑色的书", "带血的内容:你需要用活血的几十来开始剧情");
     this.setThingCode(ThingConstant.BOX_01_CODE);
     if (roundController.newOrLoad)
     {
         setIsEmpty(false);
     }
     else
     {
         this.loadInfo();
     }
 }
コード例 #25
0
 public override void init(int[] xyz)
 {
     roundController = FindObjectOfType <RoundController>();
     messageUI       = FindObjectOfType <MessageUI>();
     this.setRoom(xyz);
     this.listenRoll = false;
     this.phase      = 1;
     uiManager       = FindObjectOfType <RollDiceUIManager>();
     this.setThingCode(ThingConstant.OPERATING_TABLE_01_CODE);
     item = new ItemPotion(ItemConstant.ITEM_CODE_SPEC_Y0003
                           , ItemDesConstant.ITEM_CODE_SPEC_Y0003_NAME, ItemDesConstant.ITEM_CODE_SPEC_Y0003_DES);
     if (roundController.newOrLoad)
     {
         this.setIsEmpty(false);
     }
     else
     {
         this.loadInfo();
     }
 }
コード例 #26
0
    void Awake()
    {
        self = this;

        if (messageUIs == null)
        {
            messageUIs = new MessageUI[Player.PLAYER_COUNT];
        }

        BirdSpawner spawner = this.gameObject.GetComponent <BirdSpawner>();

        messageUIs[spawner.playerIndex] = this;

        Image img = this.gameObject.GetComponent <Image>();

        img.color = Colors.midColors[spawner.playerIndex];

        wasdDir.GetComponent <Image> ().color    = Colors.lightColors[spawner.playerIndex];
        wasdAction.GetComponent <Image> ().color = Colors.lightColors[spawner.playerIndex];
    }
コード例 #27
0
    void OnAnimationFinished(MessageUI MUI)
    {
        //We also need to disable the animator component so that it doesn't activate again when the panel is reactivated

        //Debug.Log("OnAnimationFinished");

        //Here we need to calculate the proper size for the text box, because the text component will actually be active
        MUI.MessageText.ForceMeshUpdate();
        float TextHeight = MUI.MessageText.preferredHeight;
        float TextWidth  = MUI.MessageText.preferredWidth;
        //int linecount = MUI.MessageText.textInfo.lineCount;

        RectTransform rt = MUI.gameObject.transform as RectTransform;

        //Debug.Log("Message height: " + TextHeight + " line count: " + linecount + " rect width: " + rt.rect.width);
        rt.sizeDelta = new Vector2(rt.rect.width, TextHeight + 10);

        CleanCanvases(MUI.MessageChannel);
        LayoutRebuilder.ForceRebuildLayoutImmediate(MUI.MessageChannel.ContentPanel.transform as RectTransform);
    }
コード例 #28
0
ファイル: Barrel.cs プロジェクト: dachongqing/Assets0.2
 public override void init(int[] xyz)
 {
     roundController = FindObjectOfType <RoundController>();
     messageUI       = FindObjectOfType <MessageUI>();
     this.setRoom(xyz);
     this.listenRoll = false;
     this.phase      = 1;
     uiManager       = FindObjectOfType <RollDiceUIManager>();
     item            = new ItemPotion(ItemConstant.ITEM_CODE_POTION_10001
                                      , "速度回复药水", "模糊的字迹写着是哈尔滨六厂生产,蓝屏的钙");
     this.setThingCode(ThingConstant.BARREL_01_CODE);
     if (roundController.newOrLoad)
     {
         setIsEmpty(false);
     }
     else
     {
         this.loadInfo();
     }
 }
コード例 #29
0
 void ResizeAllMessagesInChannel(Channel MessageChannel)
 {
     foreach (Transform child in MessageChannel.ContentPanel.transform)
     {
         MessageUI MUI = child.GetComponent <MessageUI>();
         if (MUI != null)
         {
             if (MUI.MessageText != null)
             {
                 MUI.MessageText.ForceMeshUpdate();
                 float TextHeight = MUI.MessageText.preferredHeight;
                 //int linecount = MUI.MessageText.textInfo.lineCount;
                 //Debug.Log("Message height: " + TextHeight + " line count: " + linecount);
                 RectTransform rt = MUI.gameObject.transform as RectTransform;
                 rt.sizeDelta = new Vector2(rt.rect.width, TextHeight + 10);
             }
         }
     }
     CleanCanvases(MessageChannel);
 }
コード例 #30
0
ファイル: Main.cs プロジェクト: pes7/Telegram-Bots-Library
        private void button3_Click(object sender, EventArgs e)
        {
            List <dynamic> files      = new List <dynamic>();
            List <Thread>  downloadTh = new List <Thread>();

            Thread th = new Thread(async() =>
            {
                foreach (UserM us in Bot.ActiveUsers)
                {
                    await us.DownloadImageToDirectory(Bot);
                    Image mg = Image.FromFile($"./UserPhotoes/{us.Id}.jpg");
                    files.Add(new { id = us.Id, Image = mg });
                }

                foreach (Telegram.Bot.Types.Message ms in Bot.MessagesLast)
                {
                    var afs = await Bot.getFileFrom(ms.Photo.ToList().First().FileId);
                    InvokeUI(() =>
                    {
                        if (ms.Type == Telegram.Bot.Types.Enums.MessageType.Text)
                        {
                            MessageUI mu = new MessageUI(files.Find(fs => ms.From.Id == fs.id).Image, ms.Text)
                            {
                                Width = flowLayoutPanel1.Width - 25
                            };
                            flowLayoutPanel1.Controls.Add(mu);
                        }

                        else if (ms.Type == Telegram.Bot.Types.Enums.MessageType.Photo)
                        {
                            MessageUIPhoto mu = new MessageUIPhoto(Image.FromStream(afs));
                            mu.Width          = flowLayoutPanel1.Width - 25;
                            flowLayoutPanel1.Controls.Add(mu);
                        }
                    });
                }
            });

            th.Start();
        }