示例#1
0
 void Start()
 {
     PD            = transform.parent.transform.parent.gameObject.GetComponent <PlayerData> ();
     PBS           = transform.parent.transform.parent.gameObject.GetComponent <PlayerBuffStatus> ();
     m             = GetComponent <MeshRenderer>();
     originalScale = transform.localScale;
 }
示例#2
0
    // Update is called once per frame
    void Update()
    {
//		image.fillAmount = ;
        if (playerBuffStatus)
        {
            image.fillAmount = playerBuffStatus.RemainBuffTime / playerBuffStatus.effectiveTime;
            // Debug.Log(pd.health);
        }
        else
        {
            // fetch the player by id, and get the player buff status
            Player = UserInfoManager.Instance.GetPlayerObjById(playerId);
            if (Player)
            {
                playerBuffStatus = Player.GetComponent <PlayerBuffStatus> ();
            }
        }
    }