/// <summary> /// Get the associated Viewer of these IHardwareProxy /// the viewer allow the user to interact with or tweak the hardware. /// you can return null. /// </summary> /// <returns></returns> public Control GetViewer() { // hey why not use the default build in Laser Viewer to let the user play with the lasers? ;) LaserControl view = new LaserControl(); view.Proxy = this; return(view); }
void OnTriggerEnter2D(Collider2D collider) { LaserControl projectile = collider.gameObject.GetComponent <LaserControl> (); if (projectile) //projectile != null { Debug.Log("Hit by a projectile"); health -= projectile.Hit(); if (health <= 0) { Die(); } } }
void OnTriggerEnter2D(Collider2D collider) { LaserControl projectile = collider.gameObject.GetComponent <LaserControl> (); if (projectile) //projectile != null { Debug.Log("Hit by a projectile"); health -= projectile.Hit(); if (health <= 0) { AudioSource.PlayClipAtPoint(deathSound, transform.position, 1f); SmokeWhenDie(); Destroy(gameObject); scoreKeeper.Score(scoreValue); } } }
// Use this for initialization void Start() { player = transform.root.GetComponentInChildren <Player>(); pickup_object_script = player.GetComponent <PickupObject>(); pointer = GameObject.Find("PointerRoot").transform; pointer_stick = GameObject.Find("Pointer_stick").gameObject; line = pointer_stick.GetComponent <LineRenderer>(); if (!Settings.debug) { GameObject.Find("Pointer").renderer.enabled = false; pointer_stick.renderer.enabled = false; } laser = GameObject.Find("laserDot").gameObject.GetComponent <LaserControl>(); pbox = GameObject.Find("Pointer").transform; }
// Use this for initialization void Start() { selectKnifeKey = KeyCode.Alpha1; selectLaserKey = KeyCode.Alpha2; selectGrenadeKey = KeyCode.Alpha3; selectTrapKey = KeyCode.Alpha4; fpc = GetComponentInParent <FirstPersonController>(); weaponAndAmmoManager = GetComponentInParent <WeaponAndAmmoManager>(); trapControl = GetComponent <TrapControl>(); laserControl = GetComponent <LaserControl>(); grenadeControl = GetComponent <GrenadeControl>(); knifeControl = GetComponent <KnifeControl>(); cameragunControl = GetComponent <CameragunControl>(); playerCanvasUpdater = GetComponentInParent <PlayerCanvasUpdater>(); // trapControl.enabled = false; // laserControl.enabled = false; // grenadeControl.enabled = false; // knifeControl.enabled = false; }
private void OnIdle(object sender, EventArgs e) { try { bool ignore = false; if (!ignore && Visible) { DateTime now = DateTime.Now; bool expired = (now - lastImageTime).TotalMilliseconds > 10; if (expired) { ICameraProxy camera = Settings.Get <ICameraProxy>(); if (camera != null) { CurrentImage = camera.AcquireImage(); lastImageTime = now; ViewPanel.Invalidate(); } else { bool lasthasImage = CurrentImage != null; CurrentImage = null; if (lasthasImage) { ViewPanel.Invalidate(); } } ILaserProxy laser = Settings.Get <ILaserProxy>(); expired = (now - lastImageTime).TotalMilliseconds > 750; if (laser != null) { LaserControl.Proxy = laser; LaserControl.AlignControls(); } } } } catch { } }
// Use this for initialization void Start() { lc = laser.GetComponent <LaserControl>(); }
// Use this for initialization void Start() { player = transform.root.GetComponentInChildren<Player>(); pickup_object_script = player.GetComponent<PickupObject>(); pointer = GameObject.Find("PointerRoot").transform; pointer_stick = GameObject.Find("Pointer_stick").gameObject; line = pointer_stick.GetComponent<LineRenderer>(); if(!Settings.debug) { GameObject.Find("Pointer").renderer.enabled = false; pointer_stick.renderer.enabled = false; } laser = GameObject.Find ("laserDot").gameObject.GetComponent<LaserControl>(); pbox = GameObject.Find("Pointer").transform; }
public void AddPoolControl(LaserControl pc) => controls.Add(pc);