-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlayerStat.cs
50 lines (39 loc) · 1.32 KB
/
PlayerStat.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using Photon.Pun;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerStat : Stat
{
#region 스텟관련 컴포넌트
PlayerHealth playerHealth;
MoveController moveController;
Gun gun;
#endregion
#region 필드
[Header("Information: ")]
public string PlayerName;
public GameObject PickItem;
#endregion
void Awake()
{
// 컴포넌트 연결
playerHealth = GetComponent<PlayerHealth>();
moveController = GetComponent<MoveController>();
gun = GetComponent<PlayerShooter>().gun;
// 초기 현재값설정
CStats.CurrentHealth = CStats.InitialHealth;
CStats.CurrentProtectRate = CStats.InitialProtectRate;
CStats.CurrentDamage = CStats.InitialDamage;
CStats.CurrentSpeed = CStats.InitialSpeed;
// 조종하는 케릭터값 전달
if (photonView.IsMine)
{
GameManager.Instance.Player = gameObject;
GameManager.Instance.PlayerViewID = gameObject.GetPhotonView().ViewID;
ItemManager.Instance.Player = gameObject;
ItemManager.Instance.PlayerPV = gameObject.GetPhotonView();
UIManager.Instance.Player = gameObject;
NetworkManagerInGame.Instance.clientPlayer = gameObject;
}
}
}