맥을 사용하게 기존에 사용하던 tortoise svn과 호환이 되지 않아

versions등 여러가지를 찾아보다가

snailSVN을 찾게 되어 lite가 아닌 유료버전을 설치하였다.

사용방법에 대해 자세히 설명해놓은 분의 글이 있어서 포스팅한다.

 

 

 

 

 

https://orbit-orbit.tistory.com/entry/Mac-%EB%A7%A5-%EC%9A%A9-SVN-

%EC%97%B0%EA%B2%B0%ED%95%98%EA%B8%B0-SnailSVN-Lite

 

[Mac] 맥 용 SVN 연결하기 : SnailSVN Lite

회사 업무로 인해 Mac에서 SVN을 사용하게 되었으므로 SnailSVN Lite를 활용하게 되었다. Mac의 SnailSVN은 window의 tortoiseSVN과 비슷하다고 하지만, 사용해 본 적이 없어서 모름. 우선 App Store에서 SnailSVN Lit

orbit-orbit.tistory.com

 

'Study > ' 카테고리의 다른 글

[Tip] 텍스트 코루틴 애니메이션  (0) 2024.07.16
[Tip]룰렛 원하는 곳에 위치 + 텍스트 출력  (0) 2024.06.29
[Tip] Mathf.DeltaAngle  (0) 2024.06.29
[Tip] Object.FindObjectOfType  (0) 2024.06.11
[Tip] RenderSettings  (0) 2024.06.05

 

 

 

 

 

 

IEnumerator CoTextFlow(string text)
{
    dialogText.text = "";
    string str = null;
    int length = 0;
    bool isScriptEnd = false;
    while (!isScriptEnd)
    {
        foreach (char ch in text)
        {
            str = str + ch;
            yield return new WaitForSeconds(0.035f);
            dialogText.text = str;
        }
        isScriptEnd = true;
    }
}

'Study > ' 카테고리의 다른 글

[Tip] 맥 SVN 설치 - snailSVN  (0) 2024.07.21
[Tip]룰렛 원하는 곳에 위치 + 텍스트 출력  (0) 2024.06.29
[Tip] Mathf.DeltaAngle  (0) 2024.06.29
[Tip] Object.FindObjectOfType  (0) 2024.06.11
[Tip] RenderSettings  (0) 2024.06.05

현재 룰렛은 8등분이 되어 있고

각각 360 / 8인 45도로 구성되어 있다.

그러므로 이 가운데 값은 22.5도이다.

룰렛을 개발자가 편하게 컨트롤 할 수 있도록 만들었다.

 

360도 * 횟수를 적용하여 여러번 돌아가고 거기에 지정한 extraAngle을 더해주면된다.

 

회전횟수를 선택할 수 있고 스탭을 조절함으로서 속도를 조절할 수 있다.

 

 

아래는 개발자들은 이미 사전에 클릭을 하면 알 수 있게 항목을 출력하도록 변경

나오는 것은 랜덤으로 변경

즉, 랜덤에 따라 특정 각도가 결정되고 그에 따라 개발자들은 출력결과를 미리 알수 있고,

유저들은 원하는 각도를 보게 되는 것이다.

 

using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using UnityEngine;
using UnityEngine.UI;

public class RouletteTest : MonoBehaviour
{
    [SerializeField] private Button btnGetIem;
    [SerializeField] private Roulette _roulette;
    //[SerializeField] private float targetAngle = -22.5f; //클로버를 겨냥

    private string[] itemNames = { "폭탄" , "기력회복", "폭탄", "체력회복", "폭탄", "금화획득","폭탄", "네잎클로버"};
    private float[] targetAngles =
    {
        22.5f, 67.5f, 112.5f, 157.5f, 202.5f, 247.5f, 292.5f, 337.5f
    };
    void Start()
    {
        btnGetIem.onClick.AddListener(() =>
        {
            int idx = UnityEngine.Random.Range(0, 8); // 0 ~ 7
            Debug.Log($"<color=yellow>{itemNames[idx]}</color>");
            _roulette.StartRotate(targetAngles[idx]);
        });
    }

}

 

using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using UnityEngine;
using UnityEngine.UI;

public class RouletteTest : MonoBehaviour
{
    [SerializeField] private Button btnGetIem;
    [SerializeField] private Roulette _roulette;
    //[SerializeField] private float targetAngle = -22.5f; //클로버를 겨냥

