๋ณธ๋ฌธ์œผ๋กœ ๋ฐ”๋กœ๊ฐ€๊ธฐ
728x90

 

 

 

์กธ์—… ์ž‘ํ’ˆ์„ ๋งˆ๋ฌด๋ฆฌํ•˜๋Š” ์‹œ์ฆŒ์ด๋ผ ๋ฐ”๋น ์„œ, ๊ฐœ๋ฐœ์—๋งŒ ๋ชฐ๋‘ํ•˜๋‹ค ๋ณด๋‹ˆ ๊ธ€์„ ์“ธ ์‹œ๊ฐ„์ด ์—†์—ˆ๋„ค์š”. ๋งˆ๊ฐ์ด ๋‹ค๊ฐ€์˜ค๋‹ˆ, ํšจ์œจ์ ์ด๊ณ  ์ข‹์€ ์†Œ์Šค ์ฝ”๋“œ๋ฅผ ์งœ๋Š” ๊ฒƒ๊ณผ ์‹œ๊ฐ„ ์•ˆ์— ๋งˆ๋ฌด๋ฆฌ ํ•˜๋Š” ๊ฒƒ ์‚ฌ์ด์—์„œ ํƒ€ํ˜‘์„ ํ•ด์•ผ ํ–ˆ์Šต๋‹ˆ๋‹ค.

๊ทธ๋Ÿฌ๋‹ค ๋ณด๋‹ˆ, ์ด๊ฒŒ ์ข‹์€ ๋ฐฉ๋ฒ•์ธ๊ฐ€๋ฅผ ๊ณ ๋ฏผํ•  ๊ฒจ๋ฅผ์ด ๋งŽ์ด ์—†์–ด ํ•˜๋“œ ์ฝ”๋”ฉ๋„ ์–ด๋Š ์ •๋„ ๋“ค์–ด๊ฐ„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์‹œ๊ฐ„์ด ๋‚˜๋ฉด ์ฐจ์ฐจ ๋‹ค์‹œ ๊ณ ๋ฏผํ•ด๋ณด๋ฉฐ ๋ฆฌํŒฉํ† ๋ง์„ ํ•ด๋ณด๊ณ  ์‹ถ๋„ค์š”.

 

๊ธ€์„ ์•ˆ ์“ด ์ง€ ์˜ค๋ž˜ ๋˜์—ˆ๋‹ค ๋ณด๋‹ˆ, ์–ด๋””์„œ๋ถ€ํ„ฐ ๊ธ€์„ ์จ์•ผํ•  ์ง€ ๋ชจ๋ฅด๊ฒ ๋”๊ตฐ์š”,,, ๊ทธ๋ž˜์„œ ์ผ๋‹จ ์ตœ๊ทผ์— ํ•œ ๊ฒƒ ์ค‘ ๊ธ€์„ ๋…๋ฆฝ์ ์œผ๋กœ ์“ธ ์ˆ˜ ์žˆ๋Š” ๋ถ€๋ถ„๋ถ€ํ„ฐ ์จ๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

 

 

 


1. ์ฟผํ„ฐ๋ทฐ(isometric view) ์‹œ์ ์˜ ๋ฌธ์ œ์ 

 

์ด ๊ฒŒ์ž„์€ 3D ๋กœ๊ทธ๋ผ์ดํฌ ํ•ต ์•ค ์Šฌ๋ž˜์‹œ ๊ฒŒ์ž„์œผ๋กœ, ์ฟผํ„ฐ๋ทฐ ์‹œ์ ์„ ๊ฐ€์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์œ„์—์„œ ์‚ด์ง ๋Œ€๊ฐ์„  ๋ฐฉํ–ฅ์ธ ๋ถ€๋ถ„์—์„œ ๋‚ด๋ ค๋‹ค ๋ณด๋Š” ์‹œ์ ์„ ์˜๋ฏธํ•˜์ง€์š”.

 

