INVALID TOKEN
3 participantes
Página 1 de 1
INVALID TOKEN
o que que tá dando de errado aqui, INVALID TOKEN, linha 16 e 26? To o dia todo tentando resolver isso.
Assets\PlayerAvatar.cs(16,26): error CS1519: Invalid token ';' in class, record, struct, or interface member declaration
- Código:
// Copyright (C) 2016-2023 gamevanilla. All rights reserved.
// This code can only be used under the standard Unity Asset Store End User License Agreement,
// a copy of which is available at http://unity3d.com/company/legal/as_terms.
using UnityEngine;
namespace CCGKit
{
/// <summary>
/// This class holds information about a player avatar from the game scene, which can be clicked
/// to select a target player for an effect or during combat (this will send the appropriate
/// information to the server).
/// </summary>
public class PlayerAvatar : MonoBehaviour
{
public PlayerInfo;
private bool isBottom;
public int index
{
get { return IsBottom ? 0 : 1; }
}
public bool IsBottom { get => isBottom; set => isBottom = value; }
private Player TargetPlayer
{
get
{
var players = FindObjectsOfType<Player>();
if (IsBottom)
{
foreach (var player in players)
{
if (player.isLocalPlayer && player.isHuman)
return player;
}
}
else
{
foreach (var player in players)
{
if (!player.isLocalPlayer || (player.isLocalPlayer && !player.isHuman))
return player;
}
}
return null;
}
}
private void OnTriggerEnter2D(Collider2D collider)
{
if (collider.transform.parent != null)
{
var targetingArrow = collider.transform.parent.GetComponent<TargetingArrow>();
if (targetingArrow != null)
{
targetingArrow.OnPlayerSelected(this);
}
}
}
private void OnTriggerExit2D(Collider2D collider)
{
if (collider.transform.parent != null)
{
var targetingArrow = collider.transform.parent.GetComponent<TargetingArrow>();
if (targetingArrow != null)
{
targetingArrow.OnPlayerUnselected(this);
}
}
}
}
}
Assets\PlayerAvatar.cs(16,26): error CS1519: Invalid token ';' in class, record, struct, or interface member declaration
RodrigoPrivilegium- Avançado
- PONTOS : 1663
REPUTAÇÃO : 10
Respeito as regras :
Re: INVALID TOKEN
RodrigoPrivilegium escreveu:o que que tá dando de errado aqui, INVALID TOKEN, linha 16 e 26? To o dia todo tentando resolver isso.LINHA 16 e 26 dizendo
- Código:
// Copyright (C) 2016-2023 gamevanilla. All rights reserved.
// This code can only be used under the standard Unity Asset Store End User License Agreement,
// a copy of which is available at http://unity3d.com/company/legal/as_terms.
using UnityEngine;
namespace CCGKit
{
/// <summary>
/// This class holds information about a player avatar from the game scene, which can be clicked
/// to select a target player for an effect or during combat (this will send the appropriate
/// information to the server).
/// </summary>
public class PlayerAvatar : MonoBehaviour
{
public PlayerInfo; //<----ERRO---A msg diz q a Variavel PlayerInfo foi declarada mais vc nao deu um nome para ela, falta esse detalhe!
private bool isBottom;
Assets\PlayerAvatar.cs(16,26): error CS1519: Invalid token ';' in class, record, struct, or interface member declaration
apenas na linha 16, o n 26 é a coluna/posicao da linha.
![Piscadinha](/users/1914/40/81/62/smiles/954333697.png)
Re: INVALID TOKEN
Faltou declarar o nome da variável, sugestão:
- Código:
public PlayerInfo _player;
NKKF- ProgramadorMaster
-
PONTOS : 4700
REPUTAÇÃO : 574
Idade : 19
Áreas de atuação : Desenvolvedor na Unity, NodeJS, React, ReactJS, React Native, MongoDB e Firebase.
Respeito as regras :
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos