Пример #1
0
        // Update is called once per frame
        private void Update()
        {
            if (_currentRound > -1)
            {
                if (_currentDoorEvent == null && _wait > 3.0f && Random.value > 0.6f &&
                    CatMeter.TotalNewspapers < CatMeter.MaxNewspapers)
                {
                    _currentDoorEvent = Instantiate(_newsPaperDeliveryPrefab);
                    _currentDoorEvent.SetSpawnPoint(_newsPaperDeliverySpawnPoint);
                    _wait = 0.0f;
                }
                else if (_currentPhoneEvent == null && _wait > 3.0f && Random.value > 0.6f)
                {
                    _currentPhoneEvent = Instantiate(_phoneCallEventPrefab);
                    AddMessage(_currentPhoneEvent.Message());
                    _wait = 0.0f;
                }
                else
                {
                    _wait += Time.deltaTime;
                }

                _roundCounter = Mathf.Max(_roundCounter - Time.deltaTime, 0.0f);
                UIManager.Instance().SetTimer(_roundCounter);

                if (_roundCounter <= 0.0f)
                {
                    StartRound();
                }
            }
        }
Пример #2
0
        private void EnableMovement()
        {
            IsMovable = true;
            PhoneCallEvent phoneCallEvent = FindObjectOfType <PhoneCallEvent>();

            Destroy(phoneCallEvent.gameObject);
        }
Пример #3
0
        public void PhoneCallReceived(PhoneCallEvent callDetails)
        {
            int len = (int)callDetails.GetType().GetProperty("MaxCallLength", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(callDetails, null);
            string skills = "";
            foreach (var s in callDetails.SkillsNeeded)
                skills += s + ",";
            Log.LogString(String.Format("Receiving Call: {0}, {1}, {2}", callDetails.PhoneCallID, callDetails.IsTransfered, skills));
            if (!callDetails.IsTransfered)
                Dispatcher.AddPhoneCall(callDetails);

            if (Dispatcher.NeedsProcessing())
                Dispatcher.ProcessQueue();

            OnPhoneCall(this, new PhoneCallEventArguments() { PhoneCallEvent = callDetails });
        }
Пример #4
0
        /// <summary>
        /// Extract the phone call info from call and updates the labels.
        /// </summary>
        /// <param name="call"></param>
        private void BindCall(PhoneCallEvent call)
        {
            if (call != null)
            {
                TimeSpan t;
                //clear the required skills listbox and then populate the fields
                lbRequiredSkills.Items.Clear();
                foreach (SkillType s in call.SkillsNeeded)
                    lbRequiredSkills.Items.Add(s);

                lblCallIDValue.Text = call.PhoneCallID.ToString();
                lblCallAgentIDValue.Text = call.AgentID.ToString();

                lblCallDurationValue.Text = FormatMSToTime(call.PhoneCallLength);

                lblWaitTimeValue.Text = FormatMSToTime(call.WaitTimeLength);
            }
        }
Пример #5
0
 public static void AddPhoneCall(PhoneCallEvent call)
 {
     calls.Add(call);
 }