//생성된 버튼 클릭하면, CurrentRoomCanvas.cs 에 PlayerKick() 로 PhotonPlayer를 넘겨줌 public void ButtonAddListener() { CurrentRoomCanvas currentRoomCanvas = GetComponentInParent <CurrentRoomCanvas>(); playerPrefabButton = transform.Find("KickButton").GetComponent <Button>(); playerPrefabButton.onClick.AddListener(() => currentRoomCanvas.PlayerKick(PhotonPlayer)); }
//생성된 버튼 클릭하면, CurrentRoomCanvas.cs 에 PlayerKick() 로 PhotonPlayer를 넘겨줌 public void ButtonAddListener() { GameObject CurRoomCanvas = GetComponentInParent <CurrentRoomCanvas>().gameObject; CurrentRoomCanvas crCanvas = CurRoomCanvas.GetComponent <CurrentRoomCanvas>(); PlayerPrefabButton = transform.Find("KickButton").GetComponent <Button>(); PlayerPrefabButton.onClick.AddListener(() => crCanvas.PlayerKick(PhotonPlayer)); }