Get it on Google Play


Wm뮤 :: '분류 전체보기' 카테고리의 글 목록 (22 Page)

블로그 이미지
가끔 그림그리거나 3D모델링하거나
취미로 로봇만드는
퇴직한 전자과 게임프로그래머
2020.3.48f1 , 2022.3.6f1 주로 사용
모카쨩
@Ahzkwid

Recent Comment

Archive


2023. 3. 6. 16:22 Unity

계정 ID와 트랜잭션 ID 찾는법은 하단 참조

 

 

 

 

 

 

계정 ID 찾는법

 

 

 

 

 

 

 

트랜잭션 아이디는 지메일에서 개발자 등록 당시 냈던 요금의 영수증에서 찾을수 있다

 

신버전

 

구버전

 

 

 

 

 

휴 제일 큰 고생이 끝났다

 

이전할 앱을 추가하자

 

 

 

 

 

 

 

 

 

 

 

 

그러면 수신측에서 이런 메일이 온다

요청검토를 눌러주고

 

마찬가지로 동의 및 이전을 눌러주자

 

 

 

 

 

 

다만 계정이 바뀌어서 그런지 광고 SDK에 문제가 좀 생긴다나 보다

아직 확인은 안 해봄

'Unity' 카테고리의 다른 글

유니티 애니메이션 관련  (0) 2023.04.03
유니티 파티클, 트레일, 라인 렌더러  (0) 2023.01.21
유니티 창위치 설정  (0) 2022.06.18
posted by 모카쨩
2023. 2. 4. 17:59 서브스탠스 페인터

 

미리 만들어둔 텍스처 올려두기

 

 

 

 

 

 

 

 

 

 

 

posted by 모카쨩
2023. 1. 30. 09:54 서브스탠스 페인터

 

 

 

[Mesh import] File import failed, reverting back to previous one

계층구조를 바꾸고 익스포트해서 그렇다

이미지와 같이 부모를 체크해제하는식으로 프로젝트 생성당시처럼 맞춰주면 어느정도 해결된다

그래도 발생하면 스케일 문제다

posted by 모카쨩
2023. 1. 30. 05:07 서브스탠스 페인터

posted by 모카쨩
2023. 1. 29. 21:52 게임

유닛스케일 설정

 

바운스 설정해주기

 

 

 

 

동일한 부속품들은 전부 상속해주기

메쉬자체를 병합하기

 

 

텍스처는 가급적 최소화하되 큰부류는 분리

 

 

 

모자 쉐이프키는 이동, 사이즈, 각도가 있어야한다

 

 

 

'게임' 카테고리의 다른 글

내 블루아카 스샷모음  (0) 2023.09.21
GTA5 차량 가격  (0) 2022.06.30
아크 조련일지  (0) 2020.07.24
posted by 모카쨩
2023. 1. 22. 00:30 게임/VRChat

자주 쓰는 U# 코드들이다

 

 

핸들이 손에 잡힌 상태인지

GetComponent<VRC_Pickup>().IsHeld
//주의: GetComponent<VRC_Pickup>().currentHand != VRC_Pickup.PickupHand.None는 오작동하므로 쓰면 안됨

 

왼손으로 잡혀있는지

GetComponent<VRC_Pickup>().currentHand == VRC_Pickup.PickupHand.Left

 

 

 

 

변수동기화

[UdonSynced]
int state = 0;

 

 

 

매뉴얼 동기화 예제

이 코드는 종각역 만들때 썼다

using UdonSharp;
using UnityEngine;
using UnityEngine.UI;
using VRC.SDKBase;
using VRC.Udon;