    private string[] itemNames = { "폭탄" , "기력회복", "폭탄", "체력회복", "폭탄", "금화획득","폭탄", "네잎클로버"};
    private float[] targetAngles =
    {
        22.5f, 67.5f, 112.5f, 157.5f, 202.5f, 247.5f, 292.5f, 337.5f
    };
    void Start()
    {
        btnGetIem.onClick.AddListener(() =>
        {
            int idx = UnityEngine.Random.Range(0, 8); // 0 ~ 7
            Debug.Log($"<color=yellow>{itemNames[idx]}</color>");
            _roulette.StartRotate(targetAngles[idx]);
        });
    }

}

'Study > ' 카테고리의 다른 글

[Tip] 맥 SVN 설치 - snailSVN  (0) 2024.07.21
[Tip] 텍스트 코루틴 애니메이션  (0) 2024.07.16
[Tip] Mathf.DeltaAngle  (0) 2024.06.29
[Tip] Object.FindObjectOfType  (0) 2024.06.11
[Tip] RenderSettings  (0) 2024.06.05

https://docs.unity3d.com/ScriptReference/Mathf.DeltaAngle.html

 

Unity - Scripting API: Mathf.DeltaAngle

Success! Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable. Close

docs.unity3d.com

'Study > ' 카테고리의 다른 글

[Tip] 텍스트 코루틴 애니메이션  (0) 2024.07.16
[Tip]룰렛 원하는 곳에 위치 + 텍스트 출력  (0) 2024.06.29
[Tip] Object.FindObjectOfType  (0) 2024.06.11
[Tip] RenderSettings  (0) 2024.06.05
[팁] Slider.onValueChanged  (0) 2024.06.05

https://docs.unity3d.com/ScriptReference/Object.FindObjectOfType.html

 

Unity - Scripting API: Object.FindObjectOfType

Object.FindObjectOfType will not return Assets (meshes, textures, prefabs, ...) or inactive objects. It will not return an object that has HideFlags.DontSave set. Please note that this function is very slow. It is not recommended to use this function every

docs.unity3d.com

'Study > ' 카테고리의 다른 글

[Tip]룰렛 원하는 곳에 위치 + 텍스트 출력  (0) 2024.06.29
[Tip] Mathf.DeltaAngle  (0) 2024.06.29
[Tip] RenderSettings  (0) 2024.06.05
[팁] Slider.onValueChanged  (0) 2024.06.05
[Tip] 3D 프로젝트에서 SpriteAtals 패킹하는 법  (0) 2024.05.23

아래의 api document를 활용하여 각각의 프로티에 대한 정보를 얻을 수 있다.

 

 

https://docs.unity3d.com/ScriptReference/RenderSettings.html

 

Unity - Scripting API: RenderSettings

Success! Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable. Close

docs.unity3d.com

 

 

아래의 사진은 ambientLight라는 속성의 예시이다.

'Study > ' 카테고리의 다른 글

[Tip] Mathf.DeltaAngle  (0) 2024.06.29
[Tip] Object.FindObjectOfType  (0) 2024.06.11
[팁] Slider.onValueChanged  (0) 2024.06.05
[Tip] 3D 프로젝트에서 SpriteAtals 패킹하는 법  (0) 2024.05.23
[Tip] 패키지에서 프리팹찾기  (0) 2024.04.18

https://docs.unity3d.com/560/Documentation/ScriptReference/UI.Slider-onValueChanged.html

 

Unity - Scripting API: UI.Slider.onValueChanged

Success! Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable. Close

docs.unity3d.com

 

'Study > ' 카테고리의 다른 글

[Tip] Object.FindObjectOfType  (0) 2024.06.11
[Tip] RenderSettings  (0) 2024.06.05
[Tip] 3D 프로젝트에서 SpriteAtals 패킹하는 법  (0) 2024.05.23
[Tip] 패키지에서 프리팹찾기  (0) 2024.04.18
[Tip] CameraShaker  (0) 2024.03.29

 

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

public class CardData
{
    public int id;
    public string name;
    public string sprite_name;
}

 

 

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

public class CardInfo
{
    public int id;

    public CardInfo(int id)
    {
        this.id = id;
    }
}

 

 

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

public class Card : MonoBehaviour
{
    private CardInfo cardInfo;

    [SerializeField] private SpriteRenderer spriteRenderer;

    public void SetCardInfo(CardInfo cardInfo)
    {
        this.cardInfo = cardInfo;
    }

