public override void Start() { this.facingRight = false; this.passive = false; this.vision = this.GetComponentInChildren<Vision> (); this.animator = this.GetComponent<Animator> (); }
// Use this for initialization void Start() { timeSinceLastAction = timeBetweenActions; //allows immediate acting on spawn vision = GetComponent<Vision> (); timeSinceLastAction = timeBetweenActions; manager = (GameObject.FindGameObjectsWithTag ("Manager"))[0].GetComponent<LevelManager> (); sound = GetComponent<AudioSource> (); }
void Awake() { shotControl = GetComponent<ShotControl>(); vision = GetComponent<Vision>(); camSpeed = camSpeedDefault; nextRotationChange = Time.time; nextXCheck = 0; angle = 0f; }
void Awake() { shotControl = GetComponent<ShotControl>(); vision = GetComponent<Vision>(); state = SEARCHING; nextRotationChange = Time.time; nextXCheck = 0; xRot = 0f; }
protected void Start() { if(WavMn == null) WavMn = FindObjectOfType<WaveMan>(); WavMn.enemySpawned(); Speed = SpeedWander; base.Start(); //Target = FindObjectOfType<PlayerController>().Motor; Rep = GetComponent<Repulsor>(); Vis = GetComponentInChildren<Vision>(); Vis.Recv = this; targetWP(); }
void Awake() { shotControl = GetComponent<ShotControl>(); vision = GetComponent<Vision>(); state = SEARCHING; nextRotationChange = Time.time; nextXCheck = 0; xRot = 0f; nextTargetMemory = new Dictionary<Position, Position>(); previousTarget = null; currentTarget = null; }
private async void SetImageAndRun() { try { ResultIsVisible = false; IndicatorIsRunning = true; ResultFontSize = 16; var cameraStatus = await CrossPermissions.Current.CheckPermissionStatusAsync(Permission.Camera); if (cameraStatus != PermissionStatus.Granted) { var semaphore = new SemaphoreSlim(1, 1); semaphore.Wait(); var results = await CrossPermissions.Current.RequestPermissionsAsync(Permission.Camera); cameraStatus = results[Permission.Camera]; semaphore.Release(); } if (cameraStatus == PermissionStatus.Granted) { await CrossMedia.Current.Initialize(); if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported) { ResultText = ":( No camera available."; } else { var file = await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions { Directory = "SampleDirectory", Name = "test.jpg" }); if (file == null) { return; } ImageSource = ImageSource.FromFile(file.Path); var temp = await MakePredictionRequest(file.Path); //Делает махинации с Vision по сделанной фото Vision t = new Vision(); ResultText = await t.MakeSomeSummary(file.GetStream()); //Здесь я подумал, что делать еще одну страницу мне лень //Ибо функционал будет отличаться на 2 строчки, //Поэтому чтобы распознавать совушек раскоментируйте нижнюю //А чтобы оставить Vision не трогайте верхние 2 //Делает махинации с совушками по сделанной фото //SetPropsAfterPredictin(temp); file.Dispose(); } } ResultIsVisible = true; IndicatorIsRunning = false; } catch (Exception ex) { ResultIsVisible = true; IndicatorIsRunning = false; ResultText = ex.ToString(); //TODO Повесить обработчики //Debug.WriteLine(ex); } }
// Use this for initialization void Start() { Player = GameObject.FindGameObjectWithTag("Player"); MC = Player.GetComponent<Magic_Controller>(); pcZ = Player.GetComponent<Player_ControllerZ>(); vision = Player.GetComponentInChildren<Vision>(); animator = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren<Animator>(); SE = GetComponent<AudioSource>(); }
public override void DTRMStart() { base.DTRMStart(); legs = GetComponent<Legs>(); vision = GetComponent<Vision>(); attack = GetComponent<Attack>(); }
private ScriptGlobals(BotProperties botProperties) { _50437079C366407D978Fe4Afd60C535F = botProperties; _vision = Vision.Build(botProperties); }
// Use this for initialization void Start() { movement = gameObject.GetComponent<NPCcontroler> (); castdar = castdarSensor.GetComponent<Castdar> (); vision = visionSensor.GetComponent<Vision> (); }
void Start() { GetRackInfo(); gameControl = GameObject.FindGameObjectWithTag (Tags.gameController).GetComponent<GameControl>(); vision = GetComponentInChildren<Vision>(); }
void Awake() { vision = GetComponent <Vision>(); }
public static bool IsNotOwned(this Vision value) => (int)value < 3;
/// <summary> /// 2019.5.21 临时使用 测试新的矫正点 算法 /// </summary> /// <param name="modelDirPath"></param> /// <returns></returns> public bool ReadModelCorrect(string modelDirPath) { try { HTuple iFlag = null; showContour.Dispose(); if (modelID != null) { Vision.ClearModel(modelType, modelID); } ToolKits.FunctionModule.Vision.read_model(out showContour, modelDirPath, out modelType, out modelID, out defRows, out defCols, out iFlag); if (iFlag.I != 0) { Dispose(); return(false); } //??????? //HOperatorSet.ReadTuple(modelDirPath + "\\angleStart.tup", out angleStart); //HOperatorSet.ReadTuple(modelDirPath + "\\angleExtent.tup", out angleExtent); //HOperatorSet.ReadTuple(modelDirPath + "\\scoreThresh.tup", out scoreThresh); showImage.Dispose(); if (File.Exists(modelDirPath + "\\showImage.tiff")) { HOperatorSet.ReadImage(out showImage, modelDirPath + "\\showImage.tiff"); } matchRegion.Dispose(); if (File.Exists(modelDirPath + "\\matchRegion.reg")) { HOperatorSet.ReadRegion(out matchRegion, modelDirPath + "\\matchRegion.reg"); } HOperatorSet.ReadTuple(modelDirPath + "\\cornorRows.dat", out refPointsRow); HOperatorSet.ReadTuple(modelDirPath + "\\cornorCols.dat", out refPointsCol); HOperatorSet.ReadTuple(modelDirPath + "\\hLinesCol.dat", out hLineCols); HOperatorSet.ReadTuple(modelDirPath + "\\hLinesRow.dat", out hLineRows); HOperatorSet.ReadTuple(modelDirPath + "\\vLinesCol.dat", out vLineCols); HOperatorSet.ReadTuple(modelDirPath + "\\vLinesRow.dat", out vLineRows); //加载其它modelID0-n //string[] files = Directory.GetFiles(modelDirPath, "modelID*.dat"); //for (int i = 0; i < files.Length; i++) //{ // HTuple _modelID = new HTuple(); // if (modelType.I == 0) // { // HOperatorSet.ReadNccModel(files[i], out _modelID); // } // else // { // HOperatorSet.ReadShapeModel(files[i], out _modelID); // } // HTuple _defRow, _defCol; // //HOperatorSet.ReadTuple(modelDirPath + "\\defRow*" + i.ToString() + ".tup", out _defRow); // //HOperatorSet.ReadTuple(modelDirPath + "\\defCol*" + i.ToString() + ".tup", out _defCol); // HOperatorSet.ReadTuple(modelDirPath + "\\defRow" + ".tup", out _defRow); // HOperatorSet.ReadTuple(modelDirPath + "\\defCol" + ".tup", out _defCol); // //modelID.Append(_modelID); // //defRows.Append(_defRow); // //defCols.Append(_defCol); //} return(true); } catch (Exception) { Dispose(); return(false); } }
// Called when the state is enabled void OnEnable() { vision = vision.GetComponent <Vision>(); Waypoint.transform.position = ButterflyWaypoint.transform.position; textObject.GetComponent <TextToUI>().SetText(textObject.g_chasing); }
public editing(byte[] input) { InitializeComponent(); vision = new Vision(input); objlister.Nodes[0].Expand(); }
public editing() { InitializeComponent(); vision = new Vision(); objlister.Nodes[0].Expand(); }
public IActionResult Create() { var vision = new Vision(); return(PartialView("Create", vision)); }
void Awake() { vision = GetComponent <Vision>(); agent = GetComponent <NavMeshAgent>(); }
void OnEnable() { vision = (Vision)target; }
public void Idle() { changeBehavior(WalkerBehavior.Idle); Movement.Stop(); Vision.Reset(); }
// Called when the state is enabled void OnEnable() { vision = vision.GetComponent <Vision>(); navMeshAgent = GetComponent <NavMeshAgent>(); }
public HexData(int _x, int _z, Hex _type, GameObject _hex_object, engineHexS _hex_script, Vision _vision) { x = _x; z = _z; hex_type = _type; hex_object = _hex_object; vision_state = _vision; direction_from_central_hex = Facing.South; //this is a temp value, should be replaced manually usually added_occupier = EntityE.NotCheckedYet; traversal_cost = -1; hex_script = _hex_script; is_node_here = false; }
void OnVisionChange(Vision vision) { Debug.Log("DOG SOUND"); }
public static bool IsOwned(this Vision value) => (int)value == 3;
protected override void OnEnable() { _vision = GetComponentInParent <Vision>(); base.OnEnable(); }
private string ProcessGoals(Vision vision) { IEnumerable <String> goalsStrings = vision.Goals.Select(goal => _gp.VisualizeToString(goal, vision.NodeID)); return(string.Join(", ", goalsStrings)); }
public static void updateHexVisionState(HexData in_hex, Vision in_vision) { hexes[in_hex.x, in_hex.z].vision_state = in_vision; }
static void Main(string[] args) { Vision main = new Vision(); Console.ReadLine(); }
// Use this for initialization void Start() { aManager = GameObject.FindObjectOfType<AudioManager>(); vision = GameObject.FindObjectOfType<Vision>().GetComponent<Vision>(); }
public void InitializeVisibilityOfTiles(Vision vision) { _sceneContext.UnseenMaskTilemap.gameObject.SetActive(vision != Vision.Permanent); _sceneContext.FogOfWarTilemap.gameObject.SetActive(vision == Vision.Undiscovered); }
void OnEnable() { vision = (Vision) target; }
private async void SetImageAndRun() { try { ResultIsVisible = false; IndicatorIsRunning = true; ResultFontSize = 16; var cameraStatus = await CrossPermissions.Current.CheckPermissionStatusAsync(Permission.Camera); if (cameraStatus != PermissionStatus.Granted) { var semaphore = new SemaphoreSlim(1, 1); semaphore.Wait(); var results = await CrossPermissions.Current.RequestPermissionsAsync(Permission.Camera); cameraStatus = results[Permission.Camera]; semaphore.Release(); } if (cameraStatus == PermissionStatus.Granted) { await CrossMedia.Current.Initialize(); if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported) { ResultText = ":( No camera available."; } else { var file = await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions { Directory = "SampleDirectory", Name = "test.jpg" }); if (file == null) { return; } ImageSource = ImageSource.FromFile(file.Path); var temp = await MakePredictionRequest(file.Path); Vision t = new Vision(); ResultText = await t.MakeSomeSummary(file.GetStream()); file.Dispose(); } } ResultIsVisible = true; IndicatorIsRunning = false; } catch (Exception ex) { ResultIsVisible = true; IndicatorIsRunning = false; ResultText = ex.ToString(); } }
void Awake() { rigidB2D = GetComponent<Rigidbody2D>(); // Calculate random bounds if applicable if (walkType == WalkType.RANDOM) { Random.InitState(System.Environment.TickCount); xBounds[0] = transform.position.x - randomBounds[0]; xBounds[1] = transform.position.x + randomBounds[0]; yBounds[0] = transform.position.y - randomBounds[1]; yBounds[1] = transform.position.y + randomBounds[1]; } else { randomBounds = null; xBounds = null; yBounds = null; } // Set vision object from child objects vision = GetComponentInChildren<Vision>(); if (vision) { vision.targetSeen += OnTargetSeen; } }
protected ViewController(IntPtr handle) : base(handle) { // Note: this .ctor should not contain any initialization logic. this.viewModel = new Vision(); }
void Start() { vision = gameObject.GetComponent <Vision>(); textMesh = GetComponent(typeof(TextMesh)) as TextMesh; }
public bool CheckForPlayer() { return Vision.CheckForPlayer(this.PhysicsContainer.Object.CheckForPlayerHorizontally(this.FacingRight, sightForPlayerDistance)); }
public void SetVision(Tile tile, Civilization civ, Vision vision) => Register.Resolver.SetVision(tile, civ, vision);
public static bool IsUndiscovered(this Vision value) => (int)value == 0;
public virtual void CivilisationVisionUpdate(Coordinate coordinate, Civilization.Civilization civ, Vision vision) { assertFeatureWorld(civ.Register.Resolver.FeatureWorld); var tile = World[coordinate]; civ.Register.Resolver.SetVision(tile, civ, vision, true); }
// Use this for initialization void Start() { vision = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren<Vision>(); At = GetComponent<Attack_Parameter>(); oldTarget = vision.nearTarget; }
public static bool IsDiscovered(this Vision value) => (int)value >= 1;
public HexData(int _x, int _z, bool THIS_METHOD_IS_FOR_DUMMY_PERIMETER_HEXES_ONLY) { x = _x; z = _z; hex_type = Hex.Perimeter; direction_from_central_hex = Facing.South; added_occupier = EntityE.NotCheckedYet; traversal_cost = -1; hex_object = null; vision_state = Vision.Unvisted; hex_script = null; is_node_here = false; }
public override int GetHashCode() { return(MedicineRank.GetHashCode() ^ AdditionalRequirementsTableGraphs.GetHashCode() ^ DiseaseArticles.GetHashCode() ^ Vision.GetHashCode() ^ BloodType.GetHashCode()); }
private async void btnSaveCalibModel2D_Click(object sender, EventArgs e) { if (!this.mTmpFrm.tmpResult.createTmpOK) { HTUi.PopError("创建标定模板失败!"); return; } Form_Wait.ShowForm(); bool result = await Task.Run(() => { try { this.aoiModels = new Model(); this.aoiModels.Dispose(); this.aoiModels.showContour = this.mTmpFrm.tmpResult.showContour.CopyObj(1, -1); this.aoiModels.defRows = this.mTmpFrm.tmpResult.defRows; this.aoiModels.defCols = this.mTmpFrm.tmpResult.defCols; this.aoiModels.modelType = this.mTmpFrm.tmpResult.modelType; this.aoiModels.modelID = Vision.CopyModel(this.mTmpFrm.tmpResult.modelID, this.mTmpFrm.tmpResult.modelType); this.aoiModels.scoreThresh = this.mTmpFrm.mte_TmpPrmValues.Score; this.aoiModels.angleStart = this.mTmpFrm.mte_TmpPrmValues.AngleStart; this.aoiModels.angleExtent = this.mTmpFrm.mte_TmpPrmValues.AngleExtent; //保存至硬盘 string folderPath = _station.SystemUV2XYDir + "\\Camera_" + _station.SelectedIndex; _station.CalibrUV2XYModelPath = folderPath; if (!this.aoiModels.WriteModel(folderPath)) { HTLog.Error("保存标定模板失败!"); HTUi.PopError("保存标定模板失败!"); return(false); } string errMsg = ""; Pos_Uv2Xy = new HTuple(); double xUV2xy = 0, yUV2xy = 0, zUV2xy = 0; if (!_station.GetAxisPosition(_station.AxisXYZ[0], out xUV2xy, out errMsg)) { HTLog.Error(errMsg + ":保存获取X轴反馈坐标失败!"); HTUi.PopError(errMsg + ":保存获取X轴反馈坐标失败!"); return(false); } if (!_station.GetAxisPosition(_station.AxisXYZ[1], out yUV2xy, out errMsg)) { HTLog.Error(errMsg + ":保存获取Y轴反馈坐标失败!"); HTUi.PopError(errMsg + ":保存获取Y轴反馈坐标失败!"); return(false); } if (!_station.GetAxisPosition(_station.AxisXYZ[2], out zUV2xy, out errMsg)) { HTLog.Error(errMsg + ":保存获取Z轴反馈坐标失败!"); HTUi.PopError(errMsg + ":保存获取Z轴反馈坐标失败!"); return(false); } _station.operation.YUv2xy = yUV2xy; _station.operation.XUv2xy = xUV2xy; _station.operation.ZUv2xy = zUV2xy; Pos_Uv2Xy.Append(_station.operation.XUv2xy); Pos_Uv2Xy.Append(_station.operation.YUv2xy); Pos_Uv2Xy.Append(_station.operation.ZUv2xy); HOperatorSet.WriteTuple(Pos_Uv2Xy, folderPath + "\\Pos_Uv2Xy.tup"); HTUi.TipHint("保存标定模板成功!"); HTLog.Info("保存标定模板成功!"); return(true); } catch (Exception ex) { HTLog.Error(ex.ToString()); HTUi.PopError(ex.ToString()); return(false); } }); Form_Wait.CloseForm(); if (!result) { HTLog.Error("保存标定模板失败!"); HTUi.PopError("保存标定模板失败!"); return; } HTUi.TipHint("保存标定模板成功!"); HTLog.Info("保存标定模板成功!"); }
public static bool IsVisible(this Vision value) => (int)value >= 2;