Ejemplo n.º 1
0
    public void SetTarget(PlayerManager1 _target)
    {
        if (_target == null)
        {
            Debug.LogError("<Color=Red><a>Missing</a></Color> PlayMakerManager target for PlayerUI.SetTarget.", this);
            return;
        }
        // Cache references for efficiency
        target          = _target;
        targetTransform = this.target.GetComponent <Transform>();
        targetRenderer  = this.target.GetComponent <Renderer>();
        CharacterController characterController = _target.GetComponent <CharacterController>();

        // Get data from the Player that won't change during the lifetime of this Component
        if (characterController != null)
        {
            characterControllerHeight = characterController.height;
        }
        if (playerNameText != null)
        {
            playerNameText.text = target.photonView.Owner.NickName;
        }
    }
Ejemplo n.º 2
0
 private void Awake()
 {
     _instance = this;
 }
Ejemplo n.º 3
0
 private void Start()
 {
     playerManager1 = GameObject.FindObjectOfType <PlayerManager1>().GetComponent <PlayerManager1>();
 }