블로그 이미지
Every unexpected event is a path to learning for you. blueasa

카테고리

분류 전체보기 (2847)
Unity3D (893)
Programming (479)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (188)
협업 (64)
3DS Max (3)
Game (12)
Utility (141)
Etc (99)
Link (33)
Portfolio (19)
Subject (90)
iOS,OSX (52)
Android (16)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (19)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday


[링크] http://docs.apteligent.kr/crittercism_man/quickstart.html

반응형
Posted by blueasa
, |


TelephonyManager tel = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);

     String networkOperator = tel.getNetworkOperator();
     int mcc = 0, mnc = 0;
     if (networkOperator != null) {
         mcc = Integer.parseInt(networkOperator.substring(03));
         mnc = Integer.parseInt(networkOperator.substring(3));
     }

wifi 모델은 제대로 값을 읽지 못한다는 이야기가...;;;

Locale.getDefault().getCountry(); <- KR 을 리턴함.(세팅된 언어셋을 리턴하는 것이다...;;)
이걸 받아서 아래 링크쪽에 정의된 mcc랑 매핑을 시켜서 사용해야 할 것 같음

https://android.googlesource.com/platform/frameworks/opt/telephony/+/f39de086fddea9e9f6b8c56b04d8dd38a84237db/src/java/com/android/internal/telephony/MccTable.java

IP를 통해서 국가를 얻어올 수 있는 방법이 있다.



http://api.hostip.info/get_json.php <- 현재 접속한 ip address의 국가 정보를 리턴한다.
ex) 
{"country_name":"KOREA, REPUBLIC OF","country_code":"KR","city":"Seoul","ip":"210.182.216.2"}

자세한 내용은 아래 링크를 확인
http://codereview.stackexchange.com/questions/23102/getting-country-based-on-ip

