Пример #1
0
        private IEnumerator InitUIDeferred()
        {
            yield return(StartCoroutine(VamPrefabFactory.LoadUIAssets()));

            var scriptUI = UITransform.GetComponentInChildren <MVRScriptUI>();

            var scrollRect = scriptUI.fullWidthUIContent.transform.parent.parent.parent.GetComponent <ScrollRect>();

            if (scrollRect == null)
            {
                SuperController.LogError("VamTimeline: Scroll rect not at the expected hierarchy position");
            }
            else
            {
                scrollRect.elasticity   = 0;
                scrollRect.inertia      = false;
                scrollRect.movementType = ScrollRect.MovementType.Clamped;
            }

            ui             = Editor.AddTo(scriptUI.fullWidthUIContent);
            ui.popupParent = UITransform;
            ui.Bind(this);
            if (animation != null)
            {
                ui.Bind(animation);
            }
            ui.screensManager.onScreenChanged.AddListener(screen =>
            {
                if (controllerInjectedUI != null)
                {
                    controllerInjectedUI.screensManager.ChangeScreen(screen);
                }
                peers.SendScreen(screen);
            });
        }
Пример #2
0
        protected override void OnOpen(params object[] Params)
        {
            var Msg = GetComponent <Text>("Value");

            Msg.text  = (string)Params[0];
            Msg.color = (Color)Params[1];
            Callback_ = Params.Length > 2 ? (Action)Params[2] : null;
            var MsgTrans = Msg.GetComponent <RectTransform>();

            LayoutRebuilder.ForceRebuildLayoutImmediate(MsgTrans);
            UIRectTransform.sizeDelta = MsgTrans.sizeDelta + new Vector2(10, 6);

            UITransform.ExecuteMotion(new SequenceMotion(
                                          new FadeInMotion(0.3f),
                                          new ScaleMotion(0.1f, new Vector3(1.2f, 1.2f, 1.0f), false),
                                          new ScaleMotion(0.1f, new Vector3(1.0f, 1.0f, 1.0f), false),
                                          new WaitTimeMotion(0.5f),
                                          new ParallelMotion(new MoveMotion(1.0f, new Vector3(0, 100), true),
                                                             new SequenceMotion(
                                                                 new WaitTimeMotion(0.35f),
                                                                 new CallbackMotion(ToastHelper.ShowAtOnce),
                                                                 new WaitTimeMotion(0.35f),
                                                                 new FadeOutMotion(0.3f))),
                                          new CallbackMotion(() => { UIManager.CloseUI(this); })));
        }
Пример #3
0
 public void InitComponent(GameObject go)
 {
     m_Bridge                    = go.GetComponent(typeof(ComponentBridge)) as ComponentBridge;
     m_button_1_Button           = m_Bridge.GetControl(0) as Button;
     m_uitransform_2_UITransform = m_Bridge.GetControl(1) as UITransform;
     m_uitransform_3_UITransform = m_Bridge.GetControl(2) as UITransform;
 }
Пример #4
0
    public override void InitUI()
    {
        base.InitUI();
        if (UITransform == null)
        {
            return;
        }
        _prefabManager.triggerActionsParent = UITransform;

        var scriptUI = UITransform.GetComponentInChildren <MVRScriptUI>();

        var go = new GameObject();

        go.transform.SetParent(scriptUI.fullWidthUIContent, false);

        var active = go.activeInHierarchy;

        if (active)
        {
            go.SetActive(false);
        }
        _ui = go.AddComponent <CustomCommandsScreen>();
        _ui.prefabManager  = _prefabManager;
        _ui.customCommands = _customCommands;
        _ui.Configure();
        if (active)
        {
            go.SetActive(true);
        }
    }
Пример #5
0
 // if using this to hide UI, affordableamount is not needed.
 public void ShowUI(bool bShouldShow, int AffordableAmount)
 {
     if (bShouldShow)
     {
         UI.InitializeParameters(this.IsFish, this.Amount, AffordableAmount);
     }
     UITransform.SetActive(bShouldShow);
 }
