コード例 #1
0
        /// <summary>
        /// Shows the button A prompt.
        /// </summary>
        public virtual void ShowPrompt()
        {
            if (!UseVisualPrompt || _promptHiddenForever || (ButtonPromptPrefab == null))
            {
                return;
            }

            // we add a blinking A prompt to the top of the zone
            if (_buttonPrompt == null)
            {
                _buttonPrompt = (ButtonPrompt)Instantiate(ButtonPromptPrefab);
                _buttonPrompt.Initialization();
                _buttonPromptAnimator = _buttonPrompt.gameObject.MMGetComponentNoAlloc <Animator>();
            }

            if (_buttonActivatedZoneCollider != null)
            {
                _buttonPrompt.transform.position = _buttonActivatedZoneCollider.bounds.center + PromptRelativePosition;
            }
            _buttonPrompt.transform.parent = transform;
            _buttonPrompt.SetText(ButtonPromptText);
            _buttonPrompt.SetBackgroundColor(ButtonPromptColor);
            _buttonPrompt.SetTextColor(ButtonPromptTextColor);
            _buttonPrompt.Show();
        }