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

카테고리

분류 전체보기 (2563)N
Unity3D (699)
Programming (461)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (213)
협업 (45)
3DS Max (3)
Game (12)
Utility (133)
Etc (95)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (45)N
Android (14)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (37)
Thinking (37)
한글 (28)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total1,645,818
Today9
Yesterday509
07-08 01:01

달력

« » 2022.7
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

공지사항

태그목록

반응형

[링크] https://mgun.tistory.com/2046

 

animation 최적화

케릭터에 붙어있는 애니메이션이 많을수록 케릭터 로딩이 느려진다. 한 스테이지에 케릭터가 10개가 나온다고 가정하고, 각 케릭터가 가져야 할 애니메이션 갯수가 영웅일 경우 20개, 적군일 경

mgun.tistory.com

 

반응형
Posted by blueasa

댓글을 달아 주세요

반응형

[링크] https://novemberfirst.tistory.com/90

 

[Unity] Device Simulator를 Package Manager에서 찾을 수 없을 때

2020.3 버전을 다운받았다. 너무 오랜만에 켜서 이것저것 찾아보다가 Device Simulator라는 기능을 써보고 싶어 추가하려는데 난 도저히 찾을 수 없었다. 그러다가 발견했다. Edit >Project Settings > Package M

novemberfirst.tistory.com

 

[참조] https://skuld2000.tistory.com/79

 

[Unity] 유니티에 새로 추가되는 디바이스 시뮬레이터(Device Simulator) 소개

1. 유니티 디바이스 시뮬레이터 (Unity Device Simulator) 유니티 디바이스 시뮬레이터(Unity Device Simulator)는 유니티 에디터에서 개발중인 게임을 실행했을 때 Game 윈도우에서 실행되는 대신 Game XCode 나..

skuld2000.tistory.com

 

반응형
Posted by blueasa

댓글을 달아 주세요

반응형

TMP에서 한글 문장 단위 자동 줄바꿈이 안될 때(영어는 잘 됨)

TMP Settings-Korean Language Options-Use Moern Line Breaking-체크

 

TMP Settings

 

[출처] 게임코디-즌성님

 

[참조]

https://gamecodi.com/6129/%EA%B2%80%EC%83%89%EC%9A%A9-%ED%85%8D%EC%8A%A4%ED%8A%B8-%EB%A9%94%EC%8B%9C-%ED%94%84%EB%A1%9C%EC%97%90%EC%84%9C-%ED%95%9C%EA%B8%80-%EC%82%AC%EC%9A%A9%EC%8B%9C-%EB%8B%A8%EC%96%B4-%EB%8B%A8%EC%9C%84%EB%A1%9C-%EC%A4%84-%EB%B0%94%EA%BF%88-textmeshpro-word-wrapping

 

[검색용] 텍스트 메시 프로에서 한글 사용시 단어 단위로 줄 바꿈 ( TextMeshPro Word Wrapping ) - 게임

텍스트 메시 프로사용시 자동 줄 바꿈 기능을 사용할 때 글자단위로 넘어가지 않고 단어 단위로 끊어져서 넘어가게 해야 할 경우 TMP Setting 파일에서 Korean Language Options에서 Use Modem Line Breaking 을

gamecodi.com

 

반응형
Posted by blueasa

댓글을 달아 주세요

반응형

꿈의집(HomeScapes)에서 위에 빨간 테두리로 보이는 것처럼 Soft Clip을 만들려고 이런저런 시도를 해보고

약간의 Trick을 포함해서 적용한 걸 간단하게 방법을 적어 놓음.

 

※ 우선은 블록들은 Sprite고, 밑에 Map이 Mesh를 사용하기 때문에 두가지 모두 Clipping 해야된다.

 

1. Unity 자체 Sprite Mask 추가(Menu-2D Object-Sprite Mask)

  [참조] https://docs.unity3d.com/kr/2020.3/Manual/class-SpriteMask.html

 

2. Sprite의 Mask Interaction을 Visible Inside Mask로 변경