[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
public class StageText : UdonSharpBehaviour
{
    [UdonSynced]
    [Multiline]
    public string syncText;

    public Text textUI;


    public void UpdateText(string text)
    {
        Networking.SetOwner(Networking.LocalPlayer, gameObject);
        syncText = text;
        RequestSerialization();
    }
    void Update()
    {
        textUI.text = syncText;
    }
}

 

 

 

텔레포트

using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;

[UdonBehaviourSyncMode(BehaviourSyncMode.None)]
public class TeleportUS : UdonSharpBehaviour
{
    public Transform teleportTarget;
    public override void Interact()
    {
        Networking.LocalPlayer.TeleportTo(teleportTarget.position, teleportTarget.rotation);
    }
}

 

 

 

 

스크립트 LOD

기본 LOD도 훌륭하지만 이걸 쓰는 이유는 라이팅이나 스크립트 On Off도 용이하기 때문이다

몰론 그렇다고 이거만 쓰진 말고 기본 LOD와 병행해서 쓰자

using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;

[UdonBehaviourSyncMode(BehaviourSyncMode.None)]
public class ScriptLOD : UdonSharpBehaviour
{

    public float radius = 20;
    public GameObject[] hqObjects;
    public GameObject[] lqObjects;
#if UNITY_EDITOR
    void OnDrawGizmos()
    {
        Gizmos.DrawWireSphere(transform.position, radius);
    }
#endif
    void Update()
    {
        var active = Vector3.Distance(Networking.LocalPlayer.GetPosition(), transform.position) < radius;
        foreach (var obj in hqObjects)
        {
            obj.SetActive(active);
        }
        foreach (var obj in lqObjects)
        {
            obj.SetActive(!active);
        }
    }
}

'게임 > VRChat' 카테고리의 다른 글

Booth 선물 방법  (0) 2023.04.14
VRChat 캐릭터 압착되는 문제  (0) 2023.01.01
VRChat OSC  (0) 2022.02.19
posted by 모카쨩
2023. 1. 21. 23:55 Unity

 

파티클의 startLifeTime

//읽을때
var startLifetime=particleEffect.main.startLifetime.constant;


//쓸때
var particleEffectMain = particleEffect.main;
var startLifetime = particleEffectMain.startLifetime;
startLifetime.constant = 설정할시간;
particleEffectMain.startLifetime = startLifetime;

 

파티클 텍스처 변경

var renderer = particle.GetComponent<Renderer>();
renderer.material.mainTexture = sprite.texture;

 

파티클 데이터 수정

//생성
{
    var particleSystem = GetComponent<ParticleSystem>();
    var particles = new ParticleSystem.Particle[100];
    for (int i = 0; i < particles.Length; i++)
    {
        particles[i] = new ParticleSystem.Particle();
        particles[i].position = new Vector3(0, i * 0.1f, 0);
        particles[i].startSize = particleSystem.main.startSize.Evaluate(0);
        particles[i].rotation3D = new Vector3(0, i * 10, 0);
    }
    particleSystem.SetParticles(particles);
}

//읽기
{
    var particleSystem = GetComponent<ParticleSystem>();
    var particles = new ParticleSystem.Particle[particleSystem.particleCount];
    particleSystem.GetParticles(particles);
    for (int i = 0; i < particles.Length; i++)
    {
        Debug.Log($"particles[{i}].position: {particles[i].position}");
        Debug.Log($"particles[{i}].rotation3D: {particles[i].rotation3D}");
        
        Debug.DrawLine(particles[i].position, particles[i].position+Quaternion.Euler(particles[i].rotation3D) * Vector3.forward*0.1f);
        Debug.DrawLine(particles[i].position, particles[i].position + Quaternion.Euler(particles[i].rotation3D) * Vector3.up * 0.1f);
        //Debug.Log($"Quaternion.Euler(particles[{i}].rotation3D): {Quaternion.Euler(particles[i].rotation3D)}");
    }
}

//수정
{
    var particleSystem = GetComponent<ParticleSystem>();
    var particles = new ParticleSystem.Particle[particleSystem.particleCount];
    particleSystem.GetParticles(particles);
    for (int i = 0; i < particles.Length; i++)
    {
        particles[i].position = new Vector3(0, i * 0.1f, 0);
    }
    particleSystem.SetParticles(particles);
}

 

 

 

라인렌더러 좌표를 트랜스폼들 좌표로 설정

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


#if UNITY_EDITOR

using UnityEditor;
[CustomEditor(typeof(TransformsLine))]
public class TransformsLineEditor : Editor
{
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();//기본 인스펙터를 받아올때
        serializedObject.Update();
        {
            if (GUILayout.Button("Preview"))
            {
                ((FishingLine)target).SetLineRenderer();
            }
        }
        serializedObject.ApplyModifiedProperties();


    }
}

#endif

public class TransformsLine : MonoBehaviour
{

    public Transform[] transforms;
    public LineRenderer lineRenderer;
    // Start is called before the first frame update
    void Start()
    {
        lineRenderer = lineRenderer ?? GetComponent<LineRenderer>();
    }