์‚ฌ์‹ค, isometric view๋ž€ ๋ง์ด ์ •ํ™•ํ•œ ๊ฐœ๋…์ด๊ธด ํ•ฉ๋‹ˆ๋‹ค. isometric view๋Š” Orthographic ํˆฌ์˜๊ณผ ๊ด€๋ จ๋œ ๋‚ด์šฉ์ด๋ผ 3D์—์„œ๋Š” ๊ฑฐ์˜ ์“ฐ์ด์ง„ ์•Š์ง€๋งŒ, ๋””์ž์ด๋„ˆ๊ฐ€ ์—†๋Š” ์ €ํฌ ํŒ€ ํ˜•ํŽธ์ƒ isometric 2D Sprite๋ฅผ ๊ตฌํ•˜๊ธฐ๊ฐ€ ์‰ฝ์ง€ ์•Š์•˜๊ธฐ์— 3D๋กœ ๋ถˆ๊ฐ€ํ”ผํ•˜๊ฒŒ ๊ฒฐ์ •๋œ ์ผ€์ด์Šค๊ธด ํ•ฉ๋‹ˆ๋‹ค.

 

์ฟผํ„ฐ๋ทฐ ์‹œ์ ์˜ ์˜ˆ [์ถœ์ฒ˜ : ๊ฒŒ์ž„, "ํ•˜๋ฐ์Šค(Hades)"]

 

์œ„์™€ ๊ฐ™์€ ํŠน์ง•์„ ๊ฐ€์ง„ ์ฟผํ„ฐ๋ทฐ๋Š” ๊ฒŒ์ž„ ๋‚ด์˜ ํ™˜๊ฒฝ ์˜ค๋ธŒ์ ํŠธ(๊ฑด๋ฌผ, ๋‚˜๋ฌด ๋“ฑ)๊ฐ€ ์บ๋ฆญํ„ฐ๋ฅผ ๊ฐ€๋ฆด ์ˆ˜ ์žˆ๋‹ค๋Š” ๋ฌธ์ œ์ ์ด ์กด์žฌํ•ฉ๋‹ˆ๋‹ค.

 

์ด๋ ‡๊ฒŒ ๋ฒฝ์— ๊ฐ€๋ ค์ ธ์„œ ์บ๋ฆญํ„ฐ๊ฐ€ ๋ณด์ด์ง€ ์•Š๋Š” ๋ฌธ์ œ์ ์ด ์ƒ๊น๋‹ˆ๋‹ค. (GIF ์šฉ๋Ÿ‰์ด ๋„ˆ๋ฌด ์ปค์„œ ํ”„๋ ˆ์ž„๊ณผ ํ™”์งˆ์„ ๋‚ฎ์ท„์Šต๋‹ˆ๋‹ค.)

 

์ด๋Ÿฌํ•œ ๋ฌธ์ œ์ ์„ ํ•ด๊ฒฐํ•˜๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ, ์˜ค๋ธŒ์ ํŠธ๊ฐ€ ์บ๋ฆญํ„ฐ๋ฅผ ๊ฐ€๋ฆฌ๋Š” ๋™์•ˆ์—๋งŒ ํ•ด๋‹น ์˜ค๋ธŒ์ ํŠธ๋ฅผ ํˆฌ๋ช…ํ™” ์ฒ˜๋ฆฌํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ์žˆ์Šต๋‹ˆ๋‹ค. ๋ณดํ†ต ํ•ด๋‹น ์˜ค๋ธŒ์ ํŠธ์˜ Material Rendering Mode๋ฅผ Transparent๋กœ ์ฒ˜๋ฆฌํ•˜์—ฌ Albedo์˜ ์•ŒํŒŒ๊ฐ’์„ ์กฐ์ ˆํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.  (์ฐฝ๋ฌธ๊ณผ ๊ฐ™์€ ํˆฌ๋ช… ์˜ค๋ธŒ์ ํŠธ๋ฅผ ๋งŒ๋“ค ๋•Œ ์œ ์šฉํ•œ ๋ฐฉ๋ฒ•์ด์ฃ .)

 

Material ์†์„ฑ
Alpha ๊ฐ’ ์กฐ์ ˆ

 

ํ•˜์ง€๋งŒ ์ œ ๊ฒŒ์ž„์—์„œ ์ด ๋ฐฉ๋ฒ•์„ ์ ์šฉํ•˜๋Š” ๊ฒƒ์—๋Š” ๋ฌด๋ฆฌ๊ฐ€ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

 

 

 


2. LOD๊ฐ€ ์กด์žฌํ•˜๋Š” Material์˜ ํˆฌ๋ช…ํ™” ๋ฌธ์ œ

 