3. Mesh Renderer도 Sprite Mask에 영향받도록 Shader에 아래처럼 Stencil 추가

Stencil {
		Ref 1
		Comp LEqual
    }

[참조1] https://devdata.tistory.com/166

[참조2] https://rainyrizzle.github.io/kr/AdvancedManual/AD_SpriteMask.html

------------------------------------------------------------------------------------------------

※ 여기까지 하면 Cutoff 된 상태로 Sprite, Mesh 둘 다마스킹이 잘된다.

   아래부터는 Soft Clip을 위해 구매한 에셋으로 시도한 Trick을 간단히 정리했다.

------------------------------------------------------------------------------------------------

4. Soft Clip을 위해 Sprite Alpha Mask 에셋 사용
   (제가 사용하기 위해 구매한 에셋이니 참조만 하시고 어떤 에셋을 사용하는지는 본인의 판단입니다.)

   [참조] https://assetstore.unity.com/packages/tools/particles-effects/sprite-alpha-mask-112704

 

5. Trick을 위해 맵의 배경 Sprite를 하나 복제해서 렌더링 순서를 아래와 같이 한다.

    (아래와 같이 배치하면 Foreground가 Map을 가려서 배경만 보이는 상태로 보인다.)

    [뒤] Background (Sprite)

    [중간] Map(Slot/Block 등) (Sprite+Mesh)

    [앞] Foreground (Sprite)

    

6. Foreground에 4.에서 산 에셋으로 Sprite Alpha Mask를 적용한다.

   (Masking 이미지는 아래 이미지를 사용하고, 9-Patch 한 후에 Sliced로 사용함)

Sprite Alpha Mask-Masking용 이미지

 

7. 6.의 Mask 크기는 1.의 Sprite Mask와 동일하게 맞춘다.

   (요약 : 앞에 배경을 하나 더 깔고 앞의 배경에 Alpha가 먹힌 구멍을 뚫어서 맵만 보이게 하려는 게 목적이다.)

 

8. 7.까지 하고나면 아래 이미지처럼 Sprite Mask의 Cutoff 영역 안쪽으로 Soft Clip처럼 보이게 된다.

   (빨간 테두리가 Sprite Mask 영역이고, 아래쪽 Sprite Mask 영역 안쪽으로 Soft Clip 처럼 적용된게 보인다)

Soft Clip Trick

 

반응형
Posted by blueasa

댓글을 달아 주세요

반응형

Here are two small tricks that can help if you’re making an isometric 2D game in Unity. Ok, so not actually isometric, but that’s the term we’re used to in videogames, so we’ll go with it. These are quite basic and if you’re working on such a game you’ve probably already tackled them your own way. This is our take on it, hopefully it’s useful to someone.

Sprite Ordering

Normally in a 2D game there is no concept of depth, so if you simply place the sprites in the world, you’ll most likely have objects appearing in the wrong order than what you’d expect in an isometric game.

 

Thankfully Unity exposes Sorting Layer and Order In Layer properties for Renderers.
A quick fix is to set the value of Order in Layer to depend on the Y position of the object.

 

[ExecuteInEditMode]
[RequireComponent(typeof(Renderer))]
public class DepthSortByY : MonoBehaviour
{

    private const int IsometricRangePerYUnit = 100;

    void Update()
    {
        Renderer renderer = GetComponent();
        renderer.sortingOrder = -(int)(transform.position.y * IsometricRangePerYUnit);
    }
}

This solves the problem for the simplest case, when we assume all objects rest on the ground.

 

Let’s assume we want to have an object that is above the ground in the world, like placing a bird house on that tree. Just trying to place it in the world will treat the pivot of the object as being at ground level, with no way to both place it at a proper height and sort it correctly.

 

There are several options for this. Just to get it out of the system, the first option is to add empty space to the texture below the bird house to make sure the pivot is at ground level (in Unity, the pivot can’t be outside of the sprite). This is baaaad! This is wasting texture space, and all instances of that object will need to be at the same height in the game. There are other, less insane, options.

