Skip to content

Commit

Permalink
mainlobby 집사 메뉴 애니메이션 수정
Browse files Browse the repository at this point in the history
mainlobby UI 스크립트 주석
  • Loading branch information
hongmon1 committed May 3, 2019
1 parent 2a5ee38 commit 6345bed
Show file tree
Hide file tree
Showing 44 changed files with 284 additions and 176 deletions.
40 changes: 12 additions & 28 deletions 2019_1_bridge_game/Assets/GameScenes/Scenes/MainLobbyScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &39947874
RectTransform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -3840,10 +3840,9 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 403705593}
- component: {fileID: 403705591}
- component: {fileID: 403705583}
- component: {fileID: 403705585}
- component: {fileID: 403705584}
- component: {fileID: 403705583}
m_Layer: 12
m_Name: Player
m_TagString: Player
Expand All @@ -3863,6 +3862,14 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3cfa3d6e7f55bc04d905ffa4b66f29b8, type: 3}
m_Name:
m_EditorClassIdentifier:
spriteRenderer: {fileID: 352297476}
spriteTransform: {fileID: 352297475}
animator: {fileID: 0}
interactiveCollider2D: {fileID: 2144365901}
circleCollider2D: {fileID: 0}
hitBox: {fileID: 2083574898}
shadowTransform: {fileID: 352297475}
nickNameText: {fileID: 1641883672}
joystick: {fileID: 1345936830}
MoveSpeed: 5
--- !u!61 &403705584
Expand Down Expand Up @@ -3912,28 +3919,6 @@ Rigidbody2D:
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 4
--- !u!114 &403705591
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 403705582}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 157c7717e3b9df64aad93c9eb754d353, type: 3}
m_Name:
m_EditorClassIdentifier:
spriteRenderer: {fileID: 352297476}
spriteTransform: {fileID: 352297475}
animator: {fileID: 0}
interactiveCollider2D: {fileID: 2144365901}
circleCollider2D: {fileID: 0}
hitBox: {fileID: 2083574898}
shadowTransform: {fileID: 352297475}
nickNameText: {fileID: 1641883672}
dashEffect: {fileID: 0}
emoticon: {fileID: 0}
--- !u!4 &403705593
Transform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -5138,7 +5123,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &510558449
RectTransform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -8457,7 +8442,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: bef27c6babfc6b14083b9aeee4ddf9e5, type: 3}
m_Name:
m_EditorClassIdentifier:
panel: {fileID: 0}
--- !u!1 &810315693
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -17275,7 +17259,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &1464099723
RectTransform:
m_ObjectHideFlags: 0
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,29 @@ public class UIButler : UIControl

private void Start()
{
//초기실행 확인
PlayerPrefs.SetInt("Tutorial_Start", PlayerPrefs.GetInt("Tutorial_Start", 0));
//debug 용
//PlayerPrefs.SetInt("Tutorial_Start", 0);
}

private void OnDisable()
{
butler_img.SetActive(false);
scriptpanel.SetActive(false);
illustrated.SetActive(false);
}
//첫 실행 시 터치 여부 확인
public void touched()
{
transform.parent.GetComponent<Animator>().SetBool("touch", true);
Debug.Log("touched");
}


//UIControl OnShow, OnHide 오버라이드
override
public void OnShow()
{
//debug용
// PlayerPrefs.SetInt("Tutorial_Start", 0);


//첫 실행 시
if (PlayerPrefs.GetInt("Tutorial_Start") == 0)
{
PlayerPrefs.SetInt("Tutorial_Start", 1);
butler_img.SetActive(false);
scriptpanel.SetActive(false);
illustrated.SetActive(false);

Debug.Log("first exe");

transform.parent.GetComponent<Animator>().SetBool("first", true);
if (transform.parent.GetComponent<Animator>() != null)
{
Expand All @@ -57,28 +51,56 @@ public void OnShow()
Debug.Log("show");
gameObject.SetActive(true);
}
transform.parent.GetComponent<Animator>().SetBool("first", false);

}

//첫 실행X
else
{
transform.parent.GetComponent<Animator>().SetBool("first", false);

if (transform.parent.GetComponent<Animator>() != null)
{
transform.parent.GetComponent<Animator>().SetBool("open", true);
Debug.Log("show and animate");

if (transform.GetComponent<Button>() != null)
transform.GetComponent<Button>().interactable = true;
}
else
{
Debug.Log("show");
gameObject.SetActive(true);
}
}


}