LOD(Level Of Detail)๋Š” ์นด๋ฉ”๋ผ์™€์˜ ๊ฑฐ๋ฆฌ์— ๋”ฐ๋ผ ํ’ˆ์งˆ์„ ๋‹ค๋ฅด๊ฒŒ ์ฒ˜๋ฆฌํ•˜๋Š” ๊ฑธ ๋งํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ๋ฐฐํ‹€๊ทธ๋ผ์šด๋“œ์™€ ๊ฐ™์€ ๊ฒŒ์ž„์—์„œ ๋‚˜์™€ 1km์— ๋–จ์–ด์ ธ ์žˆ๋Š” ์ง‘์„ ์ˆ˜๋งŽ์€ ํด๋ฆฌ๊ณค(Polygon)๋“ค์„ ์‚ฌ์šฉํ•˜์—ฌ ๊ณ ํ€„๋กœ ํ•ด๋†“์„ ํ•„์š”๋Š” ์—†์„ ๊ฒ๋‹ˆ๋‹ค. ๋ฉ€๋ฆฌ ์žˆ์–ด์„œ ์ž˜ ์•ˆ ๋ณด์ผํ…Œ๋‹ˆ๊นŒ์š”. ์•ˆ ๋ณด์ด๋Š” ์ง€์ ๊นŒ์ง€ ๋ฉ€์–ด์กŒ๋‹ค๋ฉด ์•„์˜ˆ Cullingํ•˜๋ฉด ๋˜๊ฒ ์ง€์š”.

 

๊ทธ๋ž˜์„œ ํ•ด๋‹น ์˜ค๋ธŒ์ ํŠธ์— ๋Œ€ํ•ด ๊ฑฐ๋ฆฌ์— ๋”ฐ๋ผ ์‚ฌ์šฉํ•  ํ’ˆ์งˆ๋“ค์„ ๊ทธ๋ฃน์œผ๋กœ ๊ด€๋ฆฌํ•˜๋Š” ๊ฒŒ LOD Group์ž…๋‹ˆ๋‹ค.

 

ํ‰๊ท ์ ์ธ ์‹œ์•ผ ๋‚ด์—์„œ์˜ ๊ธฐ๋‘ฅ ์˜ค๋ธŒ์ ํŠธ
์–ด๋Š์ •๋„ ์‹œ์•ผ์—์„œ ๋งŽ์ด ๋ฉ€์–ด์กŒ์„ ๊ฒฝ์šฐ
๊ฝค๋‚˜ ๋ฉ€๋ฆฌ๊นŒ์ง€ ์‹œ์•ผ์—์„œ ๋ฒ—์–ด๋‚œ ๊ฒฝ์šฐ

 

์‹œ์•ผ ๊ฑฐ๋ฆฌ์— ๋”ฐ๋ผ ๊ธฐ๋‘ฅ ์˜ค๋ธŒ์ ํŠธ์˜ ํ’ˆ์งˆ์ด ๋‹ค์†Œ ๋ณ€ํ•˜๋Š” ๊ฑธ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ ์ตœ์ ํ™”๋ฅผ ํ•ด์ฃผ๋Š” ๊ฒƒ์ด์ฃ . ๋‹ค๋งŒ, ์—ฌ๋Ÿฌ ๊ฐœ์˜ ๋ฉ”์‹œ(Mesh)๋“ค์„ ๊ทธ๋ฃน์œผ๋กœ ๊ด€๋ฆฌํ•˜๊ธฐ์— ์œ„์—์„œ ์ ์šฉํ•œ ํˆฌ๋ช…ํ™” ๋ฐฉ๋ฒ•์„ ์‚ฌ์šฉํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํˆฌ๋ช…ํ™”๊ฐ€ ๋˜๊ณค ํ–ˆ์Šต๋‹ˆ๋‹ค.

 

ํˆฌ๋ช…์ธ๊ฐ„์ด๊ธด ํ•œ๋ฐ,, ํ”ผ๋ถ€๋งŒ ํˆฌ๋ช…ํ•˜๊ณ  ๋‚ด์žฅ์€ ๋ณด์ด๋Š” ๊ทธ๋Ÿฐ ๋Š๋‚Œ?,,,

 