One is having a height property in the DepthSortByY behavior and subtract it from transform.position.y when computing the sorting order.
Another solution (which we went with) is allowing the DepthSortByY behavior to make the depth computation based on another object’s transform. This way, the objects will be considered to be at the same point in space as their target and they’ll have the same depth order, even if they’re at different Y positions in the scene. In the bird house example, the bird house uses the tree’s world position for its depth computations.
This solution works better for our game, because it allows artists to move the item freely while staying at the depth (and not have to deal with editing the “height” parameter). And mainly because all the gameplay takes place in the ground’s 2D plane anyway so all objects are guaranteed to have a root object that has the ground position. In your own game, it might be easier to just use the first option.

[ExecuteInEditMode]
[RequireComponent(typeof(Renderer))]
public class IsometricObject : MonoBehaviour
{
   private const int IsometricRangePerYUnit = 100;
   
   [Tooltip("Will use this object to compute z-order")]
    public Transform Target;
    
    [Tooltip("Use this to offset the object slightly in front or behind the Target object")]
    public int TargetOffset = 0;
    
    void Update()
    {
        if (Target == null)
            Target = transform;
        Renderer renderer = GetComponent();
        renderer.sortingOrder = -(int)(Target.position.y * IsometricRangePerYUnit) + TargetOffset;
    }
}

This is how this example is set up in Unity:

The birdhouse references the tree for its depth.

 

And this is how it behaves in practice:

 

Ground Projection

For certain visual elements and effect, we wanted them to look properly projected on the ground, but also not spend too much time on making art for them. The ‘isometric’ view of the game means that anything that is horizontally on the ground should look squashed vertically.
For simple sprites, this is quite easy. Just draw them directly with the correct perspective and place them in the game.

Things get more complicated when you need something that should be able to rotate in any direction. Like something to show the direction the character is moving in, or some visual effect sweeping the ground towards your attacking direction. Especially if these are things that are animated, drawing them manually for all possible orientations is out of the question (or so the artists claim).

Our solution is: the artists draw and animate these effects as if viewed top-down, and the programmers take care of transforming them at runtime to look as if they were projected on the ground. Without any transformation, just taken from the artists and placed in the game rotating them to match the player’s direction they look like below.

 

We need to squash them vertically. For a sprite that doesn’t rotate, just scaling on the Y dimension does the job. But for a rotating sprite this doesn’t work, and it’s even worse for animations. The first thing we tried was a custom shader that transformed the vertices in the local space to squash them vertically (naturally, we went with the most complex solution first), but this needed to break batching to work properly with all sprites and animations. Or I was just bad at writing that shader, maybe…

The final solution is absurdly simple. Just rotate the object around the X axis, and it works!
However, we also wanted to:

  • apply the rotation automatically and consistently, and not have to remember or care about setting the X component of the rotation ourselves
  • be able to set the Z component of the rotation (to make the effect rotate towards any game world direction)
  • not have to visit all ‘ground projected’ effects when changing the amount of squashing

Basically, the game should not have to know that a rotation on X axis is happening. If an object has the ProjectOnGround behavior attached, it should just draw properly without additional effort. So we do the math just before rendering, and restore the rotation to its normal value right after. This hides the rotation around the X axis from the rest of the code.

[ExecuteInEditMode]
    public class ProjectOnGround : MonoBehaviour
    {
        private Quaternion savedRotation;

        // called before rendering the object        
        void OnWillRenderObject()
        {
            savedRotation = transform.rotation;
            var eulers = transform.rotation.eulerAngles;
            transform.rotation = Quaternion.Euler(Constants.Isometric.PerspectiveAngle, eulers.y, eulers.z);
        }

        //called right after rendering the object
        void OnRenderObject()
        {
            transform.rotation = savedRotation;
        }
    }

Simple and easy. Too bad I wasted time trying to write a shader for this. The result looks good and we can simple ‘project’ any object by just adding this behavior to it.

 

 

 

