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

카테고리

분류 전체보기 (2861)
Unity3D (899)
Programming (479)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (192)
협업 (65)
3DS Max (3)
Game (12)
Utility (142)
Etc (99)
Link (34)
Portfolio (19)
Subject (90)
iOS,OSX (53)
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://naver.me/FIOwAI5v

 

아이가 재밌어한다면 그 책이 세상에서 가장 좋은 그림책입니다

[BY 앙쥬] ※ 임신·출산·육아 온오프라인 매거진 <앙쥬> 11월호에 게재된 기사입니다.하루가 멀다 하고 ...

m.post.naver.com

 

반응형
Posted by blueasa
, |

최근에 안드로이드 프로젝트 컴파일 시 오류가 발생했습니다.

구글링으로 이것 저것 같아 보았는데, compileSdkVersion 와 com.android.support:appcompat-v7을 28로 올리면 해결된다는 글이 많았습니다. 

그래서 원인을 찾아보고 해결 방법을 찾았습니다.

 

[오류]

error: resource android:attr/fontVariationSettings not found.

Message{kind=ERROR, text=error: resource android:attr/fontVariationSettings not found., 

sources=[C:\*****\*****\.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\4fbc79d932923de1fd1d9a6e9b479d50\res\values\values.xml:246:5-69], original message=, tool name=Optional.of(AAPT)}

 

error: resource android:attr/ttcIndex not found.

Message{kind=ERROR, text=error: resource android:attr/ttcIndex not found., 

sources=[C:\*****\*****\.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\4fbc79d932923de1fd1d9a6e9b479d50\res\values\values.xml:246:5-69], original message=, tool name=Optional.of(AAPT)} 

 

[원인]

 애드몹의 SDK 최신 버전이 18로 이번주에 배포 되어 있는데, 이 SDK의 경우 Android API 28(안드로이드 9) 에서 최적화 된듯 합니다.

gradle의 dependencies에서 최신의 애드몹 SDK를 참조하고 있고, Andorid API가 27 이하인 경우에 발생합니다.

 

[해결]

 모듈 gradle에서 참조하고 있는 애드몹의 SDK의 버전을 17로 설정하면 컴파일 오류가 해결됩니다.

 

(변경전) 

implementation 'com.google.android.gms:play-services-ads:+'

(변경후)

implementation 'com.google.android.gms:play-services-ads:17+'

 



출처: https://docko.tistory.com/entry/안드로이드-오류-error-resource-androidattrfontVariationSettings-ttcIndex-not-found [장똘]

 

안드로이드 오류 - error: resource android:attr/fontVariationSettings & ttcIndex not found.

최근에 안드로이드 프로젝트 컴파일 시 오류가 발생했습니다. 구글링으로 이것 저것 같아 보았는데, compileSdkVersion 와 com.android.support:appcompat-v7을 28로 올리면 해결된다는 글이 많았습니다. 그래서..

docko.tistory.com

 

반응형
Posted by blueasa
, |

유니티의 소스 파일들을 Git을 통해 버전관리 하고 있는데,
이상하게 몇 개 어셋들이 제대로 싱크가 되지 않는 문제가 있었습니다.

이 어셋들이 뱉어내는 에러는 공통적으로 .dll 파일이 없어져서 문제였는데,
이것 때문에 Git을 안 쓸 수는 없는 문제라서 한동안은 각 작업자마다 해당 어셋을 다시 import하거나 dll 파일을 복사해 주는 식으로 해결했습니다.

그러다가 오랜만에 소스를  다시 받을 일이 생겨서 clone을 했더니 같은 문제가 생겼는데 그 사이 사용하는 어셋들이 늘어나다보니 수작업은 너무 귀찮았습니다.
(벌써 오래전에 해결했어야 했는데 말이죠)

구글링을 해 보고는 이 문제는 Git 클라이언트로 SourceTree를 사용하기 때문이라는 점을 알아냈습니다.

http://stackoverflow.com/questions/15515729/git-repository-ignoring-all-dlls

