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

카테고리

분류 전체보기 (2738)
Unity3D (817)
Programming (475)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (228)
협업 (58)
3DS Max (3)
Game (12)
Utility (136)
Etc (96)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (53)
Android (14)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday
04-29 11:53
    using System.Text.RegularExpressions;
    
    /// <summary>
    /// 닉네임 체크
    /// 글자수 제한 : 1~10
    /// 사용가능 문자 : 숫자/영어소문자/영어대문자/한글/일본어/한자
    /// [정규식]
    /// 숫자 : 0-9
    /// 영어 대소문자 : a-zA-Z
    /// 한글완성형 : 가-힣
    /// 한글자모음 : ㄱ-ㅎㅏ-ㅣ(제외)
    /// 일본어 : [ぁ-ゔ]+|[ァ-ヴー]+[々〆〤]
    /// 한자 : 一-龥
    /// </summary>
    /// <param name="_strInputNickname"></param>
    /// <returns>isMatch</returns>
    public static bool IsValidNickname(string _strInputNickname)
    {
        Regex regex = new Regex(@"^[0-9a-zA-Z가-힣ぁ-ゔァ-ヴー々〆〤一-龥]{1,10}$");
        bool bIsMatch = regex.IsMatch(_strInputNickname);
        if (false == bIsMatch)
        {
            Debug.LogWarningFormat("숫자와 영문 대소문자,한글,일본어,한자만 입력가능합니다.(글자제한1~10)");
        }

        return bIsMatch;
    }

 

반응형
Posted by blueasa
, |

Unity 2021.3.37f1

----

 

기존에 Custom Debug.cs를 만들어서 Plugins 폴더에 넣고 Debug.Log 사용 유무를 제어했었는데,

스토어 둘러보다보니 Disable Logs Easy라는게 보여서 살펴보니 좋아보인다.

게다가 Free..

기존의 Debug.cs를 제거하고 이걸로 교체 함.

 

 

[링크] https://assetstore.unity.com/packages/tools/utilities/disable-logs-easy-206473

 

Disable Logs Easy | 유틸리티 도구 | Unity Asset Store

Use the Disable Logs Easy from Dev Dunk Studio on your next project. Find this utility tool & more on the Unity Asset Store.

assetstore.unity.com

 

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

 

디바이스에서 Debug.Log 메시지 출력하지 않도록 하기

[추가] 2024-04-17 #define으로 Editor, Device등 원하는 곳에 띄울 수 있게 약간 변형함 #if UNITY_EDITOR #define MY_DEBUG #endif using UnityEngine; using System.Collections; using System; using UnityEngine.Internal; /// /// It overrides Uni

blueasa.tistory.com

 

반응형
Posted by blueasa
, |

Unity 2021.3.37f1

Lunar Mobile Console - Pro v1.8.5

----

Lunar Mobile Console - Pro에서 Actions and Variables를 사용할 수 있는데,

이번에 enum 넣으면서 참조 링크를 다시 봤는데 enum 관련 작성을 제대로 안해놔서 좀 헤메서..

변수 타입별 사용방법 정리 겸 샘플 작성해서 올려 둠.

 

 

using UnityEngine;
using System.Collections;
using LunarConsolePlugin;

public class AnLunarConsole_Actions_Variables_Manager : MonoBehaviour
{
    public enum eVariablesType
    {
        One,
        Two,
        Three
    }

    [CVarContainer]
    public static class Variables
    {
        public static readonly CVar myBool = new CVar("My boolean value", true);
        public static CVarChangedDelegate CVarChangedDelegate_myBool = null;
        public static readonly CVar myFloat = new CVar("My float value", 3.14f);
        public static CVarChangedDelegate CVarChangedDelegate_myFloat = null;
        public static readonly CVar myInt = new CVar("My integer value", 10);
        public static CVarChangedDelegate CVarChangedDelegate_myInt = null;
        public static readonly CVar myString = new CVar("My string value", "Test");
        public static CVarChangedDelegate CVarChangedDelegate_myString = null;
        public static readonly CEnumVar<eVariablesType> myEnum = new CEnumVar<eVariablesType>("My enum value", eVariablesType.Two);
        public static CVarChangedDelegate CVarChangedDelegate_myEnum = null;
    }