[출처] https://breadcrumbsinteractive.com/two-unity-tricks-isometric-games/

 

Two Unity tricks for isometric games - Breadcrumbs

Here are two small tricks that can help if you’re making an isometric 2D game in Unity. Ok, so not actually isometric, but that’s the term we’re used to in videogames, so we’ll go with it. These are quite basic and if you’re working on such a gam

breadcrumbsinteractive.com

 

반응형
Posted by blueasa

댓글을 달아 주세요

반응형

Hidden Assets

During the import process, Unity ignores the following files and folders in the Assets folder (or a sub-folder within it):

  • Hidden folders.
  • Files and folders which start with ‘.’.
  • Files and folders which end with ‘~’.
  • Files and folders named cvs.
  • Files with the extension .tmp.

This prevents importing special and temporary files created by the operating system or other applications.

 

[출처] https://forum.unity.com/threads/exclude-files-or-folders-from-importing.48090/

 

Exclude files or folders from importing

Is there any way to exclude psd, jpg, max file (or whole folder) in Assets folder from being imported to Unity as texture or model? I keep my...

forum.unity.com

 

[참조] https://docs.unity3d.com/Manual/SpecialFolders.html?_gl=1*f8onwh*_ga*MTUzMjkzMTA0MC4xNjIyNzEzNDM4*_ga_1S78EFL1W5*MTYyNDg3MTc4MS41LjEuMTYyNDg3MjE4OC4xMA..&_ga=2.190280226.821848530.1624841162-1532931040.1622713438 

 

Unity - Manual: Special folder names

Reusing assets between projects How do you use documentation throughout your workflow? Share your experience with us by taking this survey. Special folder names You can usually choose any name you like for the folders you create to organise your Unity proj

docs.unity3d.com

 

반응형
Posted by blueasa

댓글을 달아 주세요

반응형

[Android 앱 이름 로컬라이징] chameleonstudio.tistory.com/51

 

유니티 구글 앱 이름 변경 / 현지화

해당 티스토리 페이지는 필자가 유니티 C# 개발을 하면서 학습한 내용들을 기록하고 공유하는 페이지입니다 ! - 틀린 부분이 있거나, 수정된 부분이 있다면 댓글로 알려주세요 ! - 해당 내용을 공

chameleonstudio.tistory.com

 

 

[iOS 앱 이름 로컬라이징] chameleonstudio.tistory.com/52

 

iOS 앱 이름 변경 / 현지화

해당 티스토리 페이지는 필자가 유니티 C# 개발을 하면서 학습한 내용들을 기록하고 공유하는 페이지입니다 ! - 틀린 부분이 있거나, 수정된 부분이 있다면 댓글로 알려주세요 ! - 해당 내용을 공

chameleonstudio.tistory.com

 

반응형
Posted by blueasa

댓글을 달아 주세요

반응형

화면 색상이 이상한 경우 참고하실만한 내용인거 같습니다.

 

겔럭시 S10이상의 폰에서 게임 화면이 하얗게 나오는 현상이 발생합니다.

이 경우 원인은 옵션에서 사용자가 고르는 화면 모드가 원인입니다.

 

옵션 -> 디스플레이 -> 화면 모드를 선택합니다.

 

여기에서 선명한 화면을 선택 해봅시다.

 

정상적으로 색상이 돌아온것을 확인할 수 있습니다.

 

 

[출처]

gamecodi.com/4145/%EA%B2%94%EB%9F%AD%EC%8B%9C-s10%EC%9D%B4%EC%83%81%EC%9D%98-%ED%8F%B0%EC%97%90%EC%84%9C-%EA%B2%8C%EC%9E%84%ED%99%94%EB%A9%B4%EC%9D%B4-%ED%95%98%EC%96%97%EA%B2%8C-%EB%82%98%EC%98%A4%EB%8A%94-%ED%98%84%EC%83%81

 

겔럭시 S10이상의 폰에서 게임화면이 하얗게 나오는 현상 - 게임코디