국가 이름과 mcc를 매핑한 리스트는 아래와 같다.
<item>202,gr</item>
<item>204,nl</item>
<item>206,be</item>
<item>208,fr</item>
<item>212,mc</item>
<item>213,ad</item>
<item>214,es</item>
<item>216,hu</item>
<item>218,ba</item>
<item>219,hr</item>
<item>220,rs</item>
<item>222,it</item>
<item>225,va</item>
<item>226,ro</item>
<item>228,ch</item>
<item>230,cz</item>
<item>231,sk</item>
<item>232,at</item>
<item>234,gb</item>
<item>235,gb</item>
<item>238,dk</item>
<item>240,se</item>
<item>242,no</item>
<item>244,fi</item>
<item>246,lt</item>
<item>247,lv</item>
<item>248,ee</item>
<item>250,ru</item>
<item>255,ua</item>
<item>257,by</item>
<item>259,md</item>
<item>260,pl</item>
<item>262,de</item>
<item>266,gi</item>
<item>268,pt</item>
<item>270,lu</item>
<item>272,ie</item>
<item>274,is</item>
<item>276,al</item>
<item>278,mt</item>
<item>280,cy</item>
<item>282,ge</item>
<item>283,am</item>
<item>284,bg</item>
<item>286,tr</item>
<item>288,fo</item>
<item>289,ge</item>
<item>290,gl</item>
<item>292,sm</item>
<item>293,si</item>
<item>294,mk</item>
<item>295,li</item>
<item>297,me</item>
<item>302,ca</item>
<item>308,pm</item>
<item>310,us</item>
<item>311,us</item>
<item>312,us</item>
<item>313,us</item>
<item>314,us</item>
<item>315,us</item>
<item>316,us</item>
<item>330,pr</item>
<item>332,vi</item>
<item>334,mx</item>
<item>338,jm</item>
<item>340,gp</item>
<item>342,bb</item>
<item>344,ag</item>
<item>346,ky</item>
<item>348,vg</item>
<item>350,bm</item>
<item>352,gd</item>
<item>354,ms</item>
<item>356,kn</item>
<item>358,lc</item>
<item>360,vc</item>
<item>362,ai</item>
<item>363,aw</item>
<item>364,bs</item>
<item>365,ai</item>
<item>366,dm</item>
<item>368,cu</item>
<item>370,do</item>
<item>372,ht</item>
<item>374,tt</item>
<item>376,tc</item>
<item>400,az</item>
<item>401,kz</item>
<item>402,bt</item>
<item>404,in</item>
<item>405,in</item>
<item>410,pk</item>
<item>412,af</item>
<item>413,lk</item>
<item>414,mm</item>
<item>415,lb</item>
<item>416,jo</item>
<item>417,sy</item>
<item>418,iq</item>
<item>419,kw</item>
<item>420,sa</item>
<item>421,ye</item>
<item>422,om</item>
<item>423,ps</item>
<item>424,ae</item>
<item>425,il</item>
<item>426,bh</item>
<item>427,qa</item>
<item>428,mn</item>
<item>429,np</item>
<item>430,ae</item>
<item>431,ae</item>
<item>432,ir</item>
<item>434,uz</item>
<item>436,tj</item>
<item>437,kg</item>
<item>438,tm</item>
<item>440,jp</item>
<item>441,jp</item>
<item>450,kr</item>
<item>452,vn</item>
<item>454,hk</item>
<item>455,mo</item>
<item>456,kh</item>
<item>457,la</item>
<item>460,cn</item>
<item>461,cn</item>
<item>466,tw</item>
<item>467,kp</item>
<item>470,bd</item>
<item>472,mv</item>
<item>502,my</item>
<item>505,au</item>
<item>510,id</item>
<item>514,tl</item>
<item>515,ph</item>
<item>520,th</item>
<item>525,sg</item>
<item>528,bn</item>
<item>530,nz</item>
<item>534,mp</item>
<item>535,gu</item>
<item>536,nr</item>
<item>537,pg</item>
<item>539,to</item>
<item>540,sb</item>
<item>541,vu</item>
<item>542,fj</item>
<item>543,wf</item>
<item>544,as</item>
<item>545,ki</item>
<item>546,nc</item>
<item>547,pf</item>
<item>548,ck</item>
<item>549,ws</item>
<item>550,fm</item>
<item>551,mh</item>
<item>552,pw</item>
<item>602,eg</item>
<item>603,dz</item>
<item>604,ma</item>
<item>605,tn</item>
<item>606,ly</item>
<item>607,gm</item>
<item>608,sn</item>
<item>609,mr</item>
<item>610,ml</item>
<item>611,gn</item>
<item>612,ci</item>
<item>613,bf</item>
<item>614,ne</item>
<item>615,tg</item>
<item>616,bj</item>
<item>617,mu</item>
<item>618,lr</item>
<item>619,sl</item>
<item>620,gh</item>
<item>621,ng</item>
<item>622,td</item>
<item>623,cf</item>
<item>624,cm</item>
<item>625,cv</item>
<item>626,st</item>
<item>627,gq</item>
<item>628,ga</item>
<item>629,cg</item>
<item>630,cg</item>
<item>631,ao</item>
<item>632,gw</item>
<item>633,sc</item>
<item>634,sd</item>
<item>635,rw</item>
<item>636,et</item>
<item>637,so</item>
<item>638,dj</item>
<item>639,ke</item>
<item>640,tz</item>
<item>641,ug</item>
<item>642,bi</item>
<item>643,mz</item>
<item>645,zm</item>
<item>646,mg</item>
<item>647,re</item>
<item>648,zw</item>
<item>649,na</item>
<item>650,mw</item>
<item>651,ls</item>
<item>652,bw</item>
<item>653,sz</item>
<item>654,km</item>
<item>655,za</item>
<item>657,er</item>
<item>702,bz</item>
<item>704,gt</item>
<item>706,sv</item>
<item>708,hn</item>
<item>710,ni</item>
<item>712,cr</item>
<item>714,pa</item>
<item>716,pe</item>
<item>722,ar</item>
<item>724,br</item>
<item>730,cl</item>
<item>732,co</item>
<item>734,ve</item>
<item>736,bo</item>
<item>738,gy</item>
<item>740,ec</item>
<item>742,gf</item>
<item>744,py</item>
<item>746,sr</item>
<item>748,uy</item>
<item>750,fk</item>



