コード例 #1
0
    void ChangePlayerSkin()
    {
        if (GameManager.Instance.Player.player != null)
        {
            var childs = GameManager.Instance.Player.player.transform.GetComponentsInChildren <Transform>();
            foreach (var child in childs)
            {
                Destroy(child.gameObject);
            }
        }

        GameManager.Instance.Player.player = Instantiate(PlayerSpritesMainMenu[currPlayerSprite].GetComponent <UISkinData>().SkinDataPrefab, GameManager.Instance.Player.transform).GetComponent <SkinData>();
        StatsUI.SetShipData(GameManager.Instance.Player.player);
        GameManager.Instance.Player.ReInit(true);
    }