public void ChangeStage() { to.Active(); PlayManager.Instance.Player.transform.position = new Vector3(toPotal.spawnPoint.x, toPotal.spawnPoint.y, PlayManager.Instance.Player.transform.position.z); PlayManager.Instance.Player.transform.SetParent(to.transform.Find("Objects")); CurStage = to; if (from != null && from != to) { from.DeActive(); } ChangeBgm(to.name); Debug.Log("Stage : " + CurStage.gameObject.name); }
public void ChangeStage(Stage _from, string toStr, Vector2 pos) { Stage _to = GameObject.Find("Map").transform.Find(toStr).GetComponent <Stage>(); _to.Active(); PlayManager.Instance.Player.transform.position = new Vector3(pos.x, pos.y, PlayManager.Instance.Player.transform.position.z); PlayManager.Instance.Player.transform.SetParent(_to.transform.Find("Objects")); CurStage = _to; if (_from != null && _from != _to) { _from.DeActive(); } ChangeBgm(toStr); Debug.Log("Stage : " + CurStage.gameObject.name); }