override
public void OnHide()
{
//첫실행 이후 도감 종료
if (PlayerPrefs.GetInt("Tutorial_Start") == 0)
{
transform.parent.GetComponent<Animator>().SetBool("first", false);
PlayerPrefs.SetInt("Tutorial_Start", 1);
butler_img2.SetActive(false);
firstscript.SetActive(false);
}

if (transform.parent.GetComponent<Animator>() != null)
{
transform.parent.GetComponent<Animator>().SetBool("open", true);
Debug.Log("show and animate");

transform.parent.GetComponent<Animator>().SetBool("open", false);
Debug.Log("hide and animate");
if (transform.GetComponent<Button>() != null)
transform.GetComponent<Button>().interactable = true;
transform.GetComponent<Button>().interactable = false;

}
else
{
Debug.Log("show");
gameObject.SetActive(true);
Debug.Log("hide");
gameObject.SetActive(false);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
using UnityEngine;
using UnityEngine.UI;

//스킨 도감(옷장)
public class UICloset : UIControl
{
#region variable
[SerializeField] private GameObject skinllBook;
[SerializeField] private Transform scrollRect;
[SerializeField] private SkinBookDetail bookDetail;
Expand All @@ -13,19 +15,25 @@ public class UICloset : UIControl

private List<GameObject> illustratedBook = new List<GameObject>();
private int ch_id;
#endregion

#region Unityfuc
private void OnEnable()
{
Debug.Log("destroy");
//Debug.Log("destroy");
//기존 옷장 파괴 후 새 옷장 로드
DestroySkin();
LoadSkin();
}
private void Update()
{
string name = bookDetail.GetnameText();
//스킨 별로 구매 창 업데이트
bookDetail.GetButton().onClick.AddListener(() => AddListenBuying(name));
}
#endregion

#region fuc
//캐릭터별로 스킨 로드
public void LoadSkin()
{
Expand Down Expand Up @@ -56,12 +64,12 @@ public void LoadSkin()
}

Destroy(skinllBook);
//skinllBook.SetActive(false);
skinllBook = illustratedBook[0];
illustratedBook[0].GetComponent<UnityEngine.UI.Button>().onClick.Invoke();

}

//이전 패널 삭제
private void DestroySkin()
{

Expand All @@ -76,12 +84,13 @@ private void DestroySkin()

}

//스킨 창 정보 업데이트
private void AddListenSkinDetail(Sprite img, string name, string text)
{
bookDetail.SetBookDetail(img, name, text);

}

//구매창 업데이트 및 활성화
private void AddListenBuying( string name)
{
buyingpanel.setBuyingpanel(name);
Expand All @@ -97,5 +106,5 @@ public void SetId(int id)
{
ch_id = id;
}

#endregion
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,20 @@ public class UIDJ : UIControl
private Slider slider;
#endregion variable

#region Unityfuc
private void Start()
{
Initialized();
}
private void Update()
{
//슬라이더 움직이기
/*
if (slider != null)
{
if (audioSource.isPlaying == true)
{
slider.value += Time.deltaTime;
}
else
{
if (slider.maxValue == slider.value)
slider.value = 0;
}
}*/
//음악 슬라이더 움직이기
moveSlider();
}
#endregion

#region fuc
//DJ 패널 초기화
public void Initialized()
{
illustratedBook.Clear();
Expand All @@ -66,7 +57,7 @@ public void Initialized()
tmpIllustrateBook.GetStopBtn().onClick.AddListener(() => AddListenStop(tmpslider));

/*
//구매 여부 확인
if (BackendController.Instance.GetBgmDIct().ContainsKey(name))
{
//구매되지 않은 bgm
Expand All @@ -90,6 +81,7 @@ public void Initialized()
bgmllBook.SetActive(false);
}

//bgm 이름 클릭시 - 구매상태X 일때
private void AddListenBuying(string name)
{
if(audioSource.isPlaying == true)
Expand All @@ -101,7 +93,7 @@ private void AddListenBuying(string name)
buyingpanel.OnShow();
}


//play 버튼 클릭시
private void AddListenPlay(AudioClip bgm, Slider slider)
{

Expand All @@ -119,14 +111,9 @@ private void AddListenPlay(AudioClip bgm, Slider slider)
{
audioSource.UnPause();
}
/*
else if(audioSource.clip == bgm && audioSource.isPlaying == true)
{
audioSource.UnPause();
audioSource.clip = bgm;
audioSource.Play();
}*/
}

//pause 버튼 클릭시
private void AddListenPause(AudioClip bgm)
{
if (audioSource.isPlaying == true)
Expand All @@ -136,7 +123,7 @@ private void AddListenPause(AudioClip bgm)
}
}


//stop 버튼 클릭시
private void AddListenStop(Slider slider)
{
if (audioSource.isPlaying == true)
Expand All @@ -147,6 +134,7 @@ private void AddListenStop(Slider slider)
slider.value = 0;
}

//bgm 변경 - 구매완료 상태일때
private void AddListenSwith(int id, string name)
{
choosepanel.SetItem(name);
Expand All @@ -161,6 +149,7 @@ private void AddListenSwith(int id, string name)
AudioManager.Instance.PlayMusic(id);
}

//bgm-슬라이더 표시
private void moveSlider()
{
if (slider != null)
Expand All @@ -176,5 +165,5 @@ private void moveSlider()
}
}
}

#endregion
}
Loading

0 comments on commit 6345bed

Please sign in to comment.