์ ˆ๋งํ–ˆ์Šต๋‹ˆ๋‹ค. ๋ชจ๋ฅด๊ฒ ์–ด์„œ ๊ตฌ๊ธ€๋ง๋„ ์—ด์‹ฌํžˆ ํ•ด๋ณด๊ณ  ํ–ˆ๋”๋‹ˆ 2์‹œ๊ฐ„์ด ํ›Œ์ฉ ์ง€๋‚ฌ๋”๊ตฐ์š”. ๊ทธ๋Ÿฌ๋‹ค๊ฐ€ ๋Ÿฐํƒ€์ž„ ์ค‘์— Material์˜ Rendering Mode๋ฅผ ๋ณ€๊ฒฝํ•˜๋Š” ์•„์ด๋””์–ด๋ฅผ ๋ฐœ๊ฒฌํ•  ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

 

(์†”์งํžˆ, Material์˜ ๋‚ด๋ถ€ ํ”„๋กœํผํ‹ฐ๊นŒ์ง€ ๋‹ค ์‚ดํŽด๋ณธ ๊ฒƒ์ด ์•„๋‹ˆ์—ˆ๊ธฐ์— ์ฝ”๋“œ์˜ ์ •ํ™•ํ•œ ๋™์ž‘ ์›๋ฆฌ๋Š” ์„ค๋ช…ํ•˜์ง€ ๋ชปํ•ฉ๋‹ˆ๋‹ค..)

 

 

 


โ˜‘๏ธ๋ฌธ์ œ ํ•ด๊ฒฐ ์‹œ์ž‘ํ•˜๊ธฐ

 

1. "TransparentObject" ์Šคํฌ๋ฆฝํŠธ ์ž‘์„ฑํ•˜๊ธฐ

 

์šฐ์„  ์•Œ๊ณ ๋ฆฌ์ฆ˜ ์•„์ด๋””์–ด๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

 

  • ์บ๋ฆญํ„ฐ์™€ ์นด๋ฉ”๋ผ ์‚ฌ์ด์— ์บ๋ฆญํ„ฐ๋ฅผ ๊ฐ€๋ฆฌ๋Š” ์˜ค๋ธŒ์ ํŠธ๋ฅผ ๊ฒ€์‚ฌํ•œ๋‹ค.
  • ํ•ด๋‹น ์˜ค๋ธŒ์ ํŠธ์˜ Material Rendering Mode๋ฅผ "Fade"๋กœ ๋ณ€๊ฒฝ, Source๋ฅผ "Albedo alpha", Albedo alpha ๊ฐ’์„ ์ฒœ์ฒœํžˆ ๋‚ด๋ฆฐ๋‹ค. ์•ŒํŒŒ ๊ฐ’์„ ๋‹ค ๋‚ด๋ ธ๋‹ค๋ฉด, ํƒ€์ด๋จธ๋ฅผ ๋™์ž‘ํ•œ๋‹ค.
  • ์˜ค๋ธŒ์ ํŠธ๊ฐ€ ํˆฌ๋ช…ํ™”๊ฐ€ ์ง„ํ–‰์ด ๋‹ค ๋˜์—ˆ๋Š”๋ฐ๋„ ์บ๋ฆญํ„ฐ๋ฅผ ๊ฐ€๋ฆฌ๊ณ  ์žˆ๋‹ค๋ฉด, ํƒ€์ด๋จธ๋ฅผ ๊ณ„์† ์ดˆ๊ธฐํ™”ํ•œ๋‹ค.
  • ์•„๋‹ˆ๋ผ๋ฉด, ์ง€์ •ํ•œ ์‹œ๊ฐ„์ด ๋‹ค ๊ฒฝ๊ณผ๋˜์—ˆ์„ ๊ฒฝ์šฐ, ๋‹ค์‹œ Resetํ•œ๋‹ค.

 

 

์ œ๊ฐ€ ๊ตฌ๋งคํ•œ ์—์…‹๋“ค์€ ์ž์‹ ์˜ค๋ธŒ์ ํŠธ๋“ค์—๊ฒŒ MeshRenderer๊ฐ€ ๋‹ค ๋ถ™์–ด ์žˆ์–ด์„œ, GetComponentsInChildern()์„ ์ด์šฉํ–ˆ์Šต๋‹ˆ๋‹ค. ์†Œ์Šค์ฝ”๋“œ๋Š” ์•„๋ž˜์— ๋”๋ณด๊ธฐ๋ฅผ ๋ˆ„๋ฅด๋ฉด ์žˆ์Šต๋‹ˆ๋‹ค.

