상속: MonoBehaviour
예제 #1
0
        private void View_KeysetInfo_Click(object sender, RoutedEventArgs e)
        {
            KeysetItems.ItemsSource = null; // clear table

            List <RspKeysetInfo> keyset = null;

            try
            {
                keyset = Interact.ViewKeysetTaggingInfo(Settings.SelectedDevice);
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("Error -- {0}", ex.Message), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            if (keyset != null)
            {
                KeysetItems.ItemsSource = keyset;

                KeysetItems.Items.SortDescriptions.Add(new SortDescription("KeysetId", ListSortDirection.Ascending));

                MessageBox.Show(string.Format("{0} keyset(s) returned", keyset.Count), "Information", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
예제 #2
0
 public act(Interact inter)
 {
     this.inter  = inter;
     this.dir    = Direction.NONE;
     this.boxdir = Direction.NONE;
     this.box    = 255;
 }
예제 #3
0
 public override IEnumerator InteractObject(Camera playerCam, float raycastDistance, LayerMask layerMaskPickup)
 {
     Debug.Log("has object so now what to do");
     Interact.heldObject.Putdown(Interact.playerCam.transform.forward, Interact.throwStrength);
     Interact.SetState(new NoObjectState(Interact));
     yield break;
 }
예제 #4
0
 public virtual void SetMoM(GameObject mom, Color tc)
 {
     isActive = true;
     myMoM    = mom.GetComponent <Interact>();
     teamID   = myMoM.teamID;
     GetComponentsInChildren <SpriteRenderer>()[1].material.color = tc;
 }
예제 #5
0
 public act(Interact inter, Direction dir, Direction boxdir, int box)
 {
     this.inter  = inter;
     this.dir    = dir;
     this.boxdir = boxdir;
     this.box    = box;
 }
예제 #6
0
 public void BeginPickup(Player plr)
 {
     if (_carrier == null)
     {
         if (plr.IsMounted)
         {
             plr.Dismount();
         }
         if (_pickupTime != 0)
         {
             Interact interact = null;
             lock (_interacting)
             {
                 if (!_interacting.Any(e => e.Player == plr))
                 {
                     interact = new Interact(this, plr, null);
                     _interacting.Add(interact);
                 }
             }
             if (interact != null)
             {
                 plr.KneelDown(Oid, true, (ushort)_pickupTime);
                 plr.EvtInterface.AddEventNotify(EventName.OnMove, OnPlayerMove);
                 plr.EvtInterface.AddEventNotify(EventName.OnDie, OnPlayerDied);
                 plr.EvtInterface.AddEventNotify(EventName.OnReceiveDamage, OnPlayerDamage);
                 interact.Del = new EventDelegateEx(OnPickedUp);
                 EvtInterface.AddEvent(interact.Del, _pickupTime, 1, plr);
             }
         }
         else
         {
             Pickup(plr);
         }
     }
 }
예제 #7
0
    public void Buff()
    {
        if (AI.KnownSpell && !ObjectManager.Me.HaveBuff("Arcane Intellect") && ObjectManager.Me.ManaPercentage > 70)
        {
            Interact.InteractGameObject(ObjectManager.Me.GetBaseAddress);
            AI.Launch();
            Lua.LuaDoString("ClearTarget();");
        }

        if (FrostArmor.KnownSpell && !ObjectManager.Me.HaveBuff("Frost Armor") && ObjectManager.Me.ManaPercentage > 70)
        {
            Interact.InteractGameObject(ObjectManager.Me.GetBaseAddress);
            FrostArmor.Launch();
            Lua.LuaDoString("ClearTarget();");
        }

        if (ConjureWater.KnownSpell && ItemsManager.GetItemCountByIdLUA(5350) <= 4 && ItemsManager.GetItemCountByIdLUA(2288) <= 4 && ItemsManager.GetItemCountByIdLUA(2136) <= 4 && ItemsManager.GetItemCountByIdLUA(3772) <= 4 && ItemsManager.GetItemCountByIdLUA(8077) <= 4 && ItemsManager.GetItemCountByIdLUA(8078) <= 4 && ObjectManager.Me.ManaPercentage > 70 && !Fight.InFight)
        {
            SpellManager.CastSpellByNameLUA("Conjure Water");
        }

        if (ConjureFood.KnownSpell && ItemsManager.GetItemCountByIdLUA(5349) <= 4 && ItemsManager.GetItemCountByIdLUA(1113) <= 4 && ItemsManager.GetItemCountByIdLUA(1114) <= 4 && ItemsManager.GetItemCountByIdLUA(1487) <= 4 && ItemsManager.GetItemCountByIdLUA(8075) <= 4 && ItemsManager.GetItemCountByIdLUA(8076) <= 4 && ObjectManager.Me.ManaPercentage > 70 && !Fight.InFight)
        {
            SpellManager.CastSpellByNameLUA("Conjure Food");
        }
    }
예제 #8
0
    private void ChangeUniverseInternal()
    {
        if (items.Count == 0)
        {
            print("GM ChangeUniverse need items");
            return;
        }

        foreach (GameObject lastItem in lastItems)
        {
            if (!playerState.inventory.Contains(lastItem) &&
                !helperStructureState.inventory.Contains(lastItem) &&
                !platformStructureState.inventory.Contains(lastItem) &&
                !rocketStructureState.inventory.Contains(lastItem) &&
                !items.Contains(lastItem))
            {
                Destroy(lastItem);
            }

            if (items.Contains(lastItem))
            {
                lastItem.SetActive(false);
            }
        }

        lastItems.Clear();
        alreadyPositioned.Clear();
        items         = items.OrderBy(x => Random.value).ToList();
        itemPositions = itemPositions.OrderBy(x => Random.value).ToList();

        foreach (GameObject item in items)
        {
            GameObject obj = item;
            if (!firstGeneration)
            {
                obj = Instantiate(item);
            }
            lastItems.Add(obj);
            obj.transform.parent = parentOfItems;
            obj.SetActive(false);

            Interact interactScript = obj.GetComponent <Interact>();
            if (interactScript.interactName == "gate_complex" ||
                interactScript.interactName == "satelliteDish_detailed" ||
                interactScript.interactName == "machine_barrel" ||
                interactScript.interactName == "machine_generator" ||
                interactScript.interactName == "barrels")
            {
                RelocateObj(obj);
            }
            else
            {
                if (alreadyPositioned.Count < itemPositions.Count - 5)
                {
                    RelocateObj(obj);
                }
            }
        }
        firstGeneration = false;
    }
예제 #9
0
        private void Info_Button_Click(object sender, RoutedEventArgs e)
        {
            string apVersion = string.Empty;
            string fwVersion = string.Empty;
            string uniqueId  = string.Empty;
            string model     = string.Empty;
            string hwRev     = string.Empty;
            string serialNum = string.Empty;

            try
            {
                apVersion = Interact.ReadAdapterProtocolVersion(Settings.Port);
                fwVersion = Interact.ReadFirmwareVersion(Settings.Port);
                uniqueId  = Interact.ReadUniqueId(Settings.Port);
                model     = Interact.ReadModel(Settings.Port);
                hwRev     = Interact.ReadHardwareRevision(Settings.Port);
                serialNum = Interact.ReadSerialNumber(Settings.Port);
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("Error -- {0}", ex.Message), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            MessageBox.Show(string.Format("Adapter Protocol: {1}{0}Firmware Version: {2}{0}Unique ID: {3}{0}Model: {4}{0}Hardware Revision: {5}{0}Serial Number: {6}", Environment.NewLine, apVersion, fwVersion, uniqueId, model, hwRev, serialNum), "Information", MessageBoxButton.OK, MessageBoxImage.Information);
        }
예제 #10
0
        public IEnumerator CheckAppendText()
        {
            yield return(null);

            Interact.AppendText("container/InputField", "appednend text");
            Interact.SetText("container/InputField", "appednend text");

            try
            {
                Interact.SetText("container/Text", "appednend text");
                Assert.Fail();
            }
            catch (AssertionException ex)
            {
                if (!ex.Message.EndsWith("have not InputField component."))
                {
                    throw;
                }
            }

            try
            {
                Interact.AppendText("container/Text", "appednend text");
                Assert.Fail();
            }
            catch (AssertionException ex)
            {
                if (!ex.Message.EndsWith("have not InputField component."))
                {
                    throw;
                }
            }
        }
예제 #11
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            Ray        ray = cam.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;

            if (Physics.Raycast(ray, out hit, 100, movemask))
            {
                motor.MoveToPoint(hit.point);

                //Move player to what hit
                removeFocus();

                //stop focus
            }
        }
        if (Input.GetMouseButtonDown(1))
        {
            Ray        ray = cam.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit;

            if (Physics.Raycast(ray, out hit, 100))
            {
                Interact interact = hit.collider.GetComponent <Interact>();
                if (interact != null)
                {
                    SetFocus(interact);
                }
            }
        }
    }
예제 #12
0
        public AdventureCommandRegistry(IReadonlyAdventureGame game)
        {
            var lookCommand      = new Look(game, "look", "l");
            var helpCommand      = new Help(game, "help");
            var moveCommand      = new Move(game, "move", "go", "walk", "run", "climb", "crawl");
            var takeCommand      = new Take(game, "take", "get", "grab");
            var dropCommand      = new Drop(game, "drop");
            var magicWord1       = new Xyzzy(game, "xyzzy");
            var magicWord2       = new Plugh(game, "plugh");
            var inventoryCommand = new Carrying(game, "inventory", "inv");
            var interactCommand  = new Interact(game, "use"); // Do not add aliases for this command
            var yes = new Yes(game, "yes", "y");
            var no  = new No(game, "no", "n");
            var say = new Say(game, "say");

            RegisteredCommands = new List <IAdventureCommand> {
                lookCommand,
                helpCommand,
                moveCommand,
                takeCommand,
                dropCommand,
                magicWord1,
                magicWord2,
                inventoryCommand,
                interactCommand,
                yes,
                no,
                say,
            };
        }
예제 #13
0
 public override IEnumerator Start()
 {
     Interact.isHolding = false;
     Debug.Log("in start of begin");
     Interact.SetState(new NoObjectState(Interact));
     yield break;
 }
예제 #14
0
    public override IEnumerator InteractObject(Camera playerCam, float raycastDistance, LayerMask layerMaskPickup)
    {
        Debug.Log("no object so find object");
        bool foundObject = false;

        RaycastHit hit;

        if (Physics.Raycast(playerCam.transform.position, playerCam.transform.forward, out hit, raycastDistance, layerMaskPickup))
        {
            if (hit.collider.gameObject.GetComponent <InteractObject>() != null)
            {
                foundObject = true;
                Debug.Log("found an interact object");
                Interact.heldObject = hit.collider.gameObject.GetComponent <InteractObject>();
                //Interact.heldObject.interactObject = hit.collider.gameObject.GetComponent<InteractObject>;
            }

            Debug.DrawRay(playerCam.transform.position, playerCam.transform.forward * hit.distance, Color.red, 20);
            Debug.Log("hit name: " + hit.collider.gameObject.name);
        }

        if (foundObject)
        {
            Interact.SetState(new HasObjectState(Interact));
        }

        yield break;
    }
예제 #15
0
        private void View_KmfRsi_Click(object sender, RoutedEventArgs e)
        {
            // First get KMF RSI
            try
            {
                int rsi = new int();
                rsi = Interact.ViewKmfRsi(Settings.Port);
                //MessageBox.Show("KMF RSI: " + result + " (0x" + string.Format("{0:X}", result) + ")", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
                txtKmfRsiDec.Text = rsi.ToString();
                txtKmfRsiHex.Text = string.Format("{0:X}", rsi);

                // Next get MNP for KMF
                int mnp = -1;
                try
                {
                    mnp = Interact.ViewMnp(Settings.Port);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Format("Error -- {0}", ex.Message), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }

                txtMnpDec.Text = mnp.ToString();
                txtMnpHex.Text = string.Format("{0:X}", mnp);
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("Error -- {0}", ex.Message), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
        }
예제 #16
0
        internal static void Register()
        {
            FunctionHandling.ClearDelegates();
            uint CustomFuncTramps = 0x0047FA7D;

            CustomFuncs.About.Init(ref CustomFuncTramps);
            //CustomFuncs.SuperFly.Init(ref CustomFuncTramps);
            //CustomFuncs.AddToZ.Init(ref CustomFuncTramps);
            CustomFuncs.Commands.Init(ref CustomFuncTramps);
            //Wallclimb.Init(ref CustomFuncTramps);

            CustomFuncTramps = 0x0047FA99;

            //Console.ReadLine();
            NoClip1.Init(ref CustomFuncTramps);
            NoClip2.Init(ref CustomFuncTramps);
            NoClip3.Init(ref CustomFuncTramps);
            //NoClip4.Init(ref CustomFuncTramps);
            Loot.Init(ref CustomFuncTramps);
            UseItem.Init(ref CustomFuncTramps);
            UseSpell.Init(ref CustomFuncTramps);
            UseObject.Init(ref CustomFuncTramps);
            Interact.Init(ref CustomFuncTramps);
            Thanks.Init(ref CustomFuncTramps);
            AutoLoot.Init(ref CustomFuncTramps);
            SaveBars.Init(ref CustomFuncTramps);

            CustomFuncTramps = 0x0047FA61;

            LoadBars.Init(ref CustomFuncTramps);
            RemoveBars.Init(ref CustomFuncTramps);

            DirectX.FirstRun = 1;
        }
예제 #17
0
        private void SelectDevice(MenuItem mi)
        {
            if (mi != null)
            {
                foreach (MenuItem item in DeviceMenu.Items)
                {
                    item.IsChecked = false;
                }

                string verStr = string.Empty;

                try
                {
                    verStr = Interact.ReadAdapterProtocolVersion(mi.Name);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Format("Error -- {0}", ex.Message), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                    return;
                }

                if (verStr == "1.0.0")
                {
                    mi.IsChecked = true;

                    Settings.Port = mi.Name;

                    lblSelectedDevice.Text = string.Format("Selected Device: {0}", Settings.Port);
                }
                else
                {
                    MessageBox.Show("Adapter protocol version not compatible", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
예제 #18
0
    public void AssignMirrors(int goalMirror, List <MirrorPositionInfo> mirrors, GameObject circle, GameObject square, GameObject diamond, List <MirrorProperties> props, GameObject player)
    {
        for (int i = 0; i < mirrors.Count; i++)
        {
            string color  = props[i].color;
            string shape  = props[i].shape;
            string number = props[i].number;

            GameObject newMirror = CreateMirror(circleMirror, square, diamond, shape);
            PrepareNewMirror(newMirror, mirrors[i]);
            ChangeColor(newMirror, color);

            GameObject        textComp = newMirror.transform.GetChild(4).gameObject;
            TMPro.TextMeshPro textMesh = textComp.GetComponent <TMPro.TextMeshPro>();
            textMesh.text = number;

            GameObject collideArea    = newMirror.transform.GetChild(5).gameObject;
            Interact   interactObject = collideArea.GetComponent <Interact>();
            interactObject.player = player;
            interactObject.goal   = false;
            if (i == goalMirror)
            {
                interactObject.goal = true;
            }
        }
    }
예제 #19
0
    private bool isActionInUse = false; //to make sure if you keep pressing it, it doesn't keep triggering


    void Update()
    {
        if (Input.GetAxis("Action") == 1)   //if you press the action (space) key

        {
            if (isActionInUse == false)
            {
                isActionInUse = true;

                if (canInteract)
                {
                    selectedInteractee = FindInteractee();
                    if (selectedInteractee != null)
                    {
                        selectedInteractee.Interacting();
                    }
                }
            }
        }

        if (Input.GetAxis("Action") == 0)
        {
            isActionInUse = false;
        }
    }
예제 #20
0
    //Interaction Handling
    void MouseOverInteractable()
    {
        Ray        mouseSearch = Camera.main.ScreenPointToRay(Input.mousePosition);
        RaycastHit canInteract;

        if (Physics.Raycast(mouseSearch, out canInteract))
        {
            if (canInteract.collider.tag == "NPC" || canInteract.collider.tag == "Player" || canInteract.collider.tag == "Objective")
            {
                Interact interactable = canInteract.collider.GetComponent <Interact>();
                interestTime = interestTime + 1 * Time.deltaTime;

                if (interestTime >= 3)
                {
                    Debug.Log("The information about this object will be shown... One day...");
                }
                else
                {
                    return;
                }
            }
            else
            {
                interestTime = 0f;
            }
        }
    }
예제 #21
0
 void Start()
 {
     hinge        = transform.Find("Hinge");
     defaultAngle = angle;
     i            = FindObjectOfType <Interact>();
     au           = FindObjectOfType <AudioManager>();
 }
예제 #22
0
        public void Initialise(PlayerReader playerReader, RequirementFactory requirementFactory, ILogger logger)
        {
            Pull.Initialise(playerReader, requirementFactory, logger);
            Combat.Initialise(playerReader, requirementFactory, logger);
            Adhoc.Initialise(playerReader, requirementFactory, logger);
            Parallel.Initialise(playerReader, requirementFactory, logger);
            ShapeshiftForm.ForEach(i => i.Initialise(playerReader, requirementFactory, logger));

            Interact.Key = InteractKey;
            Interact.Initialise(playerReader, requirementFactory, logger);

            if (string.IsNullOrEmpty(Blink.Key))
            {
                Blink.Key = " ";
            }
            Blink.Initialise(playerReader, requirementFactory, logger);

            TargetLastTarget.Key = TargetLastTargetKey;
            TargetLastTarget.Initialise(playerReader, requirementFactory, logger);

            GatherFindKeys.ForEach(key =>
            {
                GatherFindKeyConfig.Add(new KeyAction {
                    Key = key
                });
                GatherFindKeyConfig.Last().Initialise(playerReader, requirementFactory, logger);
            });
        }
예제 #23
0
        public void StartServer()
        {
            IPAddress address = Array.Find(Dns.GetHostEntry(string.Empty).AddressList, a => a.AddressFamily == AddressFamily.InterNetwork);

            Console.WriteLine(address.ToString());

            Server server = new Server
            {
                Services = { Interact.BindService(new InteractImpl()) },
                Ports    =
                {
                    new ServerPort("localhost",        Port, ServerCredentials.Insecure),
                    new ServerPort(address.ToString(), Port, ServerCredentials.Insecure)
                }
            };

            server.Start();
            string balancerIP;

            do
            {
                Console.Write("Enter Balancer ip: ");
                balancerIP = Console.ReadLine();
            } while (!InitialiseBalancer(address.ToString(), balancerIP));

            Thread updater = new Thread(() => UpdateBalancer(address.ToString(), balancerIP));

            updater.Start();

            Console.WriteLine("Game server listening on port " + Port);
            Console.WriteLine("Press any key to stop the server...");
            Console.ReadKey();

            server.ShutdownAsync().Wait();
        }
예제 #24
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetMouseButtonDown(0))
     {
         Ray        ray = cam.ScreenPointToRay(Input.mousePosition);
         RaycastHit hit;
         if (Physics.Raycast(ray, out hit, 100, movementMask))
         {
             motor.MoveToPoint(hit.point);
             RemoveFocus();
         }
     }
     if (Input.GetMouseButton(1))
     {
         Ray        ray = cam.ScreenPointToRay(Input.mousePosition);
         RaycastHit hit;
         if (Physics.Raycast(ray, out hit, 100))
         {
             Interact interactable = hit.collider.gameObject.GetComponent <Interact>();
             if (interactable != null)
             {
                 SetFocus(interactable);
             }
         }
     }
 }
예제 #25
0
    public void PickUp()
    {
        // get nearest
        current = GetNearest();

        // null check
        if (!current)
        {
            return;
        }

        // already held
        if (current.activeHand)
        {
            current.activeHand.Drop();
        }

        // position
        current.transform.position = transform.position;

        // rotation
        current.transform.rotation = Quaternion.LookRotation(transform.forward);

        // attach
        Rigidbody target = current.GetComponent <Rigidbody>();

        joint.connectedBody = target;

        // set active hand
        current.activeHand = this;
    }
예제 #26
0
        private void ViewRsiItems()
        {
            dgRsiItems.ItemsSource = null; // clear table

            List <RspRsiInfo> items = null;

            try
            {
                items = Interact.ViewRsiItems(Settings.SelectedDevice);
                //Console.WriteLine(items.Count + " result");
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("Error -- {0}", ex.Message), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            if (items != null)
            {
                dgRsiItems.ItemsSource = items;

                dgRsiItems.Items.SortDescriptions.Add(new SortDescription("RSI", ListSortDirection.Ascending));
                dgRsiItems.Items.SortDescriptions.Add(new SortDescription("MN", ListSortDirection.Ascending));

                //MessageBox.Show(string.Format("{0} RSI(s) returned", items.Count), "Information", MessageBoxButton.OK, MessageBoxImage.Information);
            }

            txtRsiOldDec.Text = string.Empty;
            txtRsiOldHex.Text = string.Empty;
            txtRsiNewDec.Text = string.Empty;
            txtRsiNewHex.Text = string.Empty;
            txtMnpDec.Text    = string.Empty;
            txtMnpHex.Text    = string.Empty;
        }
예제 #27
0
        public async Task InvokeAsync(HttpContext context)
        {
            if (context.Request.Path == _path)
            {
                if (context.WebSockets.IsWebSocketRequest)
                {
                    var webSocket = await context.WebSockets.AcceptWebSocketAsync();

                    using (var cntx = new Interact(webSocket))
                    {
                        await _handler.Run(cntx);

                        await cntx.Close(CancellationToken.None);
                    }
                }
                else
                {
                    context.Response.StatusCode = 400;
                }
            }
            else
            {
                await _next(context);
            }
        }
예제 #28
0
        private void ST_Button_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult messageBoxResult = MessageBox.Show(string.Format("Radio must be disconnected{0}{0}Continue?", Environment.NewLine), "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning);

            if (messageBoxResult == MessageBoxResult.No)
            {
                return;
            }

            string result = string.Empty;

            try
            {
                result = Interact.SelfTest(Settings.Port);
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("Error -- {0}", ex.Message), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            if (result == string.Empty)
            {
                MessageBox.Show("Self Test Passed", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                MessageBox.Show(string.Format("Error -- {0}", result), "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
예제 #29
0
        public override void Run()
        {
            if (!_enRoute)
            {
                MovementManager.StopMove();
                Logging.Write("Nearby Flight Master " + _flightMaster.Name + " (" + _flightMaster.Entry + ") is not yet discovered.");
            }
            _enRoute = true;
            Npc target = new Npc
            {
                Entry          = _flightMaster.Entry,
                Position       = _flightMaster.Position,
                Name           = _flightMaster.Name,
                ContinentIdInt = Usefuls.ContinentId,
                Faction        = ObjectManager.ObjectManager.Me.PlayerFaction.ToLower() == "horde" ? Npc.FactionType.Horde : Npc.FactionType.Alliance,
            };
            uint baseAddress = MovementManager.FindTarget(ref target, 5.0f);

            if (MovementManager.InMovement)
            {
                return;
            }
            if (_flightMaster.GetDistance > 5)
            {
                return;
            }
            if (baseAddress > 0)
            {
                MovementManager.StopMove(); // avoid a red wow error
                Thread.Sleep(150);
                Interact.InteractWith(baseAddress);
            }
        }
예제 #30
0
 public void Buff()
 {
     if (PowerWordFortitude.KnownSpell && !ObjectManager.Me.HaveBuff("Power Word: Fortitude"))
     {
         Interact.InteractGameObject(ObjectManager.Me.GetBaseAddress);
         PowerWordFortitude.Launch();
     }
     if (InnerFire.KnownSpell && !ObjectManager.Me.HaveBuff("Inner Fire"))
     {
         InnerFire.Launch();
     }
     if (ShadowProtection.KnownSpell && !ObjectManager.Me.HaveBuff("Shadow Protection"))
     {
         Interact.InteractGameObject(ObjectManager.Me.GetBaseAddress);
         ShadowProtection.Launch();
     }
     if (Shadowform.KnownSpell && !ObjectManager.Me.HaveBuff("Shadowform"))
     {
         Shadowform.Launch();
     }
     if (Renew.KnownSpell && !ObjectManager.Me.HaveBuff("Renew") && !ObjectManager.Me.HaveBuff("Shadowform") && ObjectManager.Me.HealthPercent <= 70 && ObjectManager.Me.ManaPercentage > 10)
     {
         Interact.InteractGameObject(ObjectManager.Me.GetBaseAddress);
         Renew.Launch();
     }
 }
    private void ResetParameters()
    {
        if(interactableObject != null)
        {
            interactableObject.HideInteractableUI();
        }

        lastGameObjectID = 0;
        interactableObject = null;
    }
예제 #32
0
        public MyCoolBook(string name) : base(name)
        {
            // Create interact on the relevant thread, and start it!
            new Thread(delegate()
                           {
                               visuals = new Interact("CoolBook Beta");
                               visuals.InputEvent += OnInput;
                               visuals.FormClosed += OnFormClosed;
                               Application.Run(visuals);
                           }).Start();
            community[name] = this;
            while (visuals == null)
            {
                Application.DoEvents();
                Thread.Sleep(100);
            }

            Add("Welcome to CoolBook " + Name);
        }
    private void Update()
    {
        // Raycast Hit Information
        RaycastHit hit;

        // Debug To See Where The Ray Currently Is

        // Raycast To Search For Interactable Objects
        // On Fail. It Just Resets Parameters
        // On Success Check That The Object Is Interactable
        //	- If Not Then Reset Parameters
        //  - On Success Show UI And Set Up Parameters
        if(Physics.Raycast(cameraTransform.position, cameraTransform.forward, out hit, interactionDistance, raycastMask))
        {
            Debug.DrawLine(cameraTransform.position, hit.point, Color.green);

            int objID = hit.collider.gameObject.GetInstanceID();
            if(lastGameObjectID != objID)
            {
                if(interactableObject != null)
                    interactableObject.HideInteractableUI();

                interactableObject = hit.collider.GetComponent<Interact>();

                if(interactableObject == null)
                {
                    ResetParameters();
                    return;
                }else
                {
                    lastGameObjectID = objID;
                    interactableObject.ShowInteractableUI();
                    return;
                }
            }
        }else
        {
            Debug.DrawRay(cameraTransform.position, cameraTransform.forward * interactionDistance, Color.red);
            ResetParameters();
            return;
        }
    }
예제 #34
0
파일: SwitchScript.cs 프로젝트: theiis/PGP2
 void Start()
 {
     anima = GetComponent<Animation> ();
     interact = GetComponent <Interact>();
 }
 // Use this for initialization
 void Start()
 {
     interact = GetComponent<Interact>();
 }
예제 #36
0
    void Start()
    {
        endPos = Quaternion.Euler (rot [0], rot [1], rot [2]);

        Interact = lever.GetComponent<Interact> ();
    }
예제 #37
0
파일: TorchScript.cs 프로젝트: theiis/PGP2
 void Start()
 {
     interact = gameObject.GetComponent<Interact>();
     lightLight.enabled = false;
     timeTillEgnition = Random.Range (0,3);
 }
예제 #38
0
 public Colleague(Mediator mediator, string name)
 {
     this.name = name;
     visuals = new Interact(name);
     mediator.SignOn(name, Receive, visuals);
 }
예제 #39
0
 public void SignOn(string name, Callback Receive, Interact visuals)
 {
     // Add the Colleague to the delegate chain
     Respond += Receive;
     new Thread((ParameterizedThreadStart)delegate(object o)
     {
         visuals.InputEvent += Send;
         Application.Run(visuals);
     }).Start(this);
     // Wait to load the GUI
     while (visuals == null || !visuals.IsHandleCreated)
     {
         Application.DoEvents();
         Thread.Sleep(100);
     }
 }
예제 #40
0
	// Use this for initialization
	void Start ()
	{
		Instance = this;
	}
예제 #41
0
파일: OpenAction2.cs 프로젝트: theiis/PGP2
 void Start()
 {
     interact = GetComponent<Interact>();
     animationA = GetComponent<Animation>();
 }
예제 #42
0
    void Start()
    {
        toast = FindObjectOfType (typeof(Toast)) as Toast;

        texts [(int)(State.SitDown)] = textSitDown;
        texts [(int)(State.FallDown)] = textFallDown;
        texts [(int)(State.StandUp)] = textStandUp;
        texts [(int)(State.LeftArm)] = textLeftArm;
        texts [(int)(State.RightArm)] = textRightArm;

        goDog = GameObject.FindGameObjectWithTag ("dog");
        interact = FindObjectOfType (typeof(Interact)) as Interact;

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);
        speechPlugin.setSpeechEventListener(onReadyForSpeech,onBeginningOfSpeech,onEndOfSpeech,onError,onResults);
    }
 // Use this for initialization
 void Start()
 {
     interact = GetComponent<Interact>();
     counter = timerText.GetComponent<Counter>();
 }
예제 #44
0
        public Observer(Subject subject, string name)
        {
            blogs = subject;
            this.name = name;
            visuals = new Interact(name, Input);
            new Thread(delegate(object o) { Application.Run(visuals); }).Start(this);

            // Wait to load the GUI
            while (visuals == null || !visuals.IsHandleCreated)
            {
                Application.DoEvents();
                Thread.Sleep(100);
            }
            blogs.Attach("Jim", Update);
            blogs.Attach("Eric", Update);
            blogs.Attach("Judith", Update);
        }