    IEnumerator Start()
    {
        yield return null;

        InitActions();
        InitVariables();

        AddAction();
        AddDelegate();
    }

    void OnDestroy()
    {
        RemoveAction();
        RemoveDelegate();
    }

    #region Actions
    void InitActions()
    {

    }

    void AddAction()
    {
        LunarConsole.RegisterAction("[Common] Action Common 1", Action_Common_1);
        LunarConsole.RegisterAction("[Common] Action Common 2_1", () => Action_Common_2(1));
        LunarConsole.RegisterAction("[Common] Action Common 2_2", () => Action_Common_2(2));
        LunarConsole.RegisterAction("[InGame] Action InGame", Action_InGame);
        LunarConsole.RegisterAction("[OutGame] Action OutGame", Action_OutGame);
    }

    void RemoveAction()
    {
        LunarConsole.UnregisterAllActions(this); // don't forget to unregister!
    }

    void Action_Common_1()
    {
        // do something..
    }

    void Action_Common_2(int _iValue)
    {
        // do something..
    }

    void Action_InGame()
    {
        // do something..
    }

    void Action_OutGame()
    {
        // do something..
    }
    #endregion

    #region Variables
    void InitVariables()
    {
        Variables.myBool.BoolValue = true;
        Variables.myFloat.FloatValue = 3.14f;
        Variables.myInt.IntValue = 10;
        Variables.myString.Value = "Test";
        //Variables.myEnum.EnumValue = eVariablesType.Two;  // Can't
    }

    void AddDelegate()
    {
        // myBool
        Variables.CVarChangedDelegate_myBool = (value) =>
        {
            UnityEngine.Debug.Log("[myBool is] " + value);
            OnCVarChangedDelegate_myBool(value);
        };
        Variables.myBool.AddDelegate(Variables.CVarChangedDelegate_myBool);

        // myFloat
        Variables.CVarChangedDelegate_myFloat = (value) =>
        {
            UnityEngine.Debug.Log("[myFloat is] " + value);
            OnCVarChangedDelegate_myFloat(value);
        };
        Variables.myFloat.AddDelegate(Variables.CVarChangedDelegate_myFloat);

        // myInt
        Variables.CVarChangedDelegate_myInt = (value) =>
        {
            UnityEngine.Debug.Log("[myInt is] " + value);
            OnCVarChangedDelegate_myInt(value);
        };
        Variables.myInt.AddDelegate(Variables.CVarChangedDelegate_myInt);

        // myString
        Variables.CVarChangedDelegate_myString = (value) =>
        {
            UnityEngine.Debug.Log("[myString is] " + value);
            OnCVarChangedDelegate_myString(value);
        };
        Variables.myString.AddDelegate(Variables.CVarChangedDelegate_myBool);

        // myEnum
        Variables.CVarChangedDelegate_myEnum = (value) =>
        {
            UnityEngine.Debug.Log("[myEnum is] " + value);
            CEnumVar<eVariablesType> cEnumVar = (CEnumVar<eVariablesType>)value;
            eVariablesType eEnumValue = cEnumVar.EnumValue;
            OnCVarChangedDelegate_myEnum(eEnumValue);
        };
        Variables.myEnum.AddDelegate(Variables.CVarChangedDelegate_myEnum);
    }

    void RemoveDelegate()
    {
        Variables.myBool.RemoveDelegate(Variables.CVarChangedDelegate_myBool);
        Variables.myFloat.RemoveDelegate(Variables.CVarChangedDelegate_myFloat);
        Variables.myInt.RemoveDelegate(Variables.CVarChangedDelegate_myInt);
        Variables.myString.RemoveDelegate(Variables.CVarChangedDelegate_myString);
        Variables.myEnum.RemoveDelegate(Variables.CVarChangedDelegate_myEnum);
    }