    // Update is called once per frame
    public void SetLineRenderer()
    {
        if ((lineRenderer != null) && (transforms.Length > 0))
        {
            lineRenderer.SetPositions(System.Array.ConvertAll(transforms, transform => transform.position));
        }
    }
    // Update is called once per frame
    void Update()
    {
        SetLineRenderer();
    }
}

 

 

 

 

 

 

트레일 Positions 구조

//1번라인
(0: (-0.3, 0.7, 0.0))(1: (-0.3, 0.7, 0.0))(2: (-0.4, 0.8, 0.1))
(3: (-0.6, 1.0, 0.4))(4: (-0.5, 1.1, 0.5))(5: (-0.5, 1.2, 0.5))
(6: (-0.5, 1.3, 0.5))(7: (-0.5, 1.3, 0.5))(8: (-0.5, 1.2, 0.6))
(9: (-0.5, 1.0, 0.6))(10: (-0.5, 0.9, 0.6))(11: (-0.5, 0.8, 0.6))

//2번라인
(12: (-0.5, 0.9, 0.7))(13: (-0.5, 0.9, 0.7))(14: (-0.4, 1.0, 0.8))
(15: (-0.4, 1.0, 0.8))(16: (-0.4, 1.0, 0.8))(17: (-0.4, 1.0, 0.8))
(18: (-0.4, 1.1, 0.8))(19: (-0.4, 1.1, 0.8))(20: (-0.4, 1.1, 0.8))
(21: (-0.4, 1.0, 0.9))(22: (-0.4, 1.0, 0.9))(23: (-0.4, 0.9, 0.9))

동일한 좌표를 두번 찍는것으로 시작점을 표현

 

'Unity' 카테고리의 다른 글

구글플레이 앱 이전  (0) 2023.03.06
유니티 창위치 설정  (0) 2022.06.18
유니티 csv 에셋  (0) 2022.04.30
posted by 모카쨩
2023. 1. 20. 07:49 Unity/shader

 

1:1

 

2:1 크롭

 

 

Shader "Ahzkwid/ScreenOverlay"
{
    Properties
    {
        _MainTex ("Texture", 2D) = "white" {}
    }
    SubShader
    {
        Tags { "RenderType"="Opaque" }
        LOD 100

        Pass
        {
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag

            #include "UnityCG.cginc"

            struct appdata
            {
                float4 vertex : POSITION;
                float2 uv : TEXCOORD0;
            };

            struct v2f
            {
                float2 uv : TEXCOORD0;
                float4 vertex : SV_POSITION;
            };

            sampler2D _MainTex;
            float4 _MainTex_ST;
            float4 _MainTex_TexelSize;
            

            v2f vert (appdata v)
            {
                v2f o;
				o.uv = float4(TRANSFORM_TEX(v.uv, _MainTex),1,1);
				o.vertex.xy = o.uv;
				o.vertex.xy -= 0.5;
				o.vertex.xy *= 2;
				o.vertex.y = -o.vertex.y;
				o.vertex.zw = 1;

                return o;
            }

            fixed4 frag (v2f i) : SV_Target
            {
                fixed2 uv=i.uv;
                
				float screenWid = _ScreenParams.x / _ScreenParams.y;
				float texelWid = _MainTex_TexelSize.z / _MainTex_TexelSize.w;
                if(screenWid>texelWid)
                {
                    uv.x*=screenWid;
			        uv.x -= screenWid / 2;
			        uv.x += texelWid / 2;
                    uv.x/=texelWid;
                }
                else
                {

				    float screenHei = 1/screenWid;
				    float texelHei = 1/texelWid;

                    uv.y*=screenHei;
			        uv.y -= screenHei / 2;
			        uv.y += texelHei / 2;
                    uv.y/=texelHei;
                }

                fixed4 col = tex2D(_MainTex, uv);
                col.a*=all(uv==saturate(uv));
                return lerp(0,col,col.a);
            }
            ENDCG
        }
    }
}

'Unity > shader' 카테고리의 다른 글

PerlinNoise HLSL  (0) 2023.04.25
유니티 스카이박스 관련  (0) 2023.01.16
함수 그래프 모음  (0) 2022.01.15
posted by 모카쨩

  • total
  • today
  • yesterday

Recent Post

저사양 유저용 블로그 진입