コード例 #1
0
        public void FBOnShow(FBToolType type, string des, string spriteName = null, Texture2D tex = null)
        {
            f_type_enum        = type;
            f_cachedes_str     = des;
            f_cachedspname_str = spriteName;
            f_cached_tex2D     = tex;

            f_current_pivot = FBGetPivot();
            Vector3 localPos = FBGetItemLocalPos();

            switch (f_current_pivot)
            {
            case FBPivot.LeftTop:
                f_current_tip = f_tips[0];
                break;

            case FBPivot.RightTop:
                f_current_tip = f_tips[1];
                break;

            case FBPivot.LeftBottom:
                f_current_tip = f_tips[2];
                break;

            case FBPivot.RightBottom:
                f_current_tip = f_tips[3];
                break;
            }

            f_current_tip.FBOnShow(type, localPos, des, spriteName, tex);
            f_isshow_b = true;
        }
コード例 #2
0
        private FBPivot FBGetPivot()
        {
            FBPivot pivot    = FBPivot.Center;
            Vector3 mousePos = Input.mousePosition;

            if (mousePos.x < (Screen.width / 2) && mousePos.y > (Screen.height / 2))
            {
                pivot = FBPivot.LeftTop;
            }
            else if (mousePos.x > (Screen.width / 2) && mousePos.y > (Screen.height / 2))
            {
                pivot = FBPivot.RightTop;
            }
            else if (mousePos.x < (Screen.width / 2) && mousePos.y < (Screen.height / 2))
            {
                pivot = FBPivot.LeftBottom;
            }
            else if (mousePos.x > (Screen.width / 2) && mousePos.y < (Screen.height / 2))
            {
                pivot = FBPivot.RightBottom;
            }
            else
            {
                pivot = FBPivot.LeftTop;
            }

            return(pivot);
        }