示例#1
0
    public void Refresh()
    {
        playerIdentity.ResetStageData();

        Health      = MaxHealth;
        Dead        = false;
        Respawnable = true;

        if (!StageManager.InLobby && !SceneChangeTest.IsLoadingTutorial)
        {
            Debug.Log("UI2");
            UI_copy = Instantiate(PlayerUI);
            UI_copy.GetComponent <PlayerUI>().SetUp(this);

            GameObject canvas = GameObject.FindGameObjectWithTag("Canvas");
            if (canvas != null)
            {
                UI_copy.transform.parent     = canvas.transform;
                UI_copy.transform.localScale = new Vector3(1, 1, 1);
            }
            UI_copy.GetComponentInChildren <DurabilityUI>().SetUp(GetComponentInChildren <PlayerBehavior>());
        }
    }