changesparty

This commit is contained in:
Nim-XD 2025-06-07 23:53:54 +05:30
parent 5ade16b0eb
commit d3fd9e9620
24 changed files with 1336 additions and 195 deletions

BIN
.DS_Store vendored

Binary file not shown.

BIN
Assets/.DS_Store vendored

Binary file not shown.

View File

@ -2273,7 +2273,8 @@ MonoBehaviour:
PrimaryWeapon: {fileID: 21300000, guid: 1fde2e89cec53e640997f2e11b658532, type: 3} PrimaryWeapon: {fileID: 21300000, guid: 1fde2e89cec53e640997f2e11b658532, type: 3}
SecondaryWeapon: {fileID: 0} SecondaryWeapon: {fileID: 0}
Cape: {fileID: 0} Cape: {fileID: 0}
Back: {fileID: 0} Quiver: {fileID: 0}
Backpack: {fileID: 0}
Shield: [] Shield: []
Armor: Armor:
- {fileID: 21300040, guid: 932eb8d5023602e45bd0f3d4e1206516, type: 3} - {fileID: 21300040, guid: 932eb8d5023602e45bd0f3d4e1206516, type: 3}
@ -2355,8 +2356,8 @@ MonoBehaviour:
LeggingsRenderers: LeggingsRenderers:
- {fileID: 5460818288070623950} - {fileID: 5460818288070623950}
- {fileID: 7939274065524057377} - {fileID: 7939274065524057377}
CapeRenderer: {fileID: 0} QuiverRenderer: {fileID: 0}
BackRenderer: {fileID: 0} BackpackRenderer: {fileID: 0}
ShieldRenderers: ShieldRenderers:
- {fileID: 2816459151010776475} - {fileID: 2816459151010776475}
BowRenderers: BowRenderers:
@ -2365,7 +2366,7 @@ MonoBehaviour:
- {fileID: 2277310147209446500} - {fileID: 2277310147209446500}
- {fileID: 5449786263906794857} - {fileID: 5449786263906794857}
- {fileID: 4698824689103266890} - {fileID: 4698824689103266890}
FirearmsRenderers: [] CrossbowRenderers: []
MakeupRenderer: {fileID: 5665153843562924393} MakeupRenderer: {fileID: 5665153843562924393}
MaskRenderer: {fileID: 1330441514144925353} MaskRenderer: {fileID: 1330441514144925353}
EarringsRenderers: EarringsRenderers:
@ -2397,6 +2398,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e6dbda98e8614ec8a935809c1a0ace8a, type: 3} m_Script: {fileID: 11500000, guid: e6dbda98e8614ec8a935809c1a0ace8a, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
SortingGroup: {fileID: 2642874521782211868}
Sprites: Sprites:
- {fileID: 3435519960737444863} - {fileID: 3435519960737444863}
- {fileID: 770255024123046226} - {fileID: 770255024123046226}
@ -2433,8 +2435,6 @@ MonoBehaviour:
- {fileID: 1330441514144925353} - {fileID: 1330441514144925353}
- {fileID: 5449786263906794857} - {fileID: 5449786263906794857}
- {fileID: 4698824689103266890} - {fileID: 4698824689103266890}
SortingGroup: {fileID: 2642874521782211868}
SortingOrderStep: 10
CopyTo: {fileID: 0} CopyTo: {fileID: 0}
--- !u!114 &843127271529294997 --- !u!114 &843127271529294997
MonoBehaviour: MonoBehaviour:
@ -4926,6 +4926,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e6dbda98e8614ec8a935809c1a0ace8a, type: 3} m_Script: {fileID: 11500000, guid: e6dbda98e8614ec8a935809c1a0ace8a, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
SortingGroup: {fileID: 2642874521782211868}
Sprites: Sprites:
- {fileID: 6684673773296626903} - {fileID: 6684673773296626903}
- {fileID: 4194971619543077301} - {fileID: 4194971619543077301}
@ -5081,8 +5082,6 @@ MonoBehaviour:
- {fileID: 1330441514144925353} - {fileID: 1330441514144925353}
- {fileID: 5449786263906794857} - {fileID: 5449786263906794857}
- {fileID: 4698824689103266890} - {fileID: 4698824689103266890}
SortingGroup: {fileID: 2642874521782211868}
SortingOrderStep: 10
CopyTo: {fileID: 0} CopyTo: {fileID: 0}
--- !u!95 &8745129960027346450 --- !u!95 &8745129960027346450
Animator: Animator:
@ -6474,7 +6473,8 @@ MonoBehaviour:
PrimaryWeapon: {fileID: 21300000, guid: 1fde2e89cec53e640997f2e11b658532, type: 3} PrimaryWeapon: {fileID: 21300000, guid: 1fde2e89cec53e640997f2e11b658532, type: 3}
SecondaryWeapon: {fileID: 0} SecondaryWeapon: {fileID: 0}
Cape: {fileID: 0} Cape: {fileID: 0}
Back: {fileID: 0} Quiver: {fileID: 0}
Backpack: {fileID: 0}
Shield: [] Shield: []
Armor: Armor:
- {fileID: 21300040, guid: 932eb8d5023602e45bd0f3d4e1206516, type: 3} - {fileID: 21300040, guid: 932eb8d5023602e45bd0f3d4e1206516, type: 3}
@ -6555,8 +6555,8 @@ MonoBehaviour:
LeggingsRenderers: LeggingsRenderers:
- {fileID: 6960788829903527684} - {fileID: 6960788829903527684}
- {fileID: 3231806984399289353} - {fileID: 3231806984399289353}
CapeRenderer: {fileID: 0} QuiverRenderer: {fileID: 0}
BackRenderer: {fileID: 0} BackpackRenderer: {fileID: 0}
ShieldRenderers: ShieldRenderers:
- {fileID: 7311041767872155725} - {fileID: 7311041767872155725}
- {fileID: 6980468645066611400} - {fileID: 6980468645066611400}
@ -6566,7 +6566,7 @@ MonoBehaviour:
- {fileID: 7360430681077632512} - {fileID: 7360430681077632512}
- {fileID: 1364851250167138380} - {fileID: 1364851250167138380}
- {fileID: 3800483606247586909} - {fileID: 3800483606247586909}
FirearmsRenderers: [] CrossbowRenderers: []
MakeupRenderer: {fileID: 3435998627430565249} MakeupRenderer: {fileID: 3435998627430565249}
MaskRenderer: {fileID: 7780066744865994545} MaskRenderer: {fileID: 7780066744865994545}
EarringsRenderers: EarringsRenderers:
@ -6598,6 +6598,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e6dbda98e8614ec8a935809c1a0ace8a, type: 3} m_Script: {fileID: 11500000, guid: e6dbda98e8614ec8a935809c1a0ace8a, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
SortingGroup: {fileID: 2642874521782211868}
Sprites: Sprites:
- {fileID: 6684673773296626903} - {fileID: 6684673773296626903}
- {fileID: 8761156241998211234} - {fileID: 8761156241998211234}
@ -6638,8 +6639,6 @@ MonoBehaviour:
- {fileID: 7311041767872155725} - {fileID: 7311041767872155725}
- {fileID: 6980468645066611400} - {fileID: 6980468645066611400}
- {fileID: 1364851250167138380} - {fileID: 1364851250167138380}
SortingGroup: {fileID: 2642874521782211868}
SortingOrderStep: 10
CopyTo: {fileID: 0} CopyTo: {fileID: 0}
--- !u!114 &7345451240784811756 --- !u!114 &7345451240784811756
MonoBehaviour: MonoBehaviour:
@ -9910,7 +9909,8 @@ MonoBehaviour:
PrimaryWeapon: {fileID: 21300000, guid: 1fde2e89cec53e640997f2e11b658532, type: 3} PrimaryWeapon: {fileID: 21300000, guid: 1fde2e89cec53e640997f2e11b658532, type: 3}
SecondaryWeapon: {fileID: 0} SecondaryWeapon: {fileID: 0}
Cape: {fileID: 0} Cape: {fileID: 0}
Back: {fileID: 0} Quiver: {fileID: 0}
Backpack: {fileID: 0}
Shield: [] Shield: []
Armor: Armor:
- {fileID: 21300040, guid: 932eb8d5023602e45bd0f3d4e1206516, type: 3} - {fileID: 21300040, guid: 932eb8d5023602e45bd0f3d4e1206516, type: 3}
@ -9991,8 +9991,8 @@ MonoBehaviour:
LeggingsRenderers: LeggingsRenderers:
- {fileID: 5182926700030229988} - {fileID: 5182926700030229988}
- {fileID: 582777995261747491} - {fileID: 582777995261747491}
CapeRenderer: {fileID: 0} QuiverRenderer: {fileID: 0}
BackRenderer: {fileID: 0} BackpackRenderer: {fileID: 0}
ShieldRenderers: ShieldRenderers:
- {fileID: 2787766321566281354} - {fileID: 2787766321566281354}
- {fileID: 8597157043698818456} - {fileID: 8597157043698818456}
@ -10002,7 +10002,7 @@ MonoBehaviour:
- {fileID: 4343227825107918571} - {fileID: 4343227825107918571}
- {fileID: 6442799930695964210} - {fileID: 6442799930695964210}
- {fileID: 4208179434356543406} - {fileID: 4208179434356543406}
FirearmsRenderers: [] CrossbowRenderers: []
MakeupRenderer: {fileID: 4518295013249658832} MakeupRenderer: {fileID: 4518295013249658832}
MaskRenderer: {fileID: 1894255218323147008} MaskRenderer: {fileID: 1894255218323147008}
EarringsRenderers: EarringsRenderers:
@ -10034,6 +10034,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e6dbda98e8614ec8a935809c1a0ace8a, type: 3} m_Script: {fileID: 11500000, guid: e6dbda98e8614ec8a935809c1a0ace8a, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
SortingGroup: {fileID: 2642874521782211868}
Sprites: Sprites:
- {fileID: 4208179434356543406} - {fileID: 4208179434356543406}
- {fileID: 3374391492828420216} - {fileID: 3374391492828420216}
@ -10074,8 +10075,6 @@ MonoBehaviour:
- {fileID: 6790471686932509478} - {fileID: 6790471686932509478}
- {fileID: 3908659237553944341} - {fileID: 3908659237553944341}
- {fileID: 6442799930695964210} - {fileID: 6442799930695964210}
SortingGroup: {fileID: 2642874521782211868}
SortingOrderStep: 10
CopyTo: {fileID: 0} CopyTo: {fileID: 0}
--- !u!114 &4726317439633481665 --- !u!114 &4726317439633481665
MonoBehaviour: MonoBehaviour:
@ -12006,7 +12005,8 @@ MonoBehaviour:
PrimaryWeapon: {fileID: 21300000, guid: 1fde2e89cec53e640997f2e11b658532, type: 3} PrimaryWeapon: {fileID: 21300000, guid: 1fde2e89cec53e640997f2e11b658532, type: 3}
SecondaryWeapon: {fileID: 0} SecondaryWeapon: {fileID: 0}
Cape: {fileID: 0} Cape: {fileID: 0}
Back: {fileID: 0} Quiver: {fileID: 0}
Backpack: {fileID: 0}
Shield: [] Shield: []
Armor: Armor:
- {fileID: 21300040, guid: 932eb8d5023602e45bd0f3d4e1206516, type: 3} - {fileID: 21300040, guid: 932eb8d5023602e45bd0f3d4e1206516, type: 3}
@ -12086,8 +12086,8 @@ MonoBehaviour:
LeggingsRenderers: LeggingsRenderers:
- {fileID: 3089589498850820000} - {fileID: 3089589498850820000}
- {fileID: 4240573199286117781} - {fileID: 4240573199286117781}
CapeRenderer: {fileID: 0} QuiverRenderer: {fileID: 0}
BackRenderer: {fileID: 0} BackpackRenderer: {fileID: 0}
ShieldRenderers: ShieldRenderers:
- {fileID: 6484598956806664084} - {fileID: 6484598956806664084}
BowRenderers: BowRenderers:
@ -12096,7 +12096,7 @@ MonoBehaviour:
- {fileID: 6919781975252132588} - {fileID: 6919781975252132588}
- {fileID: 4001757439886918657} - {fileID: 4001757439886918657}
- {fileID: 4540248313070711360} - {fileID: 4540248313070711360}
FirearmsRenderers: [] CrossbowRenderers: []
MakeupRenderer: {fileID: 1300368150109098810} MakeupRenderer: {fileID: 1300368150109098810}
MaskRenderer: {fileID: 1500454596874129539} MaskRenderer: {fileID: 1500454596874129539}
EarringsRenderers: EarringsRenderers:
@ -12128,6 +12128,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e6dbda98e8614ec8a935809c1a0ace8a, type: 3} m_Script: {fileID: 11500000, guid: e6dbda98e8614ec8a935809c1a0ace8a, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
SortingGroup: {fileID: 2642874521782211868}
Sprites: Sprites:
- {fileID: 6909974970348155436} - {fileID: 6909974970348155436}
- {fileID: 3089589498850820000} - {fileID: 3089589498850820000}
@ -12166,8 +12167,6 @@ MonoBehaviour:
- {fileID: 5846372446835895647} - {fileID: 5846372446835895647}
- {fileID: 3808550755457449931} - {fileID: 3808550755457449931}
- {fileID: 1500454596874129539} - {fileID: 1500454596874129539}
SortingGroup: {fileID: 2642874521782211868}
SortingOrderStep: 10
CopyTo: {fileID: 0} CopyTo: {fileID: 0}
--- !u!114 &2326834231955293773 --- !u!114 &2326834231955293773
MonoBehaviour: MonoBehaviour:

File diff suppressed because it is too large Load Diff

View File

@ -46,6 +46,7 @@ public class FarmingManager : NetworkBehaviour
} }
} }
public void Spawn(int index){ public void Spawn(int index){
FarmingPositionEntry item = farmingItems[index]; FarmingPositionEntry item = farmingItems[index];
GameObject spawn = Instantiate(item.prefab , item.spawnLocation.position , Quaternion.identity); GameObject spawn = Instantiate(item.prefab , item.spawnLocation.position , Quaternion.identity);
@ -95,7 +96,6 @@ public class FarmingPositionEntry{
} }
[System.Serializable] [System.Serializable]
public class FarmingSpawnPoints{ public class FarmingSpawnPoints{
public Transform pointsParent; public Transform pointsParent;

View File

@ -32,4 +32,6 @@ public class cameraRPG : MonoBehaviour
public void Teleport(Vector3 newLocation){ public void Teleport(Vector3 newLocation){
transform.position = newLocation - offset; transform.position = newLocation - offset;
} }
} }

View File

@ -0,0 +1,151 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
using Mirror;
using TMPro;
public class invitePlayer : NetworkBehaviour
{
[Header("UI References")]
[SerializeField] private GameObject inviteUI, beingInviteUI;
[SerializeField] private GameObject inPartyUI;
[SerializeField] private TMP_Text inPartyOwnerNameTxt;
[SerializeField] private TMP_Text inPartyPlayersTxt;
[SerializeField] private TMP_Text inviteOwnerNameTxt;
[SerializeField] private CanvasGroup uiCanvasGroup, bUiCanvasGroup;
[SerializeField] private RectTransform uiRectTransform, panelRect;
[Header("Animation Settings")]
[SerializeField] private float appearDuration = 0.3f;
[SerializeField] private float disappearDuration = 0.2f;
[SerializeField] private Ease appearEase = Ease.OutBack;
[SerializeField] private Ease disappearEase = Ease.InBack;
[SerializeField] private Vector2 offScreenPosition = new Vector2(1200, -140);
[SerializeField] private Vector2 onScreenPosition = new Vector2(1300, -140);
private void Start()
{
uiRectTransform.localScale = Vector3.zero;
uiCanvasGroup.alpha = 0;
inviteUI.SetActive(false);
beingInviteUI.SetActive(false);
onScreenPosition = panelRect.anchoredPosition;
offScreenPosition = new Vector2(
+Screen.width, // Use screen width for consistent off-screen positioning
onScreenPosition.y
);
panelRect.anchoredPosition = offScreenPosition;
}
void Update()
{
if (Input.GetKeyDown(KeyCode.L))
{
ShowInvite("keyBoard");
}
}
private void OnMouseDown() //clicking on collider
{
ShowInviteUI();
}
public void ShowInviteUI()
{
inviteUI.SetActive(true);
uiCanvasGroup.alpha = 0;
uiRectTransform.localScale = Vector3.zero;
Sequence showSequence = DOTween.Sequence();
showSequence.Append(uiRectTransform.DOScale(1, appearDuration).SetEase(appearEase))
.Join(uiCanvasGroup.DOFade(1, appearDuration))
.SetUpdate(true);
Camera.main.DOShakePosition(0.2f, 0.1f, 1, 90f, false);
}
public void CloseInviteUI()
{
Sequence hideSequence = DOTween.Sequence();
hideSequence.Append(uiRectTransform.DOScale(0, disappearDuration).SetEase(disappearEase))
.Join(uiCanvasGroup.DOFade(0, disappearDuration))
.OnComplete(() => inviteUI.SetActive(false));
}
public void InvitePlayer()
{
string thisPlayerName = GetComponent<playerNetwork>().playerName;
playerNetwork.localPlayer.CmdInvitePlayer(thisPlayerName);
HidePanel();
}
public string InviteOwner = "";
public void ShowInvite(string ownerName)
{
InviteOwner = ownerName;
inviteOwnerNameTxt.text = "You are being invited to a Party by " + ownerName;
Debug.Log("ShowPanel called");
beingInviteUI.SetActive(true);
panelRect.DOAnchorPos(onScreenPosition, 0.5f)
.SetEase(Ease.OutBack);
}
public void AcceptInvite()
{
playerNetwork.localPlayer.CmdAcceptInvite(InviteOwner);
HidePanel();
}
public void DeclineInvite()
{
HidePanel();
}
public void HidePanel()
{
panelRect.DOAnchorPos(offScreenPosition, 0.5f)
.SetEase(Ease.OutBack)
.OnComplete(() => beingInviteUI.SetActive(false));
}
public void InParty(string ownerName)
{
if (ownerName.Length == 0)
{
inPartyUI.SetActive(false);
}
else
{
inPartyUI.SetActive(true);
inPartyOwnerNameTxt.text = $"{ownerName}'s Party";
playerNetwork[] players = FindObjectsOfType<playerNetwork>();
List<string> playerNames = new List<string>();
foreach (playerNetwork player in players)
{
if (player.myPartyOwner == ownerName)
{
playerNames.Add(player.playerName);
}
}
inPartyPlayersTxt.text = string.Join(", ", playerNames);
}
}
public void LeaveParty(){
//playerNetwork.localPlayer.CmdLeaveParty();
inPartyUI.SetActive(false);
}
}

View File

@ -19,6 +19,9 @@ using Newtonsoft.Json;
public class playerNetwork : NetworkBehaviour public class playerNetwork : NetworkBehaviour
{ {
public static playerNetwork localPlayer;
public invitePlayer invitePlayer;
public const float ATTACK_COOLDOWN = 0.6f; public const float ATTACK_COOLDOWN = 0.6f;
[HideInInspector] [HideInInspector]
public StatManager statManager; public StatManager statManager;
@ -44,6 +47,8 @@ public class playerNetwork : NetworkBehaviour
[SyncVar(hook = nameof(OnXpChanged))] [SyncVar(hook = nameof(OnXpChanged))]
public int XP; public int XP;
[SyncVar]
public string myPartyOwner;
public int lvl2 { get{ public int lvl2 { get{
return GetLevelForKills2(enemyKillCount); return GetLevelForKills2(enemyKillCount);
@ -204,7 +209,10 @@ public class playerNetwork : NetworkBehaviour
localPlayerTransform.GetComponent<playerNetwork>().questActions.Add(action); localPlayerTransform.GetComponent<playerNetwork>().questActions.Add(action);
} }
void Awake(){
invitePlayer = GetComponent<invitePlayer>();
rangeEnemyFind = GetComponent<rangeEnemyFinder>();
}
void Start(){ void Start(){
// for(int i =0; i < 2000; i+=10){ // for(int i =0; i < 2000; i+=10){
@ -221,6 +229,7 @@ public class playerNetwork : NetworkBehaviour
}else{ }else{
localPlayerTransform = transform; localPlayerTransform = transform;
localPlayer = this;
cameraRPG.instance.SetTarget(transform); cameraRPG.instance.SetTarget(transform);
#if UNITY_EDITOR #if UNITY_EDITOR
ResetHealthAndArmor(); ResetHealthAndArmor();
@ -244,6 +253,43 @@ public class playerNetwork : NetworkBehaviour
} }
[Command]
public void CmdInvitePlayer(string otherPlayerName){
if(myPartyOwner == null || myPartyOwner.Length == 0){
FindPlayerByName(otherPlayerName).ShowInvite(playerName);
}else{
FindPlayerByName(otherPlayerName).ShowInvite(myPartyOwner);
}
}
public void ShowInvite(string ownerName){
RpcInvitePlayer(ownerName);
}
[ClientRpc]
void RpcInvitePlayer(string playerName){
if(!isLocalPlayer){return;}
invitePlayer.ShowInvite(playerName);
}
[Command]
public void CmdAcceptInvite(string otherPlayerName){
myPartyOwner = otherPlayerName;
}
playerNetwork FindPlayerByName(string playerName){
playerNetwork[] players = FindObjectsOfType<playerNetwork>();
foreach(playerNetwork player in players){
if(player.playerName == playerName){
return player;
}
}
return null;
}
void LoadCharFromJson(string json){ void LoadCharFromJson(string json){
if(json.Length <=0){return;} if(json.Length <=0){return;}
character.FromJson(json,true); character.FromJson(json,true);
@ -372,9 +418,7 @@ public class playerNetwork : NetworkBehaviour
rangeEnemyFinder rangeEnemyFind; rangeEnemyFinder rangeEnemyFind;
enemyScript closestEnemy => rangeEnemyFind.targetEnemy; enemyScript closestEnemy => rangeEnemyFind.targetEnemy;
void Awake(){
rangeEnemyFind = GetComponent<rangeEnemyFinder>();
}
float attackTimer = 0; float attackTimer = 0;
[HideInInspector] [HideInInspector]
@ -395,6 +439,12 @@ public class playerNetwork : NetworkBehaviour
txtEnemyKillCount.text = enemyKillCount.ToString(); txtEnemyKillCount.text = enemyKillCount.ToString();
coinText.text = playerCoin.ToString(); coinText.text = playerCoin.ToString();
txtPlayerName.text = gplayAuth.userNameCloud; txtPlayerName.text = gplayAuth.userNameCloud;
if(myPartyOwner != null && myPartyOwner.Length > 0){
invitePlayer.InParty(myPartyOwner);
}else{
invitePlayer.InParty("");
}
} }
ShowXP(); ShowXP();
ShowLevel(); ShowLevel();

View File

@ -1,99 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
public class InviteUIManager : MonoBehaviour
{
[Header("UI References")]
[SerializeField] private GameObject inviteUI , beingInviteUI;
[SerializeField] private CanvasGroup uiCanvasGroup , bUiCanvasGroup ;
[SerializeField] private RectTransform uiRectTransform , panelRect ;
[Header("Animation Settings")]
[SerializeField] private float appearDuration = 0.3f;
[SerializeField] private float disappearDuration = 0.2f;
[SerializeField] private Ease appearEase = Ease.OutBack;
[SerializeField] private Ease disappearEase = Ease.InBack;
[SerializeField] private Vector2 offScreenPosition = new Vector2(1200 , -140);
[SerializeField] private Vector2 onScreenPosition = new Vector2(1300 , -140);
private void Start()
{
// Initialize hidden state
uiRectTransform.localScale = Vector3.zero;
uiCanvasGroup.alpha = 0;
inviteUI.SetActive(false);
beingInviteUI.SetActive(false);
onScreenPosition = panelRect.anchoredPosition;
offScreenPosition = new Vector2(
+Screen.width, // Use screen width for consistent off-screen positioning
onScreenPosition.y
);
// Start with panel hidden
panelRect.anchoredPosition = offScreenPosition;
}
void Update()
{
if (Input.GetKeyDown(KeyCode.L))
{
ShowPanel();
}
}
private void OnMouseDown()
{
ShowInviteUI();
}
public void ShowInviteUI()
{
inviteUI.SetActive(true);
// Reset values before animation
uiCanvasGroup.alpha = 0;
uiRectTransform.localScale = Vector3.zero;
// Parallel animations
Sequence showSequence = DOTween.Sequence();
showSequence.Append(uiRectTransform.DOScale(1, appearDuration).SetEase(appearEase))
.Join(uiCanvasGroup.DOFade(1, appearDuration))
.SetUpdate(true); // Ensures animation runs smoothly even if time scale is modified
// Add to ShowInviteUI()
Camera.main.DOShakePosition(0.2f, 0.1f, 1, 90f, false );
// Ensures animation runs smoothly even if time scale is modified
}
public void CloseInviteUI()
{
// Animate before disabling
Sequence hideSequence = DOTween.Sequence();
hideSequence.Append(uiRectTransform.DOScale(0, disappearDuration).SetEase(disappearEase))
.Join(uiCanvasGroup.DOFade(0, disappearDuration))
.OnComplete(() => inviteUI.SetActive(false));
}
public void ShowPanel()
{
Debug.Log("ShowPanel called");
// Enable panel before animation
beingInviteUI.SetActive(true);
panelRect.DOAnchorPos(onScreenPosition, 0.5f)
.SetEase(Ease.OutBack);
}
public void HidePanel()
{
panelRect.DOAnchorPos(offScreenPosition, 0.5f)
.SetEase(Ease.OutBack)
.OnComplete(() => beingInviteUI.SetActive(false));
}
}

View File

@ -1,48 +1,49 @@
{ {
"dependencies": { "dependencies": {
"com.hwaet.projectcloner": "https://github.com/hwaet/UnityProjectCloner.git", "com.boxqkrtm.ide.cursor": "https://github.com/boxqkrtm/com.unity.ide.cursor.git",
"com.unity.collab-proxy": "2.2.0", "com.hwaet.projectcloner": "https://github.com/hwaet/UnityProjectCloner.git",
"com.unity.feature.2d": "2.0.0", "com.unity.collab-proxy": "2.2.0",
"com.unity.ide.rider": "3.0.27", "com.unity.feature.2d": "2.0.0",
"com.unity.ide.visualstudio": "2.0.22", "com.unity.ide.rider": "3.0.27",
"com.unity.nuget.newtonsoft-json": "3.2.1", "com.unity.ide.visualstudio": "2.0.22",
"com.unity.test-framework": "1.1.33", "com.unity.nuget.newtonsoft-json": "3.2.1",
"com.unity.textmeshpro": "3.0.6", "com.unity.test-framework": "1.1.33",
"com.unity.timeline": "1.7.6", "com.unity.textmeshpro": "3.0.6",
"com.unity.toolchain.macos-arm64-linux-x86_64": "2.0.4", "com.unity.timeline": "1.7.6",
"com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.9", "com.unity.toolchain.macos-arm64-linux-x86_64": "2.0.4",
"com.unity.ugui": "1.0.0", "com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.9",
"com.unity.visualscripting": "1.9.1", "com.unity.ugui": "1.0.0",
"com.unity.modules.ai": "1.0.0", "com.unity.visualscripting": "1.9.1",
"com.unity.modules.androidjni": "1.0.0", "com.unity.modules.ai": "1.0.0",
"com.unity.modules.animation": "1.0.0", "com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0", "com.unity.modules.animation": "1.0.0",
"com.unity.modules.audio": "1.0.0", "com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.cloth": "1.0.0", "com.unity.modules.audio": "1.0.0",
"com.unity.modules.director": "1.0.0", "com.unity.modules.cloth": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0", "com.unity.modules.director": "1.0.0",
"com.unity.modules.imgui": "1.0.0", "com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0", "com.unity.modules.imgui": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0", "com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.physics": "1.0.0", "com.unity.modules.particlesystem": "1.0.0",
"com.unity.modules.physics2d": "1.0.0", "com.unity.modules.physics": "1.0.0",
"com.unity.modules.screencapture": "1.0.0", "com.unity.modules.physics2d": "1.0.0",
"com.unity.modules.terrain": "1.0.0", "com.unity.modules.screencapture": "1.0.0",
"com.unity.modules.terrainphysics": "1.0.0", "com.unity.modules.terrain": "1.0.0",
"com.unity.modules.tilemap": "1.0.0", "com.unity.modules.terrainphysics": "1.0.0",
"com.unity.modules.ui": "1.0.0", "com.unity.modules.tilemap": "1.0.0",
"com.unity.modules.uielements": "1.0.0", "com.unity.modules.ui": "1.0.0",
"com.unity.modules.umbra": "1.0.0", "com.unity.modules.uielements": "1.0.0",
"com.unity.modules.unityanalytics": "1.0.0", "com.unity.modules.umbra": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0", "com.unity.modules.unityanalytics": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0", "com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0", "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unitywebrequesttexture": "1.0.0", "com.unity.modules.unitywebrequestaudio": "1.0.0",
"com.unity.modules.unitywebrequestwww": "1.0.0", "com.unity.modules.unitywebrequesttexture": "1.0.0",
"com.unity.modules.vehicles": "1.0.0", "com.unity.modules.unitywebrequestwww": "1.0.0",
"com.unity.modules.video": "1.0.0", "com.unity.modules.vehicles": "1.0.0",
"com.unity.modules.vr": "1.0.0", "com.unity.modules.video": "1.0.0",
"com.unity.modules.wind": "1.0.0", "com.unity.modules.vr": "1.0.0",
"com.unity.modules.xr": "1.0.0" "com.unity.modules.wind": "1.0.0",
} "com.unity.modules.xr": "1.0.0"
} }
}

View File

@ -1,5 +1,14 @@
{ {
"dependencies": { "dependencies": {
"com.boxqkrtm.ide.cursor": {
"version": "https://github.com/boxqkrtm/com.unity.ide.cursor.git",
"depth": 0,
"source": "git",
"dependencies": {
"com.unity.test-framework": "1.1.9"
},
"hash": "38fecf55e4fd94ccfe58a92ed8ad1a529ba1694e"
},
"com.hwaet.projectcloner": { "com.hwaet.projectcloner": {
"version": "https://github.com/hwaet/UnityProjectCloner.git", "version": "https://github.com/hwaet/UnityProjectCloner.git",
"depth": 0, "depth": 0,