๋”๋ณด๊ธฐ
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TransparentObject : MonoBehaviour
{
    public bool IsTransparent { get; private set; } = false;

    private MeshRenderer[] renderers;
    private WaitForSeconds delay = new WaitForSeconds(0.001f);
    private WaitForSeconds resetDelay = new WaitForSeconds(0.005f);
    private const float THRESHOLD_ALPHA = 0.25f;
    private const float THRESHOLD_MAX_TIMER = 0.5f;

    private bool isReseting = false;
    private float timer = 0f;
    private Coroutine timeCheckCoroutine;
    private Coroutine resetCoroutine;
    private Coroutine becomeTransparentCoroutine;


    void Awake()
    {
        renderers = GetComponentsInChildren<MeshRenderer>();
    }

    public void BecomeTransparent()
   {
        if (IsTransparent)
        {
            timer = 0f;
            return;
        }

        if (resetCoroutine != null && isReseting)
        {
            isReseting = false;
            IsTransparent = false;
            StopCoroutine(resetCoroutine);
        }

        SetMaterialTransparent();
        IsTransparent = true;
        becomeTransparentCoroutine = StartCoroutine(BecomeTransparentCoroutine());
    }


    #region #Run-time ์ค‘์— RenderingMode ๋ฐ”๊พธ๋Š” ๋ฉ”์†Œ๋“œ๋“ค
    /// Runtime ์ค‘์— RenderingMode๋ฅผ ๋ฐ”๊พธ๋Š” ๋ฐฉ๋ฒ•์„ ์ฐพ์•„๋ณด๋‹ˆ, ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์ฝ”๋“œ๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค๊ณ  ํ•จ. <summary>
    // 0 = Opaque, 1 = Cutout, 2 = Fade, 3 = Transparent
    private void SetMaterialRenderingMode(Material material, float mode, int renderQueue)
    {
        material.SetFloat("_Mode", mode);      
        material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha);
        material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha);
        material.SetInt("ZWrite", 0);
        material.DisableKeyword("_ALPHATEST_ON");
        material.EnableKeyword("_ALPHABLEND_ON");
        material.DisableKeyword("_ALPHAPREMULTIPLY_ON");
        material.renderQueue = renderQueue;
    }
    
    private void SetMaterialTransparent()
    {
        for(int i = 0; i< renderers.Length; i++)
        {
            foreach(Material material in renderers[i].materials)
            {
                SetMaterialRenderingMode(material, 3f, 3000);
            }
        }
    }

    private void SetMaterialOpaque()
    {
        for (int i = 0; i < renderers.Length; i++)
        {
            foreach (Material material in renderers[i].materials)
            {
                SetMaterialRenderingMode(material, 0f, -1);
            }
        }
    }
    #endregion

    public void ResetOriginalTransparent()
    {
        SetMaterialOpaque();
        resetCoroutine = StartCoroutine(ResetOriginalTransparentCoroutine());
    }

    private IEnumerator BecomeTransparentCoroutine()
    {
        while (true)
        {
            bool isComplete = true;

            for(int i =0; i< renderers.Length; i++)
            {
                if (renderers[i].material.color.a > THRESHOLD_ALPHA)
                    isComplete = false;

                Color color = renderers[i].material.color;
                color.a -= Time.deltaTime;
                renderers[i].material.color = color;
            }

            if (isComplete)
            {
                CheckTimer();
                break;
            }

            yield return delay;
        }
    }

    private IEnumerator ResetOriginalTransparentCoroutine()
    {
        IsTransparent = false;

        while (true)
        {
            bool isComplete = true;

            for (int i = 0; i < renderers.Length; i++)
            {
                if (renderers[i].material.color.a < 1f)
                    isComplete = false;

                Color color = renderers[i].material.color;
                color.a += Time.deltaTime;
                renderers[i].material.color = color;
            }

            if (isComplete)
            {
                isReseting = false;
                break;
            }

            yield return resetDelay;
        }
    }

    public void CheckTimer()
    {
        if (timeCheckCoroutine != null)
            StopCoroutine(timeCheckCoroutine);
        timeCheckCoroutine = StartCoroutine(CheckTimerCouroutine());
    }

    private IEnumerator CheckTimerCouroutine()
    {
        timer = 0f;

        while (true)
        {
            timer += Time.deltaTime;

            if(timer > THRESHOLD_MAX_TIMER)
            {
                isReseting = true;
                ResetOriginalTransparent();
                break;
            }

            yield return null;
        }
    }
}

 