Пример #6
0
        public static UIImage AddImage(this Entity parent, string textureId, UICoordinates position = default(UICoordinates), UICoordinates size = default(UICoordinates))
        {
            Entity  entity  = parent.CreateChild();
            UIImage uiImage = entity.AddComponent <UIImage>();

            uiImage.TextureId = textureId;
            UITransform transform = entity.GetComponent <UITransform>();

            transform.LocalPosition = position;
            //transform.Size = size;

            return(uiImage);
        }
Пример #7
0
    private void Start()
    {
        Transform cardListTransform = cardList.transform;

        cardListTransformEffect = cardListTransform.GetComponent <UITransform>();

        if (!cardListTransformEffect)
        {
            cardListTransformEffect = cardListTransform.gameObject.AddComponent <UITransform>();
        }

        cardListOriginalLocalScale    = cardListTransform.localScale;
        cardListOriginalLocalPosition = cardListTransform.localPosition;
    }
Пример #8
0
 // Use this for initialization
 void Start()
 {
     UITransform.SetActive(false);
     if (IsFish)
     {
         Human.SetActive(false);
         Fish.SetActive(true);
     }
     else
     {
         Fish.SetActive(false);
         Human.SetActive(true);
     }
 }
Пример #9
0
    public override void InitUI()
    {
        base.InitUI();
        if (UITransform == null)
        {
            return;
        }
        var scriptUI = UITransform.GetComponentInChildren <MVRScriptUI>();

        var resultUI = CreateTextField(_resultJSON, true);

        resultUI.height = 1200f;
        resultUI.UItext.horizontalOverflow = HorizontalWrapMode.Overflow;
        resultUI.transform.SetParent(scriptUI.fullWidthUIContent.transform, false);
    }
Пример #10
0
        public override void InitUI()
        {
            base.InitUI();
            if (UITransform == null)
            {
                return;
            }
            var scriptUI = UITransform.GetComponentInChildren <MVRScriptUI>();

            _runUI.transform.SetParent(scriptUI.fullWidthUIContent.transform, false);

            var resultUI = CreateTextField(_resultJSON, true);

            resultUI.height = 800f;
            resultUI.transform.SetParent(scriptUI.fullWidthUIContent.transform, false);
        }
Пример #11
0
    public override void InitUI()
    {
        base.InitUI();
        if (!_valid)
        {
            return;
        }
        if (UITransform == null)
        {
            return;
        }
        _prefabManager.triggerActionsParent = UITransform;

        var scriptUI = UITransform.GetComponentInChildren <MVRScriptUI>();

        var go = new GameObject();

        go.transform.SetParent(scriptUI.fullWidthUIContent, false);

        var active = go.activeInHierarchy;

        if (active)
        {
            go.SetActive(false);
        }
        _ui                       = go.AddComponent <KeybindingsScreen>();
        _ui.settings              = _settings;
        _ui.prefabManager         = _prefabManager;
        _ui.keyMapManager         = _keyMapManager;
        _ui.analogMapManager      = _analogMapManager;
        _ui.remoteCommandsManager = _remoteCommandsManager;
        _ui.storage               = _storage;
        _ui.Configure();
        if (active)
        {
            go.SetActive(true);
        }

        var overlay = KeybindingsOverlay.CreateOverlayGameObject(_prefabManager);

        overlay.autoClear       = Settings.TimeoutLen;
        _overlayReference.value = overlay;
        // overlay.Append("Keybindings ready!");
    }
Пример #12
0
        private static void WriteTransform(AssetStreamWriter writer, UITransform o, List <object> objectDictionary)
        {
            if (WriteElement(writer, o, objectDictionary) == false)
            {
                return;
            }

            Type t = o.GetType();

            if (t == typeof(UITransform2D))
            {
                Write(writer, (UITransform2D)o, objectDictionary);
            }
            else if (t == typeof(UITransform3D))
            {
                Write(writer, (UITransform3D)o, objectDictionary);
            }
            else
            {
                throw new NotSupportedException(t.ToString());
            }
        }