[출처] http://nicelee.egloos.com/m/3025913

반응형
Posted by blueasa
, |

[펌] MCC/MNC

Unity3D/Tips / 2016. 11. 30. 15:47

MCC(Mobile Country Code)와 MNC(Mobile Network Code) 쌍은 통신사를 구분하기 위한 국가-통신사 코드 조합으로 우리나라에서 많이 쓰이는 CDMA, LTE 이외에 GSM, UMTS, TETRA 등에서도 사용된다. ITU-T에서 E.212를 통해 MCC/MNC를 제안했으며, 요즘은 보통 USIM에서 위 값의 조합을 가져올 수 있다.

안드로이드의 경우, SYSTEM PROPERTIES 중 하나인 gsm.operator.numeric에서 MCC+MNC 조합인 PLMN ID를 가져올 수 있다.

만약 3자리 이상이라면, 앞의 3자리가 MCC 그 나머지를 MNC로 보면 된다.  위의 23410의 경우, 영국(234)의 O2 통신사(10)이다.

MCC를 얻는 함수 예제는 아래와 같다.

그럼 MCC/MNC는 어디에 쓸까? 보통의 서비스들은 다국어 번역만 지원하고 사용자가 셋팅에서 언어를 바꿀 수 있게 하면 된다.

하지만, 구글 플레이 스토어나 애플의 앱스토어처럼 국가마다 다른 앱이나, 캠페인을 진행하고 싶은 경우 MCC를 참조할 수 있다. 그리고 간혹 통신사만의 캠페인을 진행하는 경우 MNC를 참조할 수 있다.

그런데 왜 번거롭게 USIM의 MCC/MNC를 이용해서 서비스를 다르게 보여주려고 할까? 사용자가 접속하고자 하는 국가를 고르면 되는 것 아닌가?

마켓의 경우는 앱을 다운로드 받기 때문에 단말이 네트워크에 연결되어 있어야 한다. Wi-Fi가 아니라면 통신사 망을 통해 데이터를 전송하기 때문에  USIM의 값이 중요하다. 그리고,  USIM을 구입할 나라라면 사용자가 더 거주할 확률이 높다고 판단하기 때문으로 보인다. 마지막으로, 신용카드 결제가 아닌 핸드폰 요금에 청구되는 소액결제의 경우(P-SMS와 캐리어 빌링이 대표적이다) USIM의 통신사에 따라 결제 여부가 달라지기 때문에 마켓에서는 USIM의 데이터를 더 신뢰한다.

클래시 오브 클랜처럼 게임을 만든다면 다국어 번역만 지원하고 사용자의 현재 언어를 파악하여 언어를 보여주거나 사용자가 셋팅에서 스스로 바꿀 수 있는 방법만 제공하면 되겠다. 애플이나 구글의 인앱결제들이 어떻게든 결제를 할 수 있게 고민할테니 말이다.

그 밖에

MCC/MNC는 USIM에 저장되어 있기 때문에, USIM을 따라다닌다. 단말을 구분하고 싶다면 IMEI 값을 참고하자. 2012년 5월부터는 완전히 공개된 정보가 되어 단말의 뒷면(배터리 탈착 부분)에서 확인할 수 있다.

참조


[출처] http://sunphiz.me/wp/archives/1047

반응형
Posted by blueasa
, |

Assets/UCSS/Scripts/Protocols/HTTPProtocol.cs(20,63): error CS0234: The type or namespace name `MovieTexture' does not exist in the namespace `UnityEngine'. Are you missing an assembly reference?


