private void OnLosingAuth(LosingTurretAuthInfo info) { if (particles != null && VisualizerSettings.Instance.UseTankTurretTransitionParticles) { particles.Play(); } }
public void OnTurretInfoComponentAuthorityChanged(AuthorityChangeOp op) { if (op.Authority == Authority.Authoritative) { authoritativeTurretRotations.Add(op.EntityId); var update = new Improbable.Demo.TurretInfo.Update(); update.colorId = thisWorkerColorId; connection.SendComponentUpdate(op.EntityId, update); connection.SendCommandRequest(op.EntityId, new CheckOutColor.Commands.SendAndUpdateColorId.Request(thisWorkerColorId), 300); } else if (op.Authority == Authority.AuthorityLossImminent) { var update = new Improbable.Demo.TurretInfo.Update(); update.AddLosingAuth(LosingTurretAuthInfo.Create()); connection.SendComponentUpdate(op.EntityId, update); entitiesToConfirmAuthorityLoss[op.EntityId] = framesBeforeAcknowledgingAuthLoss; } else if (op.Authority == Authority.NotAuthoritative) { authoritativeTurretRotations.Remove(op.EntityId); } }