'전체 글'에 해당되는 글 1594건

  1. 2022.05.13 제페토 모바일 GetComponent 에러
  2. 2022.05.10 유니티 스크립트 Missing 한번에 지우기 (SelectGameObjectsWithMissingScripts)
  3. 2022.05.03 Load font from mobile device and assign as fallback TMP_FontAsset
  4. 2022.04.16 데브시스터즈 온라인 쇼케이스 | 데브나우 2022 | Full Ver. (EN/KR/JP/TH/TW Sub)
  5. 2022.04.15 거북목 교정 & 허리아플때 매일매일 하자
  6. 2022.04.15 Zepeto Follow UIGauge

제페토 모바일 GetComponent 에러

Zepeto 2022. 5. 13. 10:22
반응형

반응형
Trackbacks 0 : Comments 0

Write a comment


유니티 스크립트 Missing 한번에 지우기 (SelectGameObjectsWithMissingScripts)

Unity3D 2022. 5. 10. 12:04
반응형
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using UnityEngine.SceneManagement; //3

public class SelectGameObjectsWithMissingScripts : Editor
{
    [MenuItem("smilejsu/Remove All Missing Script Components")]
    private static void RemoveAllMissingScriptComponents() {

        Object[] deepSelectedObjects = EditorUtility.CollectDeepHierarchy(Selection.gameObjects);

        Debug.Log(deepSelectedObjects.Length);

        int componentCount = 0;
        int gameObjectCount = 0;

        foreach (Object obj in deepSelectedObjects)
        {
            if (obj is GameObject go)
            {
                int count = GameObjectUtility.GetMonoBehavioursWithMissingScriptCount(go);

                //Debug.LogFormat("<color=cyan>{0}</color>", count);

                if (count > 0) {
                    Undo.RegisterCompleteObjectUndo(go, "Remove Missing Scripts");

                    GameObjectUtility.RemoveMonoBehavioursWithMissingScript(go);

                    componentCount += count;
                    gameObjectCount++;
                }

            }
        }

    }
}

 

 

게임 오브젝트를 선택하고 메뉴에서 Remove를 눌러주면 

자식 오브젝트들을 모두 검색해 Missiing 난 스크립트 컴포넌트를 제거 합니다 

반응형
Trackbacks 0 : Comments 0

Write a comment


Load font from mobile device and assign as fallback TMP_FontAsset

Unity3D 2022. 5. 3. 17:21
반응형

https://forum.unity.com/threads/load-font-from-mobile-device-and-assign-as-fallback-tmp_fontasset.657151/

 

Load font from mobile device and assign as fallback TMP_FontAsset

I'm working on a mobile app with multi-language support, including Japanese. I do not want to include the Japanese font in the app, but I also want to...

forum.unity.com

 

 

Project에서 가져온 글꼴 파일과 달리 CreateDynamicFontFromOSFont를 사용하여 만든 글꼴에 글꼴 파일/글꼴 데이터에 대한 참조가 없기 때문에 이 기능이 작동하지 않습니다. 

TMP에서 사용하는 FontEngine은 지정된 글꼴의 파일 경로에서 글꼴 자산을 만들 수 있습니다. 따라서 이 OS 글꼴 파일의 경로를 가지고 있다면 이 경로를 사용하는 CreateFontAsset에 대한 새로운 오버로드를 TMP에 추가할 수 있습니다. 또는 CreateDynamicFontFromOSFont를 사용하여 만든 글꼴에서 fontData를 참조하도록 하거나 글꼴에 대한 파일 경로에 참조를 표시하도록 Font 클래스를 수정하도록 Unity를 변경해야 합니다. 이 두 가지 옵션 모두 변경 사항을 백포팅해야 하기 때문에 문제가 됩니다.

반응형
Trackbacks 0 : Comments 0

Write a comment


데브시스터즈 온라인 쇼케이스 | 데브나우 2022 | Full Ver. (EN/KR/JP/TH/TW Sub)

Private 2022. 4. 16. 00:12
반응형

 

 

 

https://www.youtube.com/watch?v=R-N5hoxaqIE 

 

반응형
Trackbacks 0 : Comments 0

Write a comment


거북목 교정 & 허리아플때 매일매일 하자

Private 2022. 4. 15. 22:41
반응형

https://www.youtube.com/watch?v=3aTPapvWpKs 

https://www.youtube.com/watch?v=Rjv7hnHkgXE 

 

반응형
Trackbacks 0 : Comments 0

Write a comment


Zepeto Follow UIGauge

Zepeto 2022. 4. 15. 00:37
반응형
import { ZepetoScriptBehaviour } from 'ZEPETO.Script'
import { Camera, GameObject, Transform, Vector3, Vector2, RectTransformUtility, RectTransform} from "UnityEngine"
import { Slider } from "UnityEngine.UI"

export default class UIHpGauge extends ZepetoScriptBehaviour {

    public target: Transform;
    public  sldier: Slider;
    public canvasRect : RectTransform;
    private zepetoCam : Camera;
    
    public  Init(target : Transform)
    {
        this.target = target;
        this.zepetoCam = GameObject.Find("ZepetoCamera").GetComponent<Camera>();
    }
    
    Update()
    {
        if(this.target != null){

            // Calculate *screen* position (note, not a canvas/recttransform position)
            var canvasPos =  $ref<Vector2>();
            var screenPoint: Vector3 = this.zepetoCam.WorldToScreenPoint(this.target.position);
            
            // Convert screen position to Canvas / RectTransform space <- leave camera null if Screen Space Overlay
            RectTransformUtility.ScreenPointToLocalPointInRectangle(this.canvasRect, new Vector2(screenPoint.x, screenPoint.y + 120), null, canvasPos);

            var tpos = $unref(canvasPos);
            
            // Set
            this.sldier.transform.localPosition = new Vector3(tpos.x, tpos.y, 0);
            //Debug.Log(canvasPos);
        }
    }

}
반응형
Trackbacks 0 : Comments 0

Write a comment