유니티에 WWW wrapper 에셋(http://u3d.as/8e6)을 추가하고 안드로이드로 빌드하려고 시도하니 위와 같은 에러가 나서 뭐지 했는데


찾아보니 아래와 같은 글이 있다.

MovieTexture는 모바일에서 더이상 지원을 하지 않는다고 한다.(PC빌드 전용인가?)


as of 2015/10/6, MovieTextures are still not supported on Android and iOs


First, any code using "MovieTexture" MUST be set only for PC builds. The game I am working on is for Android and PC, so I use the following preprocessor commands:

  1. #if UNITY_ANDROID
  2. Handheld.PlayFullScreenMovie("");
  3. #else
  4. MovieTexture stuff;
  5. #endif


그래서 해당 에셋의 MovieTexture 부분에 iOS/AOS에서 안돌아가게 아래와 같이 define을 추가했다.


#if UNITY_PRO_LICENSE && !UNITY_WEBGL && !UNITY_IOS && !UNITY_ANDROID

        public EventHandlerMovieTexture     movieTextureCallback;

#endif


#if UNITY_PRO_LICENSE && !UNITY_IOS && !UNITY_ANDROID

    void GetMovie()

    {

// 중략..

    }

#endif




[참조] https://forum.unity3d.com/threads/movietexture-has-no-definition-for-iphone-android.73338/

[참조] http://answers.unity3d.com/questions/377854/why-cannot-build-movie-texture-on-android.html


반응형
Posted by blueasa
, |


[링크] http://ucss.webjema.com/http/index.html

반응형
Posted by blueasa
, |


[유니티5.x 기준 경로] 드라이브:\Users\{계정명}\AppData\Roaming\Unity\Asset Store-5.x




[참조] http://neojsm.tistory.com/8

반응형

'Unity3D > Tips' 카테고리의 다른 글

[펌] 안드로이드 mcc mnc 읽어오기  (0) 2016.11.30
[펌] MCC/MNC  (0) 2016.11.30
[펌] Borderless window in standalone player  (0) 2016.11.08
[펌] Disable Screen Auto Rotation on Unity3D  (0) 2016.11.03
[링크] Unity Technologies  (0) 2016.11.01
Posted by blueasa
, |

StreamingAssets 폴더는 Platform마다 다르다.

게다가 더 기가막힌게, Application.streamingAssetsPath를 그대로 믿고 사용할 수 없다는 것이다.

게다가 Unity 문서는 지나간 내용을 설명하고 있으며, 잘못된 내용을 설명하고 있다.

http://docs.unity3d.com/kr/current/Manual/StreamingAssets.html

이런~~~~


정답은 아래와 같다.

#if UNITY_EDITOR || UNITY_STANDALONE_WIN

public static readonly string StreamingPath = "file://" + Application.streamingAssetsPath + "/";

#elif UNITY_ANDROID

public static readonly string StreamingPath = Application.streamingAssetsPath + "/";

#elif UNITY_IOS

public static readonly string StreamingPath = "file://" + Application.streamingAssetsPath + "/";

#endif




[출처] http://baramlife.tistory.com/7

반응형
Posted by blueasa
, |

파티클 이펙트를 런타임 중에 방향을 반전 시키는 간단한 스크립트.


생성 될 때 방향을 반전시키기 위해서 ParticleSystem.startSpeed 를 반전 시키고,

이미 생성 된 파티클은 ParticleSystem.Particle.velocity 를 반전 시켜 줌.



using UnityEngine;
using System.Collections;

public class InvertParticleEffect : MonoBehaviour
{
    ParticleSystem m_System;
    ParticleSystem.Particle[] m_Particles;


    void InitializeIfNeeded()
    {
        if (m_System == null)
            m_System = GetComponent();

        if (m_Particles == null || m_Particles.Length < m_System.maxParticles)
            m_Particles = new ParticleSystem.Particle[m_System.maxParticles];
    }

    public void Invert()
    {
        InitializeIfNeeded();

        // 생성될 때, 파티클 Speed 방향 반전
        var vel = m_System.startSpeed *= -1f;

        // GetParticles is allocation free because we reuse the m_Particles buffer between updates
        int numParticlesAlive = m_System.GetParticles(m_Particles);

        // Change only the particles that are alive
        for (int i = 0; i < numParticlesAlive; i++)
        {
            // 이미 생성된 파티클은 velocity 반전해서 반대로 가도록..
            m_Particles[i].velocity *= -1f;
        }

        // Apply the particle changes to the particle system
        m_System.SetParticles(m_Particles, numParticlesAlive);
    }

}

[참조] https://docs.unity3d.com/ScriptReference/ParticleSystem.GetParticles.html


반응형
Posted by blueasa
, |
Best Answer

Answer by clunk47 

Of course it's easy. I do it by creating a shortcut or batch file that starts the exe, instead of running the exe file. For example, a batch file. This is just an example, so say our EXE name is RUN.EXE. You would open Notepad, type the following:

start RUN.EXE -popupwindow

Then File> Save as> and in the filename where it says .txt originally, just remove that and use an asterick and a bat extension (*.bat) Hit ENTER, then it will know you want to save as a bat file. Now just type in a name like Launcher.bat, don't forget to remove the asterick but keep the .bat extension. Now you would run this Launcher file. The argument -popupwindow is what allows your Unity Standalone EXE to run without borders :D




[출처] http://answers.unity3d.com/questions/13009/borderless-window-in-standalone-player.html

반응형
Posted by blueasa
, |

Welcome to the "Borderless Resizable Movable Standalone Window" Unity Asset.

Summary:
"Borderless Resizable Movable Standalone Window" is an Unity Plugin that gives you the ability to control the actual window position,size and borders of your standalone build via Scripting.
In other words it lets you remove the borders of your game's window and gives you the API to minimize,close,maximize,resize ect. through your scripts.
There are tons of creative ways to use it and implement it to your games/programs an example would be this template.
The package comes with 2 Example Scenes , 1 Launch Scene and 4 scripts (C# and Js) to help you start and understand its use.
Can be combined with Unity's current API to achieve great effects !
NOTE : It has been tested on Windows Unity Pro and Indie, other platforms are unknown!
So if you purchase for another platform do it at your own risk !!

What you actually get:
~A "QuickAutoBorderless" boolean that forces Borderless mode on the build on initialization without restarting it
~A "FullyAutoBorderless" boolean that forces Borderless mode on the build on initialization after restarting it
~A "AllowSizeResettingBeforeExit" boolean that makes the window start as a small 116x90 window instead of full size
~New Scripting API.
-Window.Minimize ();
-Window.Fullscreen ();
-Window.Fullscreen (Vector2);
-Window.Fullscreen (int,int);
-Window.Maximize ();
-Window.Maximize (boolean);
-Window.Exit ();
-Window.ForceExit ();
-Window.IsDoneLoading();
-Window.IsBorderless ();
-Window.Border ();
-Window.Border (boolean);
-Window.SetMinWidth (int);
-Window.SetMaxWidth (int);
-Window.SetMinHeight (int);
-Window.SetMaxHeight (int);
-Window.SetRect (Rect);
-Window.SetRect (int,int,int,int);
-Window.SetPosition (int,int);
-Window.SetPosition (Vector2);
-Window.SetSize (int,int);
-Window.SetSize (Vector2);
-Window.GetMinWidth ();
-Window.GetMaxWidth ();
-Window.GetMinHeight ();
-Window.GetMaxHeight ();
-Window.GetBorderRect ();
-Window.GetBorderPosition ();
-Window.GetBorderSize ();
-Window.GetRect ();
-Window.GetPosition ();
-Window.GetSize ();
-Window.GrabStart ();
-Window.GrabEnd ();
-Window.QuickDisableBorders();
-Window.ResizeLeftStart ();
-Window.ResizeLeftEnd ();
-Window.ResizeDownLeftStart ();
-Window.ResizeDownLeftEnd ();
-Window.ResizeDownStart ();
-Window.ResizeDownEnd ();
-Window.ResizeDownRightStart ();
-Window.ResizeDownRightEnd ();
-Window.ResizeRightStart ();
-Window.ResizeRightEnd ();
-Window.ResizeRightTopStart ();
-Window.ResizeRightTopEnd ();
-Window.ResizeTopStart ();
-Window.ResizeTopEnd ();
-Window.ResizeTopLeftStart ();
-Window.ResizeTopLeftEnd ();

Unity useful API:
-Screen.Width : int;
-Screen.Height : int;
-Screen.currentResolution : Vector2;
and many more...

Example Uses:
Create game launchers like the ones of top branded games (example: League of Legends or Steam !!) with no or custom borders.
Create games with awesome borders that make the difference in the user's desktop !!
Simulate Window movement or teleport the window dynamically without having the user do anything !!
Create popup/warning windows that can't be closed by the user and display information or other useful stuff.
Create invisible windows by having their width or height be 0 or even below 0.
Move your windows outside the screen or in places that the cursor usually cant go.
TOP: Have fullscreen windowed mode at full resolution without waiting for Unity's standard fullscreen buffering !!!
and many more, just use your imagination and creativity...

How to install the plugin:
The first thing you may want to do is use it , but you will have to make a few steps before beeing able to do so.
1.Open Unity and go to Edit -> Project Settings -> Player -> Other Settings -> Api Compatibility Level and set it to ".NET 2.0"
2.Drag the "Window" C# script located inside of Plugins folder and drop it on any form of gameobject inside your scene.
(2.1 Warning: Do not deactivate the script. Drop it once , having multiple "Window" scripts inside one scene is not supported.)
3.Do not change the location of the System.Windows.Forms file located inside the Plugins folder.
4.If you don't already know, if you change the location of "Window" C# script you wont be able to call any of the API above from any UnityScript !
5.For more accurate installation guide read the Installation_Guide.txt

How to correctly use it:
Note : This plugin is not meant to be used in the editor , most functions are protected (cant be used in the editor) to protect you from causing damage or annoying behavior. Also some of the read or "get" values will return wrong information in the editor.
---------------------------------------------------------------
"FullyAutoBorderless"
Once you have dropped the script into a gameobject then you will see a tickbox variable that says "Fully Auto Borderless"
If you have this variable enabled and you build your standalone , it will always force the borderless mode even if you try later to set it to bordered by code it will turn back to borderless !
This is good if you want the standalone to be borderless from the beginning to the end the only drawback is that it requires the client to restart once every time you decide to remove or add borders.
We can counter this behaviour by having a launcher scene (that is already included as an example).
---------------------------------------------------------------
"QuickAutoBorderless"
Once you have dropped the script into a gameobject then you will see a tickbox variable that says "Quick Auto Borderless"
This is a lightweight borderless mode that will not require a restart to activate with the drawnback that it can't be resized without making the borderss return while resizing..
If your project requires little to no window resizing or you are ok with your client to make this behaviour then this option is for you.
---------------------------------------------------------------
"AllowSizeResettingBeforeExit"
Once you have dropped the script into a gameobject then you will see a tickbox variable that says "Allow Size Resetting Before Exit"
This variable is create to make the window launch with a small size (116 x 90) and reduce problems while increasing performance.
It also recommended to edit player setting and set this resolution to the window.
(Read installation guide for more info)
---------------------------------------------------------------
-Window.Minimize ();
Minimizes the window as if you had clicked the minimize button.
---------------------------------------------------------------
-Window.Fullscreen ();
Sets the window into fullscreen mode , by preserving the current resolution.
(Works just like standard Unity fullscreen function)
---------------------------------------------------------------
-Window.Fullscreen (Vector2);
Same as above but allows you to set the quality as a Vector2
---------------------------------------------------------------
-Window.Fullscreen (int,int);
Same as above but allows you to set the quality as two integers instead of one Vector2
---------------------------------------------------------------
-Window.Maximize ();
Will Maximize the window at full speed and have the same results as if you had clicked the maximize button,
if you are running on borderless mode it will look like fullscreen mode but a lot faster :)
---------------------------------------------------------------
-Window.Maximize (boolean);
Same as above but if the boolean is set to false it will take into consideration the min/max width/height you have set and will result into a max size mode ;)
---------------------------------------------------------------
-Window.Exit ();
Similar to Unity's default quit function.
---------------------------------------------------------------
-Window.ForceExit ();
Will force window exit with a high priority and will cause the window to close very fast even if its not responding !! :)
---------------------------------------------------------------
-Window.IsDoneLoading();
Returns true if all calculatings of the window plugin are done at least once. Good for getting accurate info in the Start or Awake function.
---------------------------------------------------------------
-Window.IsBorderless ();
Returns true if the standalone is borderless and false if the window is bordered.
---------------------------------------------------------------
-Window.Border ();
Will make the window borderless if it has borders or will make the window bordered if its borderless.
(Warning , it will force the window to restart and thus lose all processes so be careful to save before calling that)
---------------------------------------------------------------
-Window.Border (boolean);
Will set borderless mode if set to false,
will set to bordered mode if set to true.
(Same warning as above)
---------------------------------------------------------------
-Window.SetMinWidth (int);
Will set the minimum width allowed to the window
(Some functions have the ability to ignore this)
---------------------------------------------------------------
-Window.SetMaxWidth (int);
Will set the maximum width allowed to the window
(Some functions have the ability to ignore this)
---------------------------------------------------------------
-Window.SetMinHeight (int);
Will set the minimum height allowed to the window
(Some functions have the ability to ignore this)
---------------------------------------------------------------
-Window.SetMaxHeight (int);
Will set the maximum height allowed to the window
(Some functions have the ability to ignore this)
---------------------------------------------------------------
-Window.GetMinWidth (int);
Returns the minimum width you have set through Window.SetMinWidth as an int
---------------------------------------------------------------
-Window.GetMaxWidth (int);
Returns the maximum width you have set through Window.SetMaxWidth as an int
---------------------------------------------------------------
-Window.GetMinHeight (int);
Returns the minimum height you have set through Window.SetMinHeight as an int
---------------------------------------------------------------
-Window.GetMaxHeight (int);
Returns the maximum height you have set through Window.SetMaxHeight as an int
---------------------------------------------------------------
-Window.SetRect (Rect);
Sets the window's position and size at the same time to the given Rect
---------------------------------------------------------------
-Window.SetRect (int,int,int,int);
Same as above but instead of a rect it gets 4 separate ints
---------------------------------------------------------------
-Window.SetPosition (int,int);
Sets the position of the window only to the given int values and preserves the width and height
(Height and Width will not work right in bordered mode)
---------------------------------------------------------------
-Window.SetPosition (Vector2);
Same as above but instead of two ints it takes one Vector2
---------------------------------------------------------------
-Window.SetSize (int,int);
Sets the window's Size to the given int values and preserves the location
---------------------------------------------------------------
-Window.SetSize (Vector2);
Same as above but instead of two ints it takes one Vector2
---------------------------------------------------------------
-Window.GetBorderRect ();
Returns the Border Position and Overall Size as a Rect
---------------------------------------------------------------
-Window.GetBorderPosition ();
Returns the Border Position as a Vector2
---------------------------------------------------------------
-Window.GetBorderSize ();
Returns the Border Width and Height as a Vector2
(Might not work right)
---------------------------------------------------------------
-Window.GetRect ();
Returns the Window Position and Overall Size as a Rect
---------------------------------------------------------------
-Window.GetPosition ();
Returns the Window Position as a Vector2
---------------------------------------------------------------
-Window.GetSize ();
Returns the Window Size as a Vector2
---------------------------------------------------------------
-Window.GrabStart ();
Once called the Window will be "grabbed" by the cursor and will keep following it while preserving its offset until Window.GrabEnd is called
(Always make sure you are able to call GrabEnd because once GrabStart is activated , you wont be able to click anywhere)
(Grab and other Resize functions cant be active at the same time)
---------------------------------------------------------------
-Window.GrabEnd ();
Will give an end to the active GrabStart function
---------------------------------------------------------------
-Window.QuickDisableBorders();
This function will disable the borders of the window using the latest "Quick" method.
You will probably not need to call it but so far it is only used in Unity5 after entering and exiting fullscreen mode to re-deactivate the borders if using QuickBorderless option.
---------------------------------------------------------------
-Window.ResizeLeftStart ();
Once called it will start changing the size of the window only from the left side according to the mouse position while preserving its offset.
(Its important to call the Window.ResizeLeftEnd function or else you wont be able to call any other grab or resize functions or click anywhere)
---------------------------------------------------------------
-Window.ResizeLeftEnd ();
Will stop resizing the window if the above function was called.
---------------------------------------------------------------
-Window.ResizeDownLeftStart ();
Once called it will start changing the size of the window only from the left and down side according to the mouse position while preserving its offset.
(Its important to call the Window.ResizeDownLeftEnd function or else you wont be able to call any other grab or resize functions or click anywhere)
---------------------------------------------------------------
-Window.ResizeDownLeftEnd ();
Will stop resizing the window if the above function was called.
---------------------------------------------------------------
-Window.ResizeDownStart ();
Once called it will start changing the size of the window only from the down side according to the mouse position while preserving its offset.
(Its important to call the Window.ResizeDownEnd function or else you wont be able to call any other grab or resize functions or click anywhere)
---------------------------------------------------------------
-Window.ResizeDownEnd ();
Will stop resizing the window if the above function was called.
---------------------------------------------------------------
-Window.ResizeDownRightStart ();
Once called it will start changing the size of the window only from the down and right side according to the mouse position while preserving its offset.
(Its important to call the Window.ResizeDownRightEnd function or else you wont be able to call any other grab or resize functions or click anywhere)
---------------------------------------------------------------
-Window.ResizeDownRightEnd ();
Will stop resizing the window if the above function was called.
---------------------------------------------------------------
-Window.ResizeRightStart ();
Once called it will start changing the size of the window only from the right side according to the mouse position while preserving its offset.
(Its important to call the Window.ResizeRightEnd function or else you wont be able to call any other grab or resize functions or click anywhere)
---------------------------------------------------------------
-Window.ResizeRightEnd ();
Will stop resizing the window if the above function was called.
---------------------------------------------------------------
-Window.ResizeRightTopStart ();
Once called it will start changing the size of the window only from the right and top side according to the mouse position while preserving its offset.
(Its important to call the Window.ResizeRightTopEnd function or else you wont be able to call any other grab or resize functions or click anywhere)
---------------------------------------------------------------
-Window.ResizeRightTopEnd ();
Will stop resizing the window if the above function was called.
---------------------------------------------------------------
-Window.ResizeTopStart ();
Once called it will start changing the size of the window only from the top side according to the mouse position while preserving its offset.
(Its important to call the Window.ResizeTopEnd function or else you wont be able to call any other grab or resize functions or click anywhere)
---------------------------------------------------------------
-Window.ResizeTopEnd ();
Will stop resizing the window if the above function was called.
---------------------------------------------------------------
-Window.ResizeTopLeftStart ();
Once called it will start changing the size of the window only from the top and left side according to the mouse position while preserving its offset.
(Its important to call the Window.ResizeTopLeftEnd function or else you wont be able to call any other grab or resize functions or click anywhere)
---------------------------------------------------------------
-Window.ResizeTopLeftEnd ();
Will stop resizing the window if the above function was called.
--------------------------------------------------------------
--------------------------------------------------------------
UNITY 5+ NOTES :
If using Unity 5.x the QuickBorderless Option will work way better , the only drawnback noticed is that after entering and exiting fullscreen mode, you will most likely need to call "QuickDisableBorders(); function after exiting fullscreen mode.
Therefore the Launcher Scene is not needed..

Conctact Info :
Email : DarknessBlade.Original@gmail.com
Youtube : https://www.youtube.com/DarknessBladeOrigin (We have TUTORIAL VIDEOS)

ASSET STORE 
VIDEO-1
VIDEO-2




[출처] https://forum.unity3d.com/threads/borderless-standalone-window-resizable-movable.298229/

반응형
Posted by blueasa
, |