Пример #13
0
 public void InitComponent(GameObject go)
 {
     m_Bridge                 = go.GetComponent(typeof(ComponentBridge)) as ComponentBridge;
     m_bg_Image               = m_Bridge.GetControl(0) as Image;
     m_btnLogin_Button        = m_Bridge.GetControl(1) as Button;
     m_txtUserName_InputField = m_Bridge.GetControl(2) as InputField;
     m_txtPassword_InputField = m_Bridge.GetControl(3) as InputField;
     m_txtPort_InputField     = m_Bridge.GetControl(4) as InputField;
     m_txtIp_InputField       = m_Bridge.GetControl(5) as InputField;
     m_toggleServer_Toggle    = m_Bridge.GetControl(6) as Toggle;
     m_bgsound_UITransform    = m_Bridge.GetControl(7) as UITransform;
     m_btnStart_Button        = m_Bridge.GetControl(8) as Button;
     m_btnTestUI_Button       = m_Bridge.GetControl(9) as Button;
     m_btnTestUI2_Button      = m_Bridge.GetControl(10) as Button;
     m_btnTestUI3_Button      = m_Bridge.GetControl(11) as Button;
     m_Text_Text              = m_Bridge.GetControl(12) as Text;
     m_Label_Text             = m_Bridge.GetControl(13) as Text;
     m_Background_Image       = m_Bridge.GetControl(14) as Image;
     m_bg_new_Image           = m_Bridge.GetControl(15) as Image;
     m_bg_new_new_Image       = m_Bridge.GetControl(16) as Image;
     m_txt_Text               = m_Bridge.GetControl(17) as Text;
     m_txt_new_Text           = m_Bridge.GetControl(18) as Text;
 }
Пример #14
0
 public void ShowUI(bool bShouldShow)
 {
     UITransform.SetActive(bShouldShow);
 }
        private IEnumerator InitUIDeferred()
        {
            if ((UnityEngine.Object)ui != (UnityEngine.Object)null ||
                _initializingUI)
            {
                yield break;
            }
            _initializingUI = true;
            yield return(SuperController.singleton.StartCoroutine(VamPrefabFactory.LoadUIAssets()));

            var scriptUI = UITransform.GetComponentInChildren <MVRScriptUI>();

            var scrollRect =
                scriptUI.fullWidthUIContent.transform.parent.parent.parent.GetComponent <ScrollRect>();

            if ((UnityEngine.Object)scrollRect == (UnityEngine.Object)null)
            {
                SuperController.LogError(
                    "AudioMate: Error during UI initialization. Scroll rect not at the expected hierarchy position");
            }
            else
            {
                scrollRect.elasticity   = 0;
                scrollRect.inertia      = false;
                scrollRect.movementType = ScrollRect.MovementType.Clamped;
            }

            ui = UIManager.AddTo(scriptUI.fullWidthUIContent);
            if ((UnityEngine.Object)ui == (UnityEngine.Object)null)
            {
                SuperController.LogError(
                    "AudioMate: Error during UI initialization. UI is null.");
            }
            ui.Init(this);
            ui.ReceiverAtomJSON = _receivingAtomJSON;
            ui.ReceiverNodeJSON = _receivingNodeJSON;
            ui.InitUI();
            //if ((UnityEngine.Object) collections == (UnityEngine.Object) null || !collections.isInitialized) yield return new WaitForEndOfFrame();
            var count = 0;

            while ((UnityEngine.Object)collections == (UnityEngine.Object)null || !collections.isInitialized)
            {
                if (++count > 200)
                {
                    SuperController.LogError(!collections.isInitialized
                        ? "AudioMate: Could not initialize collection manager."
                        : "AudioMate: Collection manager is null.");

                    yield break;
                }
                yield return(new WaitForSeconds(.1f));

                if ((UnityEngine.Object) this == (UnityEngine.Object)null)
                {
                    yield break;
                }
            }
            try
            {
                ui.Bind(collections);
            }
            catch (Exception e)
            {
                SuperController.LogError($"AudioMate: {e}");
            }
        }
Пример #16
0
 private static void Write(AssetStreamWriter writer, UITransform o, List <object> objectDictionary)
 {
     Write(writer, (UIElement)o, objectDictionary);
 }
Пример #17
0
 public T GetComponent <T>() where T : Component
 {
     return(UITransform.GetComponent <T>());
 }
Пример #18
0
 // Use this for initialization
 void Start()
 {
     UITransform.SetActive(false);
 }