Exemplo n.º 1
0
        //-----------------------------------------------------------

        /// <summary>
        /// 各派生クラスでの初期化処理を行う(メニューまたは AddView から生成される場合のみ実行れる)
        /// </summary>
        /// <param name="tOption"></param>
        override protected void OnBuild(string tOption = "")
        {
            SetAnchorToLeftStretch();
            Vector2 tSize = GetCanvasSize();

            if (tSize.x > 0 && tSize.y > 0)
            {
                _w = tSize.x * 0.5f;
            }
            SetPivot(0, 0);

            Image tImage = _image;

            tImage.color = new Color32(255, 255, 255, 32);

            isCanvasGroup  = true;
            isEventTrigger = true;

            UIAtlasSprite tAtlas = UIAtlasSprite.Create("uGUIHelper/Textures/UISimpleJoystick");

            UIImage tFrame = AddView <UIImage>("Frame");

            tFrame.SetAnchorToLeftBottom();
            tFrame.sprite = tAtlas["UISimpleJoystick_Frame_Type_0"];
            tFrame.SetSize(frameWidth, frameWidth);
            frame = tFrame;

            float thumbWidth = frameWidth * thumbScale;

            UIImage tThumb = tFrame.AddView <UIImage>("Thumb");

            tThumb.SetAnchorToCenter();
            tThumb.sprite = tAtlas["UISimpleJoystick_Thumb_Type_0"];
            tThumb.SetSize(thumbWidth, thumbWidth);
            thumb = tThumb;

//			DestroyImmediate( tAtlas ) ;
        }