화면 색상이 이상한 경우 참고하실만한 내용인거 같습니다. 겔럭시 S10이상의 폰에서 게임 화면이 하얗게 나오는 현상이 발생합니다. 이 경우 원인은 옵션에서 사용자가 고르는 화면 모드가 원

gamecodi.com

 

반응형
Posted by blueasa

댓글을 달아 주세요

반응형

UnityでiOSとAndrodのランタイムパーミッションの確認と要求を行う方法

 

Unityでアプリのカメラ権限の確認&要求ってどうやるの?

これまでのUnityでのアプリ開発では、iOS/Android端末の機能の権限のチェックやリクエストをするために、ネイティブプラグインを利用する必要がありました。
最近になってやっと、ランタイムパーミッション関係のAPIが追加されたようなので、自分なりに使い方を調べてみました。


[iOS] Application.RequestUserAuthorizationクラス

https://docs.unity3d.com/ja/2018.2/ScriptReference/Application.RequestUserAuthorization.html
Unity2018.1以降で利用可能
iOSでウェブカメラまたはマイクを使用するための承認をリクエストします。
(カメラとマイクの権限のみチェックとリクエストが可能)

[Android] Android.Permissionクラス

https://docs.unity3d.com/2018.3/Documentation/ScriptReference/Android.Permission.RequestUserPermission.html
https://docs.unity3d.com/ja/current/Manual/android-RequestingPermissions.html
Unity2018.3以降で利用可能
Androidでユーザーに、デバイスリソースまたは承認が必要な情報へのアクセスを許可するよう要求します。
(クラスで定義されていない権限でも文字列で指定してチェックとリクエストが可能)


それぞれのプラットフォームに対応している新しく追加されたAPIを使用することで、簡易的な処理ならばネイティブプラグインを使用しないで目的を達成できそうです。
今回はカメラとマイクの権限の確認と要求をセットで行う例の作成を試みました。
そして、何回も試行錯誤した結果、導きだしたコードがこちら。

ランタイムパーミッション要求の例

using UnityEngine;
using System.Collections;
using System;

#if UNITY_ANDROID && UNITY_2018_3_OR_NEWER
using UnityEngine.Android;
#endif

namespace PermissionAuthorizationTest
{
    // iOS/Androidプラットフォームで動作するランタイムパーミッション要求のサンプル
    // 参考URL: https://forum.unity.com/threads/requestuserauthorization-as-a-coroutine-bugged.380666/
    public class PermissionAuthorizationExample : MonoBehaviour
    {
        IEnumerator Start ()
        {
            #if UNITY_IOS && UNITY_2018_1_OR_NEWER

            // iOS
            //
            // カメラパーミッションが許可されているか調べる
            if (!Application.HasUserAuthorization (UserAuthorization.WebCam)) {
                // 権限が無いので、カメラパーミッションのリクエストをする
                yield return RequestUserAuthorization (UserAuthorization.WebCam);
            }
            // マイクパーミッションが許可されているか調べる
            if (!Application.HasUserAuthorization (UserAuthorization.Microphone)) {
                // 権限が無いので、マイクパーミッションのリクエストをする
                yield return RequestUserAuthorization (UserAuthorization.Microphone);
            }
            // リクエストの結果、アプリ機能に必要なパーミッションが全て許可されたか調べる
            if (Application.HasUserAuthorization (UserAuthorization.WebCam) && Application.HasUserAuthorization (UserAuthorization.Microphone)) {
                // 権限が許可されたので、権限が必要なAPIを使用する処理へ進む(iOSでは権限拒否された状態でAPIを使用しようとするとアプリが落ちる)
                findWebCams ();
                findMicrophones ();
            } else {
                // 権限が許可されなかったので、ユーザーに対して権限の使用用途の説明を表示して自分でOSのアプリ設定画面で権限許可を行うようにアナウンスする必要がある。
                // (iOSでは初回の権限リクエストが拒否された場合は、次回からはリクエスト自体が表示されなくなる)
            }       

            #elif UNITY_ANDROID && UNITY_2018_3_OR_NEWER

            // Android
            //
            // カメラパーミッションが許可されているか調べる
            if (!Permission.HasUserAuthorizedPermission (Permission.Camera)) {
                // 権限が無いので、カメラパーミッションのリクエストをする
                yield return RequestUserPermission (Permission.Camera);
            }
            // マイクパーミッションが許可されているか調べる
            if (!Permission.HasUserAuthorizedPermission (Permission.Microphone)) {
                // 権限が無いので、マイクパーミッションのリクエストをする
                yield return RequestUserPermission (Permission.Microphone);
            }
            // リクエストの結果、アプリ機能に必要なパーミッションが全て許可されたか調べる
            if (Permission.HasUserAuthorizedPermission (Permission.Camera) && Permission.HasUserAuthorizedPermission (Permission.Microphone)) {
                // 権限が許可されたので、権限が必要なAPIを使用する処理へ進む
                findWebCams ();
                findMicrophones ();
            } else {
                // 権限が許可されなかったので、ユーザーに対して権限の使用用途の説明を表示してから再度のリクエストを行う。
                // もしも拒否時に「今後表示しない」がチェックされた場合は、次回からリクエスト自体が表示されなくなる、
                // そのためユーザーには自分でOSのアプリ設定画面で権限許可を行うようにアナウンスする必要がある。
                // (Permissionクラスにはそれらの違いを調べる方法は用意されていない)
            }

            #endif

            yield break;
        }

#if (UNITY_IOS && UNITY_2018_1_OR_NEWER) || (UNITY_ANDROID && UNITY_2018_3_OR_NEWER)
        bool isRequesting;