    void OnCVarChangedDelegate_myBool(bool _bValue)
    {
        // do something..
    }

    void OnCVarChangedDelegate_myFloat(float _fValue)
    {
        // do something..
    }

    void OnCVarChangedDelegate_myInt(int _iValue)
    {
        // do something..
    }

    void OnCVarChangedDelegate_myString(string _strValue)
    {
        // do something..
    }

    void OnCVarChangedDelegate_myEnum(eVariablesType _eVariablesType)
    {
        // do something..
    }
    #endregion
}

 

 

[참조] https://github.com/SpaceMadness/lunar-unity-console/wiki/Actions-and-Variables#listening-for-variable-changes

 

Actions and Variables

High-performance Unity iOS/Android logger built with native platform UI - SpaceMadness/lunar-unity-console

github.com

 

반응형
Posted by blueasa
, |

[링크]

https://psh10004okpro.com/entry/Unity-%EB%A1%9C%EC%BB%AC%EB%9D%BC%EC%9D%B4%EC%A7%95-TextMeshPro-TMPFont-%ED%95%9C%EA%B5%AD%EC%96%B4-%EC%9D%BC%EB%B3%B8%EC%96%B4-%EC%A4%91%EA%B5%AD%EC%96%B4-%EB%8C%80%ED%91%9C%EB%82%98%EB%9D%BC-%EC%9C%A0%EB%8B%88%EC%BD%94%EB%93%9C-%EB%B2%94%EC%9C%84

 

Unity 로컬라이징 TextMeshPro TMP_Font 유니코드 범위

Unity TextMeshPro Character Set : Unicode Range (Hex) 핑크색 배경 글이 필수 주요 문자입니다. 한글 구분 시작 끝 한글(자음, 모음) 1100 11FF 호환용 한글(자음, 모음) 3131 318F 한글 음절(가~힣) AC00 D7A3 한자 구분

psh10004okpro.com

 

반응형
Posted by blueasa
, |

Windows 10

SourceTree 3.4.17

----

 

git에서 Pull을 받으려고 하니 'Filename too long' 에러가 뜨면서 Pull 받을 수가 없다.

검색해보니 longpath 허용을 해주면된다고 한다.

하는김에 전역으로 적용하기 위해 --global 추가 적용함

----

 

1) 소스트리 터미널 열기(SourceTree > Actions > Open in Terminal)

 

2) 아래 명령어 실행

git config --global core.longpaths true

 

 

 

[참조] https://daewonyoon.tistory.com/456

 

[GIT] error unable to create file ... Filename too long

git clone 을 하려고 하는데, 파일명이 너무 길어서 실패했다. error: unable to create file 2022/07_swift_test_projects/how-to-make-async-command-line-tools-and-scripts-1/ how-to-make-async-command-line-tools-and-scripts-1/SwiftConcurrencyB

daewonyoon.tistory.com

[참조] https://neive.tistory.com/748

 

소스트리(SourceTree) Filename too long 에러 뜰 때

git config core.longpaths true 소스트리에서 동작>터미널 열기 로 콘솔창 열어서 위의 커멘드를 입력

neive.tistory.com

 

반응형
Posted by blueasa
, |

Apple Mac Studio M1 Ultra

Sonoma 14.4.1

----

 

Mac M1에서 CocoaPods 업데이트(pod repo update)를 하려고 pod을 입력하니 '찾을 수 없다(Can't find pod in path)'고 뜬다.

 

찾아보니 M1에서는 별도로 처리를 좀 해줘야되나보다.

아래와 같은 순서로 진행했다.

 

 

1. 응용 프로그램 > 유틸리티 > 터미널.app 우클릭(Right-Mouse Click) > 정보 가져오기 클릭(Left-Mouse Click)

 

2. 'Rosetta를 사용하여 열기' 체크

 

3. '터미널.app' 완전 종료 후 재실행

4. cocoapods/ffi 언인스톨(기존 것 삭제)

    → sudo gem uninstall cocoapods

    → sudo gem uninstall ffi

 

