Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        thePlayer = GameObject.Find("Pig");
        pigFly    = thePlayer.GetComponent <fly>();
        string toprint = "You have " + pigFly.life + " lives left";

        myText.text = toprint;
    }
Esempio n. 2
0
    void Start()
    {
        this.fly_instance = GameObject.FindObjectOfType <fly>();

        this.camera_main   = Camera.main;
        this.camera_height = this.camera_main.pixelHeight;

        this.camera_margin_bottom = this.camera_height * this.margin_bottom;
        this.camera_margin_top    = this.camera_height - (this.camera_height * this.margin_top);
    }
Esempio n. 3
0
    void Start()
    {
        if (fly.instance != null)
        {
            DestroyImmediate(this.gameObject);
        }

        fly.instance = this;

        this.camera_main        = Camera.main;
        this.transform.position = Random.insideUnitCircle.normalized * 30.0f;
    }
Esempio n. 4
0
    void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.name == "Player")
        {
            flyScript = other.gameObject.GetComponent <fly>();

            flyScript.enabled = false;

            movementScript = other.gameObject.GetComponent <FirstPersonController>();
            movementScript.setFlying(false);
            movementScript.setJump(false);
            StartCoroutine(movementScript.fadeFallSound());
        }
    }
Esempio n. 5
0
        public void init()
        {
            Process[] teardowns = Process.GetProcessesByName("teardown");
            if (teardowns.Length > 0)
            {
                //calculate nessicary offsets
                Process process;
                IntPtr  handle;
                Int64   playerInstance;
                Int64   gameInstance;
                Int32   processHandle;
                Int64   sceneInstance;

                process = teardowns[0];
                handle  = OpenProcess(PROCESS_ALL_ACCESS, false, process.Id);

                Byte[] buffer    = new Byte[8];
                Int32  bytesRead = 0;
                processHandle = (Int32)handle;

                dbgTxt.AppendText("     Entrypoint : 0x" + processHandle.ToString("X"));
                dbgTxt.AppendText(Environment.NewLine);

                Int64 baseAddress = process.MainModule.BaseAddress.ToInt64() + 0x003E4520;
                buffer = new byte[8];
                ReadProcessMemory(processHandle, baseAddress, buffer, buffer.Length, ref bytesRead);
                gameInstance = BitConverter.ToInt64(buffer, 0);

                dbgTxt.AppendText("  Game instance : 0x" + gameInstance.ToString("X"));
                dbgTxt.AppendText(Environment.NewLine);

                buffer = new byte[8];
                Int64 playerPtr = gameInstance + 0xA0;
                ReadProcessMemory(processHandle, playerPtr, buffer, buffer.Length, ref bytesRead);
                playerInstance = BitConverter.ToInt64(buffer, 0);

                dbgTxt.AppendText("Player instance : 0x" + playerInstance.ToString("X"));
                dbgTxt.AppendText(Environment.NewLine);

                buffer = new byte[8];
                Int64 scenePtr = gameInstance + 0x40;
                ReadProcessMemory(processHandle, scenePtr, buffer, buffer.Length, ref bytesRead);
                sceneInstance = BitConverter.ToInt64(buffer, 0);

                dbgTxt.AppendText(" Scene instance : 0x" + sceneInstance.ToString("X"));
                dbgTxt.AppendText(Environment.NewLine);

                int read_vcount = 0;
                ReadProcessMemory(processHandle, sceneInstance + 0x530, origionalWallCode, origionalWallCode.Length, ref read_vcount);

                //create the offsetpackage
                pack = new offsetPackage(process, handle, playerInstance, gameInstance, processHandle, sceneInstance);

                byte[] defSpeed = BitConverter.GetBytes(1f);
                WriteProcessMemory(pack.processHandle, pack.playerInstance + 0x0160, defSpeed, defSpeed.Length, ref bytesRead); //put default speed value into unused memory for later

                //initialise mods
                removeBoundaries = new removeBoundaries(pack);
                teleport         = new teleport(pack);
                jetpack          = new jetpack(pack);
                immortality      = new immortality(pack);
                step             = new step(pack);
                fly    = new fly(pack);
                slowmo = new slowmo(pack);

                this.Text         = "Teardown diddler [ACTIVE]";
                tc.Enabled        = true;
                gbReapply.Enabled = true;

                updateCurrentPositions.Start();
            }
            else
            {
                this.Text = "Teardown diddler [INACTIVE]";
            }
        }
Esempio n. 6
0
        private void btnAddflight_Click(object sender, EventArgs e)
        {
            string   company = cbCompany.Text;
            int      gates   = Convert.ToInt32(cbGate.Text);
            int      runways = int.Parse(cbRunway.Text);
            DateTime dates   = dtpDate.Value;

            DateTime x30MinsLater = dates.AddMinutes(30);
            DateTime x30Minsbefor = dates.AddMinutes(-30);


            var checkflygate = Airpot.fly.Where(x => x.Date >= x30Minsbefor && x.Date <= x30MinsLater && x.Gate.Number == gates).ToList();

            DateTime x45MinsLater = dates.AddMinutes(45);
            DateTime x45Minsbefor = dates.AddMinutes(-45);

            var checkflyrunway = Airpot.fly.Where(x => x.Date >= x45Minsbefor && x.Date <= x45MinsLater && x.Runway.stripe == runways).ToList();



            if (checkflygate.Count > 0 || checkflyrunway.Count > 0)
            {
                if (checkflygate.Count > 0 && checkflyrunway.Count > 0)
                {
                    MessageBox.Show(cbGate.Text + " qapi ve " + cbRunway.Text + " stript doludur ");
                }
                else if (checkflygate.Count > 0)
                {
                    MessageBox.Show(cbGate.Text + " qapi ve ");
                }
                else if (checkflyrunway.Count > 0)
                {
                    MessageBox.Show(cbRunway.Text + " stript doludur ");
                }
            }
            else
            {
                fly flight = new fly();

                Gate     gate     = Airpot.Gate.FirstOrDefault(x => x.Number == gates);
                Company  com      = Airpot.Company.FirstOrDefault(x => x.Name == company);
                Runway   runwayss = Airpot.Runway.FirstOrDefault(x => x.stripe == runways);
                City     city     = Airpot.City.FirstOrDefault(x => x.Name == cbCity.Text);
                Airports air      = Airpot.Airports.Find(1);

                flight.Company = com;
                flight.Gate    = gate;
                flight.Runway  = runwayss;
                flight.City    = city;
                flight.Date    = dates;
                flight.No      = "k44";
                if (rbArrival.Checked)
                {
                    flight.type = true;
                }
                else
                {
                    flight.type = false;;
                }

                flight.Status    = 1;
                flight.late      = DateTime.Now;
                flight.Airportid = 1;
                flight.Airports  = air;



                Airpot.fly.Add(flight);

                Airpot.SaveChanges();
                loadData();
            }
        }
Esempio n. 7
0
File: sp.cs Progetto: mraan4/Project
    //fly fly;

    // Start is called before the first frame update
    void Awake()
    {
        fly = GameObject.Find("Bird").GetComponent <fly>();
    }