Ejemplo n.º 1
0
    private void Awake()
    {
        if (m_UICameraGo == null)
        {
            m_uiCamera        = gameObject.AddChild <Camera>();
            m_UICameraGo      = m_uiCamera.gameObject;
            m_UICameraGo.name = "UICamera";

            int layer = LayerMask.NameToLayer("UGUI");
            m_uiCamera.clearFlags          = CameraClearFlags.Depth;
            m_uiCamera.orthographic        = true;
            m_uiCamera.depth               = 1000;
            m_uiCamera.depthTextureMode    = DepthTextureMode.None;
            m_uiCamera.orthographicSize    = 5f;
            m_uiCamera.cullingMask         = (1 << layer);
            m_uiCamera.useOcclusionCulling = false;
            m_uiCamera.allowHDR            = false;
            m_uiCamera.allowMSAA           = false;
        }
        if (EventSystem == null)
        {
            var es = gameObject.AddChild <StandaloneInputModule>();
            EventSystem      = es.gameObject;
            EventSystem.name = "EventSystem";
        }
        if (m_root2D == null)
        {
            m_root2D = gameObject.AddChild <UIRoot2D>();
            m_root2D.Initialize();
        }
        MessageManager.Instance.AddListener(MESSAGE_TYPE.REFRESH_UI, RefreshUI);
    }
Ejemplo n.º 2
0
 void Start()
 {
     if (prefabUIObject != null)
     {
         uiObject = Instantiate(prefabUIObject) as UIObject;
         uiObject.transform.parent        = UIRoot2D.Get().game.transform;
         uiObject.transform.localPosition = transform.position;
         uiObject.transform.localRotation = transform.rotation;
         uiObject.transform.localScale    = Vector3.one;
         buttonController = uiObject.GetComponent <UIButtonController>();
     }
     Start_();
 }
Ejemplo n.º 3
0
    // Use this for initialization
    IEnumerator Start()
    {
        root2D    = UIRoot2D.Get();
        panelGame = root2D.game;

        // 初期化
        mainPanel.transform.localPosition = Vector3.zero;

        yield return(StartCoroutine(StartSequenceTitle()));

        state = State.Update;

        texLightMulti = panelGame.GetLightMulti();
        texLightAdd   = panelGame.GetLightAdd();
    }
Ejemplo n.º 4
0
 void OnTriggerExit2D(Collider2D hit2D)
 {
     UIRoot2D.Get().indicator.HideInformation();
 }
Ejemplo n.º 5
0
 void OnTriggerEnter2D(Collider2D hit2D)
 {
     UIRoot2D.Get().indicator.DispInformation("テスト\nだよ\nあしだ\nまなだよ");
 }
Ejemplo n.º 6
0
 void OnDestroy()
 {
     UIRoot2D.Get().RemoveButtonController(this);
 }
Ejemplo n.º 7
0
 void Awake()
 {
     UIRoot2D.Get().AddButtonController(this);
 }