    public void SetSprite(Sprite sp)
    {
        spriteRenderer.sprite = sp;
    }
}

 

using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.U2D;

public class Main : MonoBehaviour
{
    [SerializeField] private GameObject cardPrefab;
    [SerializeField] private SpriteAtlas cardAtlas;

    void Start()
    {
        TextAsset ts = Resources.Load<TextAsset>("Data/card_data");
        string json = ts.text;
        Debug.Log(json);

        Dictionary<int, CardData> dicCardDatas = JsonConvert.DeserializeObject<List<CardData>>(json).ToDictionary(x => x.id);

        GameObject cardGo = Instantiate(cardPrefab);
        Card card = cardGo.GetComponent<Card>(); //생성된 프리팹에
        CardInfo cardInfo = new CardInfo(100);

        card.SetCardInfo(cardInfo);
        CardData cardData = dicCardDatas[101];
        Sprite sp = cardAtlas.GetSprite(cardData.sprite_name);
        card.SetSprite(sp);
        

    }

}

'Study > ' 카테고리의 다른 글

[Tip] Object.FindObjectOfType  (0) 2024.06.11
[Tip] RenderSettings  (0) 2024.06.05
[팁] Slider.onValueChanged  (0) 2024.06.05
[Tip] 패키지에서 프리팹찾기  (0) 2024.04.18
[Tip] CameraShaker  (0) 2024.03.29

Ctrl + K 혹은

 

 

 

 


 

 

 

 

 

 

'Study > ' 카테고리의 다른 글

[Tip] Object.FindObjectOfType  (0) 2024.06.11
[Tip] RenderSettings  (0) 2024.06.05
[팁] Slider.onValueChanged  (0) 2024.06.05
[Tip] 3D 프로젝트에서 SpriteAtals 패킹하는 법  (0) 2024.05.23
[Tip] CameraShaker  (0) 2024.03.29

Simple camera shake effect for Unity3d, written in C#. Attach to your camera GameObject. To shake the camera, set shakeDuration to the number of seconds it should shake for. It will start shaking if it is enabled.

 

카메라의 Transform을 Public으로 설정하여

인스펙터에서 메인카메라를 할당한다면

메인카메라로 보는 오브젝트들의 흔들림을 조정할 수 있습니다.

Shake Duration : 지속 시간

Shake Amount : 흔들림 강도

Decrease Factor : 흘러가는 시간을 조정(Shake Duration 수치 조정)

팀 프로젝트를 하며 적용을 한 장면입니다.

 

using UnityEngine;
using System.Collections;

public class CameraShake : MonoBehaviour
{
	// Transform of the camera to shake. Grabs the gameObject's transform
	// if null.
	public Transform camTransform;
	
	// How long the object should shake for.
	public float shakeDuration = 0f;
	
	// Amplitude of the shake. A larger value shakes the camera harder.
	public float shakeAmount = 0.7f;
	public float decreaseFactor = 1.0f;
	
	Vector3 originalPos;
	
	void Awake()
	{
		if (camTransform == null)
		{
			camTransform = GetComponent(typeof(Transform)) as Transform;
		}
	}
	
	void OnEnable()
	{
		originalPos = camTransform.localPosition;
	}

	void Update()
	{
		if (shakeDuration > 0)
		{
			camTransform.localPosition = originalPos + Random.insideUnitSphere * shakeAmount;
			
			shakeDuration -= Time.deltaTime * decreaseFactor;
		}
		else
		{
			shakeDuration = 0f;
			camTransform.localPosition = originalPos;
		}
	}
}

 

 

https://gist.github.com/ftvs/5822103

 

Simple camera shake effect for Unity3d, written in C#. Attach to your camera GameObject. To shake the camera, set shakeDuration

Simple camera shake effect for Unity3d, written in C#. Attach to your camera GameObject. To shake the camera, set shakeDuration to the number of seconds it should shake for. It will start shaking i...

gist.github.com

 

 

'Study > ' 카테고리의 다른 글

[Tip] Object.FindObjectOfType  (0) 2024.06.11
[Tip] RenderSettings  (0) 2024.06.05
[팁] Slider.onValueChanged  (0) 2024.06.05
[Tip] 3D 프로젝트에서 SpriteAtals 패킹하는 법  (0) 2024.05.23
[Tip] 패키지에서 프리팹찾기  (0) 2024.04.18

+ Recent posts