mirror of
https://github.com/ConjureETS/Bomberman.git
synced 2026-03-24 02:10:59 +00:00
18 lines
498 B
C#
18 lines
498 B
C#
using UnityEngine;
|
|
using UnityEngine.InputSystem;
|
|
|
|
[RequireComponent(typeof(PlayerInput))]
|
|
public class Player : MonoBehaviour {
|
|
public GameObject labelPrefab;
|
|
|
|
void Start() {
|
|
Transform canvas = GameObject.Find("Canvas").transform;
|
|
PlayerLabel label = Instantiate(labelPrefab, canvas).GetComponent<PlayerLabel>();
|
|
|
|
var playerInput = GetComponent<PlayerInput>();
|
|
|
|
label.player = transform;
|
|
label.SetName(gameObject.name);
|
|
label.SetController(playerInput.currentControlScheme);
|
|
}
|
|
} |