        // OSの権限要求ダイアログを閉じたあとに、アプリフォーカスが復帰するのを待ってから権限の有無を確認する必要がある
        IEnumerator OnApplicationFocus(bool hasFocus)
        {
            // iOSプラットフォームでは1フレーム待つ処理がないと意図通りに動かない。
            yield return null;

            if (isRequesting && hasFocus)
            {
                isRequesting = false;
            }
        }

        #if UNITY_IOS
        IEnumerator RequestUserAuthorization(UserAuthorization mode)
        {
            isRequesting = true;
            yield return Application.RequestUserAuthorization(mode);
            // iOSではすでに権限拒否状態だとダイアログが表示されず、フォーカスイベントが発生しない。
            // その状態を判別する方法が見つからないので、タイムアウト処理をする。

            // アプリフォーカスが戻るまで待機する
            float timeElapsed = 0;
            while (isRequesting)
            {
                if (timeElapsed > 0.5f){
                    isRequesting = false;
                    yield break;
                }
                timeElapsed += Time.deltaTime;

                yield return null;
            }
            yield break;
        }
        #elif UNITY_ANDROID
        IEnumerator RequestUserPermission(string permission)
        {
            isRequesting = true;
            Permission.RequestUserPermission(permission);
            // Androidでは「今後表示しない」をチェックされた状態だとダイアログは表示されないが、フォーカスイベントは通常通り発生する模様。
            // したがってタイムアウト処理は本来必要ないが、万が一の保険のために一応やっとく。

            // アプリフォーカスが戻るまで待機する
            float timeElapsed = 0;
            while (isRequesting)
            {
                if (timeElapsed > 0.5f){
                    isRequesting = false;
                    yield break;
                }
                timeElapsed += Time.deltaTime;

                yield return null;
            }
            yield break;
        }
        #endif
#endif

        void findWebCams ()
        {
            foreach (var device in WebCamTexture.devices) {
                Debug.Log ("Name: " + device.name);
            }
        }

        void findMicrophones ()
        {
            foreach (var device in Microphone.devices) {
                Debug.Log ("Name: " + device);
            }
        }
    }
}

 

読みにくくてすみません、コードの意図は必要以上に詳細なコメントを読んで理解してください。
iOS/Android実機でコードを試した結果、とりあえず期待通りに動作していることを確認しました。

