public void OnPointerDown(PointerEventData eventData) { getInfoGameObject = eventData.pointerEnter; if (getInfoGameObject.gameObject.name == "Note2") { note2ObjPull.ReturnObject(getInfoGameObject); bossMusic.DecreaseRefectionTime(0.25f); } else { return; } }
public void OnPointerDown(PointerEventData eventData) { getInfoGameObject = eventData.pointerEnter; if (getInfoGameObject.gameObject.name == "Note2") { SoundManager.instance.PlayTouchMusicNoteSound(); note2ObjPull.ReturnObject(getInfoGameObject); bossMusic.DecreaseRefectionTime(0.25f); } else { return; } }
public void CreateNote() { SoundManager.instance.PlayTouchMusicNoteSound(); noteObjPull.ReturnObject(gameObject); bossMusic.DecreaseRefectionTime(0.5f); note2ObjectPool = GameObject.Find("Note2Pool").GetComponent <SimpleObjectPool>(); note2_Left = note2ObjectPool.GetObject(); note2_Left.name = "Note2"; note2_Left.transform.SetParent(parentTransform, false); note2_Left.transform.localScale = Vector3.one; note2_Left.transform.position = new Vector3(gameObject.transform.position.x - 40f, gameObject.transform.position.y, gameObject.transform.position.z); //예외 처리 //left if (note2_Left.transform.position.x <= -310.0f) { note2_Left.transform.position = parentTransform.transform.position; } //bottom else if (note2_Left.transform.position.y <= -500.0f) { note2_Left.transform.position = parentTransform.transform.position; } //right else if (note2_Left.transform.position.x >= 308.0f) { note2_Left.transform.position = parentTransform.transform.position; } else if (note2_Left.transform.position.y >= 534.0f) { note2_Left.transform.position = parentTransform.transform.position; } note2Obj = note2_Left.GetComponent <Note2Object> (); note2Obj.note2ObjPull = note2ObjectPool; note2Obj.parentTransform = parentTransform; note2Obj.repairObj = repairObj; note2Obj.StartNoteObjMove(); note2Obj.bossMusic = bossMusic; note2_Right = note2ObjectPool.GetObject(); note2_Right.name = "Note2"; note2_Right.transform.SetParent(parentTransform, false); note2_Right.transform.localScale = Vector3.one; note2_Right.transform.position = new Vector3(gameObject.transform.position.x + 40f, gameObject.transform.position.y, gameObject.transform.position.z); //예외 처리 //left if (note2_Right.transform.position.x <= -310.0f) { note2_Right.transform.position = parentTransform.transform.position; } //bottom else if (note2_Right.transform.position.y <= -490.0f) { note2_Right.transform.position = parentTransform.transform.position; } //right else if (note2_Right.transform.position.x >= 308.0f) { note2_Right.transform.position = parentTransform.transform.position; } else if (note2_Right.transform.position.y >= 524.0f) { note2_Right.transform.position = parentTransform.transform.position; } note2Obj = note2_Right.GetComponent <Note2Object> (); note2Obj.note2ObjPull = note2ObjectPool; note2Obj.parentTransform = parentTransform; note2Obj.repairObj = repairObj; note2Obj.StartNoteObjMove(); note2Obj.bossMusic = bossMusic; bossMusic.IncreaseRefectionTime(0.5f); bossMusic.nNoteCount--; }