์ด๋ ‡๊ฒŒ ์†Œ์Šค์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๊ณ , ํˆฌ๋ช…ํ™” ์ฒ˜๋ฆฌ๊ฐ€ ๋˜๊ธธ ์›ํ•˜๋Š” ์˜ค๋ธŒ์ ํŠธ์— ๋ถ™์ด๊ณ , Layer๋ฅผ EnvironmentObject๋กœ ๋ณ€๊ฒฝํ•˜์—ฌ ์ค๋‹ˆ๋‹ค.

 

 

 

2. ์นด๋ฉ”๋ผ์—์„œ ํ”Œ๋ ˆ์ด์–ด ์บ๋ฆญํ„ฐ๋ฅผ ๊ฐ€๋ฆฌ๋Š” ์˜ค๋ธŒ์ ํŠธ ํƒ์ง€ํ•˜๊ธฐ

 

์˜ค๋ธŒ์ ํŠธ๊ฐ€ ๋ช‡ ๊ฐœ ๊ฒน์ณ์„œ ๊ฐ€๋ฆด ์ˆ˜๋„ ์žˆ์œผ๋ฏ€๋กœ, RaycastAll()์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ชจ๋‘ ํƒ์ง€ํ•˜๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.

// Camera script

void LateUpdate()
{
    // Player๋Š” ์‹ฑ๊ธ€ํ†ค์ด๊ธฐ์— ์ „์—ญ์ ์œผ๋กœ ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
    Vector3 direction = (Player.Instance.transform.position - transform.position).normalized;
    RaycastHit[] hits = Physics.RaycastAll(transform.position, direction, Mathf.Infinity,
                        1 << LayerMask.NameToLayer("EnvironmentObject"));

    for (int i = 0; i < hits.Length; i++)
    {
      TransparentObject[] obj = hits[i].transform.GetComponentsInChildren<TransparentObject>();

        for (int j = 0; j < obj.Length; j++)
        {
            obj[j]?.BecomeTransparent();
        }
    }
}

 

์—ฌ๊ธฐ์„œ๋„ GetComponentsInChildren()์„ ์ด์šฉํ•˜์—ฌ TransparentObject ์Šคํฌ๋ฆฝํŠธ๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” ์ด์œ ๋Š” ๋นˆ ์˜ค๋ธŒ์ ํŠธ์— ์ž์‹์œผ๋กœ ๋ฌถ์–ด์„œ ์˜ค๋ธŒ์ ํŠธ๋“ค์„ ๊ด€๋ฆฌํ•˜๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

 

 

์œ„์—์„œ ๋ณด์—ฌ๋“œ๋ฆฐ ๊ธฐ๋‘ฅ ์˜ค๋ธŒ์ ํŠธ๋Š” ddi_pillar_01์ด๋ฉฐ, ์ด๊ฒƒ์€ Obejcts๋ผ๋Š” ๋นˆ ์˜ค๋ธŒ์ ํŠธ์˜ ์ž์‹์—์„œ ๊ด€๋ฆฌ๋˜๊ณ  ์žˆ์Œ์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์•„๋ฌดํŠผ, ์ด๋ ‡๊ฒŒ ํ•˜๊ณ  ๋‚˜๋ฉด ํˆฌ๋ช…ํ™”๊ฐ€ ์ž˜ ์ฒ˜๋ฆฌ๋˜๋Š” ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

 

 


๊ฒฐ๊ณผ

 

์ด์ œ ๋ฒฝ์ด๋‚˜ ์˜ค๋ธŒ์ ํŠธ๊ฐ€ ์บ๋ฆญํ„ฐ๋ฅผ ๊ฐ€๋ ค์„œ ๋ชฌ์Šคํ„ฐ์™€ ์‹ธ์šฐ๋Š”๋ฐ ๋ถˆํŽธํ•จ์ด ์—†์–ด์กŒ์Šต๋‹ˆ๋‹ค.

 

ํˆฌ๋ช…ํ™” ์ ์šฉ์ด ์™„๋ฃŒ๋œ ๋ชจ์Šต

 

 

728x90
๋ฐ˜์‘ํ˜•