5. sudo xcode-select --switch /Applications/Xcode.app

    (정확히 왜 하는진 모르니 일단 하라고하니 함..)

6. cocoapods/ffi 인스톨

     sudo gem install cocoapods

     sudo gem install ffi

7. pod 설치

     pod install

 

[참조] https://github.com/CocoaPods/CocoaPods/issues/10220

 

Got error while trying pod install · Issue #10220 · CocoaPods/CocoaPods

Command /usr/local/bin/pod install Report What did you do? pod install What did you expect to happen? Installing my pod's What happened instead? Error. This is on my MacBook Pro with the new M1 pro...

github.com

[Cocoapods 제거 참조] https://velog.io/@jungti1234/cocoapods-%EC%82%AD%EC%A0%9C%EC%A0%9C%EA%B1%B0-%EB%B0%A9%EB%B2%95

 

cocoapods 삭제/제거 방법

 

velog.io

 

반응형
Posted by blueasa
, |
1. gem list --local | grep cocoapods 명령어로 조회해보면 cocoapods 관련 설치가 많은데 다 지울 것

2. 지우는 명령어는 sudo gem uninstall cocoapods (혹은 cocoapods 관련 설치된 라이브러리명)

3. 내 유저명 폴더에 숨겨진 .cocoapods 폴더 제거
rm -rf ~/.cocoapods

4. /Users/유저명/Library/Caches/CocoaPods 폴더 제거
rm -rf ~/Library/Caches/CocoaPods

(재설치 원하면 5. brew install cocoapods 명령어 입력하여 설치하면 끝)

 

 

[출처] https://velog.io/@jungti1234/cocoapods-%EC%82%AD%EC%A0%9C%EC%A0%9C%EA%B1%B0-%EB%B0%A9%EB%B2%95

 

cocoapods 삭제/제거 방법

 

velog.io

 

반응형
Posted by blueasa
, |

AppIconChangerUnity
https://github.com/kyubuns/AppIconChangerUnity

Change the app icon dynamically in Unity
Support for new icon formats in Xcode13
-> This means that A/B Test on AppStore is also supported.


- iOS only, require iOS 10.3 or later



## Instructions
- Import by PackageManager `https://github.com/kyubuns/AppIconChangerUnity.git?path=Assets/AppIconChanger`
- (Optional) You can import a demo scene on PackageManager.




## Quickstart

- Create `AppIconChanger > AlternateIcon` from the context menu




- Set the name and icon





- The following methods are available




## Tips


### What is the best size for the app icon?

When the Type of `AlternateIcon` is set to Auto Generate, the icon will be automatically resized at build time, so there is nothing to worry about. (The maximum size is 1024px.)
If you want to control it in detail, you can change the Type to Manual.





## Requirements
- Unity 2020.3 or higher.
- Xcode 13 or higher.



## License
MIT License (see LICENSE)

 

 

[출처] https://forum.unity.com/threads/appiconchangerunity-change-the-app-icon-dynamically-in-unity-ios-only.1245787/

 

AppIconChangerUnity - Change the app icon dynamically in Unity (iOS only)

AppIconChangerUnity https://github.com/kyubuns/AppIconChangerUnity Change the app icon dynamically in Unity Support for new icon formats in Xcode13 ->...

forum.unity.com

 

반응형
Posted by blueasa
, |

[링크] https://firefighting-seismic.tistory.com/99

 

윈도우 10 SSD 프리징 현상 100% 해결 방법

본문에서 다룰 사례는 주로 AMD 최신 라이젠 메인보드, AMD 초기 라이젠 메인보드(B350, X370)와 특정 브랜드 M.2 NVMe SSD, SATA SSD에서 발생하는 이슈다. 대표적 발현 증상으로는 크롬 브라우저 이용 중

firefighting-seismic.tistory.com

 

반응형
Posted by blueasa
, |
using UnityEngine;

