void RPC_SeeRecruiter(int recruiterID, bool ownedObject) { TeamToken tt = TeamToken.FindTeamToken(recruiterID); if (ownedObject) { tt?.recruitOwnedObject(this); } else { tt?.recruit(this); } }
void RPC_SwitchController(int controllerID) { //Old TT is the current controller TeamToken oldTT = this.controller; //New TT is the given controller,or if it's null, //New TT is this teamToken (it controls itself) TeamToken newTT = TeamToken.FindTeamToken(controllerID) ?? this; //If the controller has changed if (oldTT != newTT) { //Switch the controller onControllerLostControl?.Invoke(oldTT); this.controller = newTT; onControllerGainedControl?.Invoke(newTT); } }
void RPC_AssignTeam(int captainID) { TeamToken ttc = TeamToken.FindTeamToken(captainID); ttc?.recruit(this); }