핵심은 SourceTree에는 Global .gitignore를 기본으로 제공하는데 이 파일에 *.dll 이 포함되어 있는거죠. (왜죠??)

이 파일은 아래의 경로에서 찾을 수 있고요.

Tools=>Options=>Git then “Edit File”

  1. .dll 을 찾아서 라인 앞에 #을 붙여서 주석처리 해 줍니다.
  2. 해당 프로젝트 선택하고
  3. GitBash(터미널)을 연 후,
  4. git add .
  5. git commit -m ‘dll 파일 추가’
  6. git push

이렇게 진행해 주시면 해결됩니다.

SourceTree 문제일 거라는 생각은 못해 봤네요.

 

[출처] https://heartgamer.wordpress.com/2015/12/07/unity-git%EC%9D%84-%EC%97%B0%EB%8F%99%ED%96%88%EC%9D%84-%EB%95%8C-dll-%ED%8C%8C%EC%9D%BC%EC%9D%B4-tracking%EB%90%98%EC%A7%80-%EC%95%8A%EB%8A%94-%EB%AC%B8%EC%A0%9C-%ED%95%B4%EA%B2%B0/

 

Unity, Git을 연동했을 때 dll 파일이 tracking되지 않는 문제 해결.

유니티의 소스 파일들을 Git을 통해 버전관리 하고 있는데, 이상하게 몇 개 어셋들이 제대로 싱크가 되지 않는 문제가 있었습니다. 이 어셋들이 뱉어내는 에러는 공통적으로 .dll 파일이 없어져서 문제였는데, 이것 때문에 Git을 안 쓸 수는 없는 문제라서 한동안은 각 작업자마다 해당 어셋을 다시 import하거나 dll 파일을 복사해 주는 식으로 해결…

heartgamer.wordpress.com

 

반응형
Posted by blueasa
, |

참고

[ http://blog.naver.com/PostView.nhn?blogId=teshe&logNo=140055084055&widgetTypeCall=true ]

 

화면에 \3000 이렇게 표시하고 싶었는데 

""\\"" 를 사용하면 역슬래시만 표시 된다. 

 

그래서 \를 표시하기 위해 찾아봤는데 아래의 NumberFormatInfo 클래스를 사용하면 된다. 

 

using System.Globalization;

 

double price = 3000;

NumberFormatInfo numberFormat = new CultureInfo("ko-KR", false).NumberFormat;

Console.WriteLine(price.ToString("c", numberFormat);

 

c 대신에 n을 넣으면 3자리씩 끊어서 출력한다.

ko-KR 통화표시 부분

 

ko-KR , en-US, ja-Jp 사용하면 국가별 표시 가능.



출처: https://podo1017.tistory.com/133 [Keep Moving]

 

[c#] 한국 원화 \ 표시하기.

참고 [ http://blog.naver.com/PostView.nhn?blogId=teshe&logNo=140055084055&widgetTypeCall=true ] 화면에 \3000 이렇게 표시하고 싶었는데 ""\\"" 를 사용하면 역슬래시만 표시 된다. 그래서 \를 표시하기 위..

podo1017.tistory.com

 

반응형
Posted by blueasa
, |

 

[링크] https://blog.naver.com/bumodream/221753107339

 

[부모와 아이] 혼낼 때, 눈 보라고 하지 마세요~! / 임영주 부모교육연구소

[부모와 아이] 혼낼 때, 눈 보라고 하지 마세요~!​ 우리 애는 잘못을 해 놓고는 제가 무슨 말을 하려고 하...

blog.naver.com

 

반응형
Posted by blueasa
, |

이것 저것 그린거 이래저래 다 주고 남은 것 중 스캔 된 건 이것 뿐인 듯..

 

 

내가 그린 거..

 

 

 

동기 여자애한테 하나 그려주고 답례(?)로 받은 거..

 

반응형
Posted by blueasa
, |

 

[링크] https://github.com/Over17/UnityAndroidNotchSupport

 

Over17/UnityAndroidNotchSupport

Support for Android Notch (Cutout) in Unity 2017.4 and earlier - Over17/UnityAndroidNotchSupport

github.com

UnityAndroidNotchSupport

Android devices with a notch (display cutout) have recently become quite common. However, if you make a Unity application and deploy it to such device, by default Android OS will letter-box your app so that it the notch doesn't interfere with your UI.

If you want to make use of the whole display surface area and render in the area "behind" the notch, you need to add code to your application. Fortunately, since Unity 2018.3 there is a special option in the Player settings called "Render outside safe area" which does exactly this. If you want to have the same option in earlier versions of Unity - this plugin was made for you!

One advantage of this plugin over the built-in Unity solution is that it allows changing the setting in runtime if needed, by calling public void SetRenderBehindNotch(bool enabled) in RenderBehindNotchSupport.

If you are planning to make use of "rendering behind the notch" feature, you'll also need another feature which returns you the area of the screen which is outside of the notch area (and is safe to render to). The API is equivalent to what Screen.safeArea API does in newer Unity versions, and returns a Rect.

This plugin is targeted towards Unity 2017.4, however I see no reasons why it shouldn't work with earlier versions too.

System Requirements

  • Tested on Unity 2017.4.28f1. Should work on any Unity version out there, but make sure your target API is set to 28 or higher. There is no point in using this plugin in Unity 2018.3 or later because these versions have notch support out of the box.
  • An Android device with Android 9 Pie or later. Some devices with earlier Android versions have notch/cutout, but Google has added a corresponding API only in Android 9. Feel free to add other vendor-specific bits of code to add support on earlier Androids at your own risk.

Usage

  1. Copy the contents of Assets directory to your project
  2. Attach the Assets/Scripts/RenderBehindNotchSupport.cs script to a game object of your choice in your first scene to make sure the plugin is loaded as early as possible
  3. The script has a public boolean property so that you can tick/untick the checkbox to enable or disable rendering behind the notch with a single click
  4. If you want to change the setting in runtime, call public void SetRenderBehindNotch(bool enabled) in RenderBehindNotchSupport class.
  5. Attach the Assets/Scripts/AndroidSafeArea.cs script to a game object of your choice if you need the safe area API. The property AndroidSafeArea.safeArea is returning a Rect, use it to layout your UI.
  6. Enjoy

Alternative solution

Instead of using the script (or if you want to apply the "render behind the notch" flag as early as possible), you could modify the theme used by Unity. To do so, please create a file at the path Assets/Plugins/Android/res/values-v28/styles.xml with the following contents:

Unity 2017.4 or newer

<?xml version="1.0" encoding="utf-8"?> <resources> <style name="BaseUnityTheme" parent="android:Theme.Material.Light.NoActionBar.Fullscreen"> <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item> </style> </resources>

Before 2017.4 (ie. 5.6)

<?xml version="1.0" encoding="utf-8"?> <resources> <style name="UnityThemeSelector" parent="android:Theme.Material.Light.NoActionBar.Fullscreen"> <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item> </style> </resources>

There is no need to add the script to your project in this case. You may also need to tweak the snippet above if you are using a custom theme.

I recommend using the default approach with the script unless you have good reasons to do otherwise.

Useful Links

License

Licensed under MIT license.

반응형
Posted by blueasa
, |

[수정] 2021-06-10

Height 값 참조 오류 수정(참조 값 manualHeight -> activeHeight로 변경)

 

[스크립트 파일]

UISafeAreaOffsetController.cs
0.00MB

 

아래 위치와 같이 Anchor의 하위에 GameObject를 하나 만들고,

인스펙터와 같이 Top/Bottom에 따라 만들어진 GameObeject를 Drag&Drop 해서 Link 한다.

 

 

위와 같이 셋팅해 주면 Fan이 Top쪽 Safe Area가 있으면 그에 맞게 좀 더 내려온다

(Bottom은 같은 형태로 List Offset List_Bottom에 Link 해주면 된다.)

 

대충 만들어서 넣어놔서 정리좀 하고 싶지만 다음 기회로..

필요하신 분은 받아서 써보시고 개량해서 공유 좀 해주세요~

 

 

[참조] https://blueasa.tistory.com/2272

반응형
Posted by blueasa
, |

우선, NGUI의 UIAnchor 대해 SafeAreas 대응 할 수 있기 때문에 참고.

이외에도 SafeAreas으로 다음의 대응이 필요하지만,이 기사에서는 UIAnchor의 대처 방법을 설명합니다.

필요할 수 :

· UIRect의 Anchor

· UIScrollView의 표시 범위 조정 (Anchor의 기준이 변화하기 때문에 UI 조정해야 할)




Contents [ hide ]

전제 조건 :

이 문서는 다음을 전제로 이야기를 진행합니다.

· Unity5.6.6를 사용하여 개발하고 있습니다.

· iOSSafeAreasPlugin을 다운로드하여 가져올 수 있음

Plugin 다운로드 사이트

https://bitbucket.org/p12tic/iossafeareasplugin/src

· OS는 iOS만을 고려하고 있습니다.

소스 코드

우선 소스 코드에서 공개합니다.

안전 영역의 취득

SafeAreaScreen.cs

이 소스 코드는 주로 안전 영역의 취득을 담당하고 있습니다.

Unity 편집기에서 화면 크기를 iPhoneX와 같은 크기 (1125 × 2436)로 설정하면 Unity Player에서 디버그 할 수도 있습니다.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Runtime.InteropServices;

public class SafeAreaScreen  {

#if UNITY_IOS
    [DllImport("__Internal")]
    private extern static void GetSafeAreaImpl(out float x, out float y, out float w, out float h);
#endif

    static public Rect GetSafeArea()
    {
        float x, y, w, h;

        //初期値設定
        x = 0;
        y = 0;
        w = Screen.width;
        h = Screen.height;

#if UNITY_IOS && !UNITY_EDITOR
        //iOSSafeAreasPluginを呼び出す
        GetSafeAreaImpl(out x, out y, out w, out h);

#elif UNITY_ANDROID && !UNITY_EDITOR
        //Androidの縦長端末対応が必要になったときのために

#else


        //UnityエディタでiPhoneXのテストできるように値を設定する
        if(Screen.width == 1125 && Screen.height == 2436 ){
            y = 102;
            h = 2202;
        }

#endif
        return new Rect(x, y, w, h);
    }

    static public int GetTopOffsetY(){
        int offset = 0;

        //画面の高さとセーフエリアの高さの差分
        Rect screenSize = GetSafeArea();

        if (Screen.height != screenSize.height) {
            offset = Screen.height - (int)screenSize.height - (int)screenSize.y;
        }

        return offset;
    }

    static public int GetBottomOffsetY(){
        int offset = 0;

        //セーフエリアのyの位置取得
        Rect screenSize = GetSafeArea();

        if (Screen.height != screenSize.height) {
            offset = (int)screenSize.y;
        }

        return offset;
    }

}

NGUI의 SafeArea

NguiSafeAreaPatch.cs

SafeAreaScreen.cs에서 얻은 안전 영역을 바탕으로 Anchor의 위치를 ​​조정합니다.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NguiSafeAreaPatch : MonoBehaviour {

    void Awake()
    {
        // UIAnchorを使ってAnchorを設定している場合
        UIAnchor anchor = gameObject.GetComponent();
        if(anchor != null){

            //offsetの値を取得する
            SetUIAnchorOffset(anchor);

            return;
        }

        // UIRectをAnchorを使っている場合
        UIRect rect = gameObject.GetComponent();
        if (rect != null) {
            //現在,NGUIのソースコードを解析中
            //完成しだい公開予定
            return;
        }
    }

    private void SetUIAnchorOffset(UIAnchor anchor){

        //現在のoffsetを取得する
        Vector2 nowOffset = anchor.pixelOffset;

        //TOP側の補正値取得
        int topCorrectionOffset = SafeAreaScreen.GetTopOffsetY ();

        //Bottom側の補正値取得
        int bottomCorrectionOffset = SafeAreaScreen.GetBottomOffsetY ();

        switch (anchor.side) {

            case UIAnchor.Side.Top:
            case UIAnchor.Side.TopLeft:
            case UIAnchor.Side.TopRight:
                anchor.pixelOffset.Set(nowOffset.x, nowOffset.y - topCorrectionOffset);

            break;

            case UIAnchor.Side.Bottom:
            case UIAnchor.Side.BottomLeft:
            case UIAnchor.Side.BottomRight:
                anchor.pixelOffset.Set(nowOffset.x, nowOffset.y + bottomCorrectionOffset);			
            break;


        }
        
    }



}

 

사용법은이 소스 코드를 UIAnchor가 부착되어있는 게임 객체에 첨부 할뿐.

소스에서 무슨 일을하는지는 동작 환경이 iPhoneX 판정되면 스크린과 안전 영역의 높이의 차이를 계산하여 차등 분 게임 오브젝트를 낮 춥니 다.

델타 값은 UIAnchor의 "Pixel Offset"에 할당됩니다.

소스 코드를 반영한 ​​결과

NguiSafeAreaPatch.cs을 UIAnchor에 연결시킨 결과를 기재합니다.

■ 반영 전

■ 반영 후

그 결과 안전 영역을 기준으로 할 수있었습니다.

이것으로 UIAnchor 대해서는 SafeArea의 대처가되었습니다.

그러나, 그 밖에도 「UIRect의 Anchor '에 대해서도 SafeAreas 대응이 있습니다. 대응이 끝나는대로 수시 문서에 추가하는 것입니다.

 

 

[출처] https://dream-target.jp/2018/10/01/post-470/

 

UnityにてiPhoneX対応・NGUIのUIAnchorにSafeAreaの補正処理を入れてみた

とりあえず、NGUIのUIAnchorについてSafeAreas対応ができたのでメモ。 実行環境がiPhoneXと判定したら、スクリーンとセーフエリアの高さの差分を計算して、差分だけゲームオブジェクト(UIAnchorがアタッチされていること)を下げます。

dream-target.jp

 

반응형
Posted by blueasa
, |

Unity Script에서 UIApplicationExitsOnSuspend Key 제거(with PostProcessBuild)

----

 

using UnityEditor;
using UnityEditor.Callbacks;
#if UNITY_IOS
using System.IO;
using UnityEditor.iOS.Xcode;
#endif
 
public class BuildProcessor
{
   [PostProcessBuild(1)]
   public static void OnPostprocessBuild(BuildTarget buildTarget, string pathToBuiltProject)
   {
#if UNITY_IOS
      // Get plist
      string plistPath = pathToBuiltProject + "/Info.plist";
      PlistDocument plist = new PlistDocument();
      plist.ReadFromString(File.ReadAllText(plistPath));
 
      // Get root
      PlistElementDict rootDict = plist.root;
 
      // Set encryption usage boolean
      string encryptKey = "ITSAppUsesNonExemptEncryption";
        rootDict.SetBoolean(encryptKey, false);
 
      // remove exit on suspend if it exists.
      string exitsOnSuspendKey = "UIApplicationExitsOnSuspend";
      if(rootDict.values.ContainsKey(exitsOnSuspendKey))
      {
         rootDict.values.Remove(exitsOnSuspendKey);
      }
 
      // Write to file
      File.WriteAllText(plistPath, plist.WriteToString());
#endif
   }
}

 

[출처] https://forum.unity.com/threads/the-info-plist-contains-a-key-uiapplicationexitsonsuspend.689200/

 

The Info.plist contains a key 'UIApplicationExitsOnSuspend

I have this error after updated my inapp module. Using unity 2018.3.13f1 ITMS-90339: Deprecated Info.plist Key - The Info.plist contains a key...

forum.unity.com

 

 

[참조] https://blog.naver.com/yoohee2018/221566174487

 

[Unity] Deprecated Info.plist Key - The Info.plist contains a key 'UIApplicationExitsOnSuspend'

Unity 2019.1.4.1f​[19.06.19 기준 에러발생]유니티 iOS 빌드하여 Xcode에서 Archive 제출 시 다음과...

blog.naver.com

 

반응형
Posted by blueasa
, |