public class OcclusionCulling2D : MonoBehaviour
{
    [System.Serializable] public class ObjectSettings
    {
        [HideInInspector] public string title;
        public GameObject theGameObject;

        public Vector2 size = Vector2.one;
        public Vector2 offset = Vector2.zero;
        public bool multiplySizeByTransformScale = true;

        public Vector2 sized { get; set; }
        public Vector2 center { get; set; }
        public Vector2 TopRight { get; set; }
        public Vector2 TopLeft { get; set; }
        public Vector2 BottomLeft { get; set; }
        public Vector2 BottomRight { get; set; }
        public float right { get; set; }
        public float left { get; set; }
        public float top { get; set; }
        public float bottom { get; set; }

        public Color DrawColor = Color.white;
        public bool showBorders = true;
    }

    public ObjectSettings[] objectSettings = new ObjectSettings[1];

    private Camera camera;
    private float cameraHalfWidth;

    public float updateRateInSeconds = 0.1f;

    private float timer;

    void Awake(){ 
        camera = GetComponent<Camera>();
        cameraHalfWidth = camera.orthographicSize * ((float)Screen.width / (float)Screen.height);

        foreach(ObjectSettings o in objectSettings){
           o.sized = o.size * (o.multiplySizeByTransformScale ? new Vector2(Mathf.Abs(o.theGameObject.transform.localScale.x), Mathf.Abs(o.theGameObject.transform.localScale.y)) : Vector2.one);
            o.center = (Vector2)o.theGameObject.transform.position + o.offset;

            o.TopRight = new Vector2(o.center.x + o.sized.x, o.center.y + o.sized.y);
            o.TopLeft = new Vector2(o.center.x - o.sized.x, o.center.y + o.sized.y);
            o.BottomLeft = new Vector2(o.center.x - o.sized.x, o.center.y - o.sized.y);
            o.BottomRight = new Vector2(o.center.x + o.sized.x, o.center.y - o.sized.y);

            o.right = o.center.x + o.sized.x;
            o.left = o.center.x - o.sized.x;
            o.top = o.center.y + o.sized.y;
            o.bottom = o.center.y - o.sized.y;
        }
    }

    void OnDrawGizmosSelected()
    {
        foreach(ObjectSettings o in objectSettings)
        {
            if(o.theGameObject)
            {
                o.title = o.theGameObject.name;

                if(o.showBorders)
                {
                    o.TopRight = new Vector2(o.center.x + o.sized.x, o.center.y + o.sized.y);
                    o.TopLeft = new Vector2(o.center.x - o.sized.x, o.center.y + o.sized.y);
                    o.BottomLeft = new Vector2(o.center.x - o.sized.x, o.center.y - o.sized.y);
                    o.BottomRight = new Vector2(o.center.x + o.sized.x, o.center.y - o.sized.y);
                    Gizmos.color = o.DrawColor;
                    Gizmos.DrawLine(o.TopRight, o.TopLeft);
                    Gizmos.DrawLine(o.TopLeft, o.BottomLeft);
                    Gizmos.DrawLine(o.BottomLeft, o.BottomRight);
                    Gizmos.DrawLine(o.BottomRight, o.TopRight);
                }
            }
        }
    }
    
    void FixedUpdate()
    {
        timer += Time.deltaTime;
        if(timer > updateRateInSeconds) timer = 0;
        else return;

        float cameraRight = camera.transform.position.x + cameraHalfWidth;
        float cameraLeft = camera.transform.position.x - cameraHalfWidth;
        float cameraTop = camera.transform.position.y + camera.orthographicSize;
        float cameraBottom = camera.transform.position.y - camera.orthographicSize;

        foreach(ObjectSettings o in objectSettings)
        {
            if(o.theGameObject)
            {
                bool IsObjectVisibleInCastingCamera = o.right > cameraLeft & o.left < cameraRight & // check horizontal
                                                      o.top > cameraBottom & o.bottom < cameraTop; // check vertical
                o.theGameObject.SetActive(IsObjectVisibleInCastingCamera);
            }
        }
    }
}

[출처] https://www.youtube.com/watch?v=hbBDqdoHUpE

반응형
Posted by blueasa
, |