OnApplicationFocus()を使用してアプリフォーカスの復帰を待機する処理は、
RequestUserAuthorization as a coroutine - bugged?
のスレッドのやりとりをヒントにしています。
このためコードがかなり複雑化してしまいました。

とにかく、権限が必要なAPIを利用する前に、あらかじめこのような処理を挟んでおくこで、アプリがクラッシュするなどの事態を避けることが出来るようになりました。

APIが追加される前の古いUnityバージョンではどうする?

Androidでは以下の記事の方法で可能です。ネイティブプラグインが必要無いので気軽に導入できる方法です。
UnityでAndroidのランタイムパーミッションに対応する
iOSでもAndroidでもAssetプラグインを使えば同様の事が実現可能です。たぶん無料のものも存在するはず。

最新のUnityのAPIでも権限の処理には不十分な点も

UnityのAPIは必要最小限の簡易的なものしか用意されていません。
ネイティブアプリと同等の権限の処理をしたい場合は、やはりネイティブプラグインの利用を検討する必要があるでしょう。

参考リンク

UnityにおけるAndroidアプリのパーミッション付与について

 

 

[출처] qiita.com/utibenkei/items/65b56c13f43ce5809561

 

UnityでiOSとAndrodのランタイムパーミッションの確認と要求を行う方法 - Qiita

Unityでアプリのカメラ権限の確認&要求ってどうやるの? これまでのUnityでのアプリ開発では、iOS/Android端末の機能の権限のチェックやリクエストをするために、ネイティブプラグインを利用

qiita.com

 

반응형
Posted by blueasa

댓글을 달아 주세요

반응형

Unity2018에서 Unity2019로 올려보면서 나오는 에러 정리

 

그렇게 큰 이슈는 없는 듯 하고, GUIText와 GUITexture가 obsolete 되면서 나온 이슈 뿐인 것 같다.

 

[Error:1] error CS0619: 'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.'

  -> GUIText -> UnityEngine.UI.Text 로 변경

 

[Error:2-1] error CS0619: 'GUITexture' is obsolete: 'GUITexture has been removed. Use UI.Image instead.'

  -> GUITexture -> UnityEngine.UI.Image 로 변경

 

[Error:2-2] error CS1061: 'Image' does not contain a definition for 'texture' and no accessible extension method 'texture' accepting a first argument of type 'Image' could be found (are you missing a using directive or an assembly reference?)

  -> Texture2D를 Sprite로 변환해서 처리

 

public void CameraFadeAdd(Texture2D texture)
{
  ....
  //Create Sprite from the Texture2D
  Sprite tempSprite = Sprite.Create(texture, new Rect(0.0f, 0.0f, texture.width, texture.height), new Vector2(0.5f, 0.5f), 100.0f);
  cameraFade.GetComponent().sprite = tempSprite;
  ....
}

[Error:2-2 참조] stackoverflow.com/questions/53491613/guitexture-is-deprecated-so-what-should-i-use-instead-of-it

 

[Error:3] 

[해당 씬에 접근 했을 때 Error]

- Component GUI Layer in Main Camera for Scene Assets/Scenes/InGame.unity is no longer available. It will be removed after you edit this GameObject and save the Scene. UnityEditor.SceneManagement.EditorSceneManager:OpenScene(String)

[빌드 할 때 Error]

- Component GUI Layer in Main Camera for Scene Assets/Scenes/InGame.unity is no longer available. It will be removed after you edit this GameObject and save the Scene. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

- Component at index 2 could not be loaded when loading game object 'Main Camera'. Removing it!
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

  -> 해당 Scene으로 가서 Hierarchy에서 임의 수정 후 Save 하면 해결 됨.

 

[Error:3 참조]

Baroni 2020년 8월 12일 오전 6:43

All of them can be ignored. Just open the scenes once and save them.

[참조링크] www.rebound-games.com/forum/topic/2485/networkmanager-networkscenename-cannot-be-used-in-this-context-because-the-set-accessor-is-inaccessible/5

반응형
Posted by blueasa

댓글을 달아 주세요