I've been stuck here for a day. I'm trying to call a simple return to find out which player on the network is the one performing an action. In this case, a script is highlighting units based on the returned player's alliance status when that unit is Moused-over. The most frustrating part is, SOMETIMES I crash, and other times I don't, so I know I'm doing something really dumb, but I can't figure it out.
Here's the Highlighter snippet:
void OnMouseEnter()
{
int i = 0;
tGroup = this.transform.GetComponentsInChildren();
int tPlayer = nManager.GetTriggeringPlayer();
Debug.Log(tPlayer);
if(tPlayer!=0)
{
if(nManager.gControllers[tPlayer].alliances[uData.playerNumber]==GameController.AllianceStatus.allied)
hColor = allyColor;
if(nManager.gControllers[tPlayer].alliances[uData.playerNumber]==GameController.AllianceStatus.enemy)
hColor = enemyColor;
if(nManager.gControllers[tPlayer].alliances[uData.playerNumber]==GameController.AllianceStatus.neutral)
hColor = neutColor;
while(i().PlayerNumber;
return number;
break;
}
}
int noNumber = 0;
return noNumber;
}
↧