public void FollowBest2() { nnManager = GameObject.FindObjectOfType <NNManager>(); vcam = GameObject.FindObjectOfType <CinemachineVirtualCamera>(); int bestGenomeNum = 0; float bestFit = 0; for (int i = 0; i < nnManager.populationSize; i++) { if (nnManager.bots[i].overallFitness > bestFit) { bestFit = nnManager.bots[i].overallFitness; bestGenomeNum = i; } } BotController[] BotControllers = GameObject.FindObjectsOfType <BotController>(); foreach (BotController bc in BotControllers) { if (bc.genomeNum == bestGenomeNum) { Debug.Log("NOW FOLLOWING " + bestGenomeNum + " BESTFIT " + bestFit); vcam.m_Follow = bc.transform; break; } } }
protected override void Response() { base.Response(); NNManager .Negotiate( _request.PortType, _request.Version, _request.Cookie); }
protected override void DataOperation() { _session.UserInfo.SetIsGotReportPacketFlag(); if (_request.NatResult != NATNegotiationResult.Success) { NNManager.Negotiate(NatPortType.GP, _request.Version, _request.Cookie); NNManager.Negotiate(NatPortType.NN1, _request.Version, _request.Cookie); NNManager.Negotiate(NatPortType.NN2, _request.Version, _request.Cookie); NNManager.Negotiate(NatPortType.NN3, _request.Version, _request.Cookie); } }
void Start() { nnManager = nnManageGO.GetComponent <NNManager> (); }
private void Start() { manager = GameObject.FindObjectOfType <NNManager>(); }