Exemplo n.º 1
0
 // Start is called before the first frame update
 void Start()
 {
     conversation = gameObject.GetComponent <ConversationComponent>();
     name         = conversation.Model.Name;
     if (triggerType == TriggerType.aside)
     {
         Messenger.AddListener(EventCode.DIALOGUE_START_ASIDE, Play);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// When the GUI is displayed
        /// </summary>
        public override void OnInspectorGUI()
        {
            EditorGUI.BeginChangeCheck();
            serializedObject.Update();
            ConversationComponent conversationComponent = ( ConversationComponent )target;
            Conversation          model = conversationComponent.Model;

            model.Name = EditorGUILayout.TextField("Name", model.Name);
            if (model.Status == null)
            {
                model.Status = new List <ConversationStatus>();
            }

            if (model.Status.Count > 0)
            {
                string[] statusListNames = model.Status.Select(s => s.Name).ToArray();
                model.ActiveStatusIndex = EditorGUILayout.Popup(
                    "Active Status",
                    model.ActiveStatusIndex,
                    statusListNames,
                    EditorStyles.popup);
                model.ActiveStatus = model.Status[model.ActiveStatusIndex];
                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Status List", EditorStyles.boldLabel);
                ConversationStatusEditor.Display(model.Status, statusListNames);
            }

            if (GUILayout.Button(EditorButtons.AddStatusButton, EditorStyles.miniButton, EditorButtons.NormalButtonWidth))
            {
                ConversationStatus newStatus = new ConversationStatus();
                newStatus.Name = "Status " + (model.Status.Count + 1);
                model.Status.Add(newStatus);
            }

            EditorGUILayout.Space();
            EditorGUILayout.Space();

            if (EditorGUI.EndChangeCheck())
            {
                serializedObject.ApplyModifiedProperties();
                EditorUtility.SetDirty(this.target);
                if (!Application.isPlaying)
                {
                    EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
                }
            }
        }
    // Update is called once per frame
    public void OnPointerClick()
    {
        if (!wasTriggered)
        {
            wasTriggered = true;

            ConversationComponent conversation = conversationComponent;
            if (conversation != null)
            {
                conversation.Trigger( );
            }
        }
        else if (wasTriggered)
        {
            wasTriggered = false;
        }
    }
Exemplo n.º 4
0
 private static void GetConversation(string userName, string message)
 {
     if (!ConversationFLP.Controls.ContainsKey(userName))
     {
         ConversationFLP.Controls.Add(ConversationComponent.CreateBlock(userName, message, DateTime.Now.ToString("HH:mm")));
     }
     else
     {
         foreach (var item in ConversationFLP.Controls)
         {
             if (((Panel)item).Name.Contains(userName))
             {
                 foreach (Control control in ((Panel)item).Controls)
                 {
                     if (control.GetType().Equals(typeof(Label)))
                     {
                         if (control.Name.Contains("text"))
                         {
                             control.Text = message;
                         }
                         if (control.Name.Contains("time"))
                         {
                             control.Text = DateTime.Now.ToString("HH:mm");
                         }
                     }
                     if (control.GetType().Equals(typeof(RoundButton)))
                     {
                         int count = 0;
                         if (control.Text != string.Empty)
                         {
                             count = Convert.ToInt16(control.Text);
                         }
                         count++;
                         if (TalkingTolbl.Text == userName)
                         {
                             control.Visible = false;
                         }
                         control.Text = count.ToString();
                     }
                 }
             }
         }
     }
 }
        private void Update()
        {
            if (Input.GetKeyDown("space"))
            {
                if (!wasTriggered)
                {
                    wasTriggered = true;

                    ConversationComponent conversation = this.GetComponent <ConversationComponent>();
                    if (conversation != null)
                    {
                        conversation.Trigger( );
                    }
                }
            }
            else if (wasTriggered)
            {
                wasTriggered = false;
            }
        }
        // Update is called once per frame
        void Update()
        {
            if (frames == 1000)
            {
                if (!wasTriggered)
                {
                    wasTriggered = true;

                    ConversationComponent conversation = this.GetComponent <ConversationComponent>();
                    if (conversation != null)
                    {
                        conversation.Trigger( );
                    }
                }
                frames = 0;
            }
            else if (wasTriggered)
            {
                wasTriggered = false;
            }
            frames++;
        }
Exemplo n.º 7
0
    // Update is called once per frame
    public void Update()
    {
        tPosition       = Tracked.GetComponent <Transform>();
        tPositionPlayer = Player.GetComponent <Transform>();
        if (tPositionPlayer.position.x < Math.Abs(tPosition.position.x + 3.5) && tPositionPlayer.position.z < Math.Abs(tPosition.position.z + 3.5))
        {
            if (!wasTriggered)
            {
                wasTriggered = true;

                ConversationComponent conversation = this.GetComponent <ConversationComponent>();
                if (conversation != null)
                {
                    conversation.Trigger( );
                }
            }
        }
        else if (wasTriggered)
        {
            wasTriggered = false;
        }
    }
Exemplo n.º 8
0
        private void Update()
        {
            //MAS NACADAS PARA PROBAR
            if (tPosition.position.x < this.transform.position.x &&
                tPosition.position.y > this.transform.position.y)
            {
                if (!wasTriggered)
                {
                    wasTriggered = true;

                    ConversationComponent conversation = this.GetComponent <ConversationComponent>();
                    if (conversation != null)
                    {
                        conversation.Trigger( );
                    }
                }
            }
            else if (wasTriggered)
            {
                wasTriggered = false;
            }
        }