// Start is called before the first frame update void Start() { anim = GetComponent <Animator>(); pe = GetComponent <PlayerEntry>(); phaseBar = GameObject.Find("Phase Bar"); phaseFill = phaseBar.transform.GetChild(1).GetComponent <Image>(); particle = transform.Find("PowerTrails").gameObject; particle.SetActive(false); brc = GetComponent <BreadCrumb>(); be = GetComponent <BirdsEye>(); botCollider = GameObject.FindGameObjectWithTag("Enemy").transform.Find("Sphere-Bot").GetComponent <Collider>(); playerCollider = transform.Find("PlayerCollider").GetComponent <Collider>(); }
// Use this for initialization private void Start() { minimapCamera = GameObject.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/pref_Minimap")).GetComponent <BirdsEye>(); if (GamePresets.IsSlave) { if (GamePresets.Host != null) { Network.Connect(GamePresets.Host); } else { Debug.LogError("No host given!"); Application.LoadLevel("Lobby"); } } else { StartServer(); startServerCanvas.SetActive(true); } }
public Form1() { InitializeComponent(); //try to create the capture if (_capture == null) { try { _capture = new Capture(1); } catch (NullReferenceException excpt) { //show errors if there is any MessageBox.Show(excpt.Message); } } if (_capture3 == null) { try { _capture3 = new Capture(2); } catch (NullReferenceException excpt) { //show errors if there is any MessageBox.Show(excpt.Message); } } if (_capture2 == null) { try { _capture2 = new Capture(0); } catch (NullReferenceException excpt) { //show errors if there is any MessageBox.Show(excpt.Message); } } if (_capture4 == null) { try { _capture4 = new Capture(3); } catch (NullReferenceException excpt) { //show errors if there is any MessageBox.Show(excpt.Message); } } Image <Bgr, byte> RawImage = _capture.QueryFrame().ToImage <Bgr, byte>(); Image <Bgr, byte> RawImage2 = _capture2.QueryFrame().ToImage <Bgr, byte>(); Image <Bgr, byte> RawImage3 = _capture3.QueryFrame().ToImage <Bgr, byte>(); Image <Bgr, byte> RawImage4 = _capture4.QueryFrame().ToImage <Bgr, byte>(); double ALPHA = 30; // Degree int LENGTH = 800; // Pixels int h = RawImage.Height / 2; int temp = h; int srcTopY = h - temp; birdsEye = new BirdsEye(ALPHA, LENGTH, srcTopY, RawImage.Width, RawImage.Height); birdsEye2 = new BirdsEye(ALPHA, LENGTH, srcTopY, RawImage2.Width, RawImage2.Height); birdsEye3 = new BirdsEye(ALPHA, LENGTH, srcTopY, RawImage3.Width, RawImage3.Height); birdsEye4 = new BirdsEye(ALPHA, LENGTH, srcTopY, RawImage4.Width, RawImage4.Height); if (_capture != null) //if camera capture has been successfully created { _capture.ImageGrabbed += ProcessFrame; _capture.Start(); } if (_capture2 != null) //if camera capture has been successfully created { _capture2.ImageGrabbed += ProcessFrame; _capture2.Start(); } if (_capture3 != null) //if camera capture has been successfully created { _capture3.ImageGrabbed += ProcessFrame; _capture3.Start(); } if (_capture4 != null) //if camera capture has been successfully created { _capture4.ImageGrabbed += ProcessFrame; _capture4.Start(); } }