Exemplo n.º 1
0
 // Token: 0x06000006 RID: 6 RVA: 0x00002810 File Offset: 0x00000A10
 public static void ToggleGlowPlayers()
 {
     EspMenu.PlayersGlow = !EspMenu.PlayersGlow;
     foreach (Player player in FindObjectsOfType <Player>())
     {
         if (!(Player.player.name == player.name))
         {
             Highlighter highlighter = player.gameObject.GetComponent <Highlighter>();
             if (!EspMenu.PlayersGlow)
             {
                 highlighter.ConstantOffImmediate();
             }
             else
             {
                 if (highlighter == null)
                 {
                     highlighter = player.gameObject.AddComponent <Highlighter>();
                 }
                 highlighter.ConstantParams(Color.red);
                 highlighter.OccluderOn();
                 highlighter.SeeThroughOn();
                 highlighter.ConstantOn();
             }
         }
     }
 }
Exemplo n.º 2
0
        public virtual void DoFocus(Selector cursor, bool state)
        {
            // OVERRIDE THIS VIRTUALLY to allow vodgets to highlight before DoGrab.
            if (state)
            {
#if USING_HIGHLIGHTING
                Highlighter h = transform.gameObject.GetComponent <Highlighter>();
                if (h != null)
                {
                    h.ConstantOn(0.1f);
                }
#endif
                cursor.Rumble(3999);
            }
            else
            {
#if USING_HIGHLIGHTING
                Highlighter h = transform.gameObject.GetComponent <Highlighter>();
                if (h != null)
                {
                    h.ConstantOff(0.1f);
                }
#endif
            }

            if (onFocus != null)
            {
                onFocus.Invoke(state);
            }
        }
    /// <summary>
    /// 开启高亮
    /// </summary>
    /// <param name="flashColor"></param>
    /// <param name="frequency">Flashing frequency (times per second)</param>
    public void ConstantOn(Color NormalColor)
    {
        //SetRendererEnable(true);
        Highlighter h = RenderObj.AddMissingComponent <Highlighter>();

        h.ConstantOn(NormalColor);
    }
    /// <summary>
    /// 开启高亮
    /// </summary>
    public void HighlightOn()
    {
        //Highlighter h = transform.parent.gameObject.AddMissingComponent<Highlighter>();
        Highlighter h = gameObject.AddMissingComponent <Highlighter>();

        h.ConstantOn(color);
    }
Exemplo n.º 5
0
 // Update is called once per frame
 // Select Mode logic is in Update()
 void Update()
 {
     if (mode != Mode.Select)
     {
         return;
     }
     if (Input.GetMouseButtonDown(0))
     {
         if (EventSystem.current.IsPointerOverGameObject())
         {
             return;                                                              //To prevent picking up clicks through UI
         }
         //Avoid / Detect Clicks Through your UI https://www.youtube.com/watch?v=rATAnkClkWU
         RaycastHit hit;
         //Send a ray from the camera to the mouseposition
         Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
         //Create a raycast from the Camera and output anything it hits
         if (Physics.Raycast(ray, out hit))
         {
             //Check the hit GameObject has a Collider
             if (hit.collider != null)
             {
                 //Click a GameObject to return that GameObject your mouse pointer hit
                 hitGO = hit.collider.gameObject;
                 print("SelectionManager.Update() ... Hit gameObject =   " + hitGO.name);
                 if (selectable.Equals(hitGO.tag))
                 {
                     selectedGO  = hitGO;
                     highlighter = selectedGO.GetComponent <Highlighter>();
                     if (highlighter != null)
                     {
                         highlighter.ConstantOn(Color.red);
                         print("SelectionManager.Update() Highlighted gameObject = " + selectedGO.name);
                         if (prevSelectedGO != selectedGO)
                         {
                             unHighlight(prevSelectedGO);
                         }
                         prevSelectedGO = selectedGO;
                     }
                 }
                 else
                 {
                     print("SelectionManager.Update() ... No Selectable tag for hit GameObject = " + hitGO.name);
                     unSelectGOS();
                 }
             }
             else
             {
                 print("SelectionManager.Update() ... hit.collider = null ");
                 unSelectGOS();
             }
         }
         else
         {
             print("SelectionManager.Update() ... hit = null ");
             unSelectGOS();
         }
     }
 }
Exemplo n.º 6
0
 public void ShowHighlighter()
 {
     mHighlight.ConstantOn(Color.red);
     if (HeroTeamMediator.heroTeamMediator == null)
     {
         PureMVC.Patterns.Facade.Instance.SendNotification(NotificationID.Fihgt_ShowOpPan, true);
     }
 }
 public void ShowHighlight()
 {
     if (_highlighter != null)
     {
         _highlighter.SeeThroughOff();
         _highlighter.ConstantOn(highlightColor);
     }
 }
Exemplo n.º 8
0
 void OnTriggerEnter(Collider other)
 {
     if (other.tag.Equals("Weapon") && !istrue)
     {
         Highlighter h = other.gameObject.GetComponent <Highlighter>();
         h.ConstantOn(Color.yellow);
     }
 }
Exemplo n.º 9
0
        private void update_Zombie() // -------------------------------- ZOMBIE UPDATE
        {
            if (esp.show_Zombies)
            {
                for (int i = 0; i < esp.zombies.Length; i++)
                {
                    if (esp.zombies[i] != null && esp.zombies[i].gameObject != null)
                    {
                        GameObject go = esp.zombies[i].gameObject;
                        if (tool_ToolZ.getDistance(go.transform.position) <= esp.distance)
                        {
                            Highlighter h = go.GetComponent <Highlighter>();
                            if (h == null)
                            {
                                h = go.AddComponent <Highlighter>();
                                h.OccluderOn();
                                h.SeeThroughOn();
                                h.ConstantOn(ctrl_Settings.esp_Zombie_color);
                                esp.ho.Add(new HighlightedObject(1, go, h));
                            }
                        }
                    }
                }

                try
                {
                    HighlightedObject[] objs = Array.FindAll(esp.ho.ToArray(), a => a.dType == 1 && a != null && a.h != null && a.go != null && a.go.transform != null && tool_ToolZ.getDistance(a.go.transform.position) > esp.distance);
                    if (objs.Length > 0)
                    {
                        for (int i = 0; i < objs.Length; i++)
                        {
                            UnityEngine.GameObject.Destroy(objs[i].h);
                            esp.ho.Remove(objs[i]);
                        }
                    }
                    wasZombie = true;
                }
                catch (Exception ex)
                {
                    Debug.LogWarning("----------------- ERROR ----------------");
                    Debug.LogException(ex);
                    Debug.LogWarning("----------------- ERROR ----------------");
                }
            }
            else if (wasZombie && !esp.show_Zombies)
            {
                HighlightedObject[] objs = Array.FindAll(esp.ho.ToArray(), a => a.dType == 1);
                for (int i = 0; i < objs.Length; i++)
                {
                    if (objs[i] != null && objs[i].h != null)
                    {
                        UnityEngine.GameObject.Destroy(objs[i].h);
                        esp.ho.Remove(objs[i]);
                    }
                }
                wasZombie = false;
            }
        }
Exemplo n.º 10
0
        private void update_Items() // --------------- ITEM UPDATE
        {
            if (esp.show_Items)
            {
                for (int i = 0; i < itemFilter.Count; i++)
                {
                    if (itemFilter[i] != null && itemFilter[i].gameObject != null && itemFilter[i].asset != null)
                    {
                        GameObject go = itemFilter[i].gameObject;
                        if (tool_ToolZ.getDistance(go.transform.position) <= esp.distance)
                        {
                            Highlighter h = go.GetComponent <Highlighter>();
                            if (h == null)
                            {
                                h = go.AddComponent <Highlighter>();
                                h.OccluderOn();
                                h.SeeThroughOn();
                                h.ConstantOn(ctrl_Settings.esp_Item_color);
                                esp.ho.Add(new HighlightedObject(3, go, h));
                            }
                        }
                    }
                }

                try
                {
                    HighlightedObject[] objs = Array.FindAll(esp.ho.ToArray(), a => a.dType == 3 && a != null && a.h != null && a.go != null && a.go.transform != null && tool_ToolZ.getDistance(a.go.transform.position) > esp.distance || (!Array.Exists(itemFilter.ToArray(), b => b.gameObject == a.go) && a.dType == 3));
                    if (objs.Length > 0)
                    {
                        for (int i = 0; i < objs.Length; i++)
                        {
                            UnityEngine.GameObject.Destroy(objs[i].h);
                            esp.ho.Remove(objs[i]);
                        }
                    }
                    wasItem = true;
                }
                catch (Exception ex)
                {
                    Debug.LogWarning("----------------- ERROR ----------------");
                    Debug.LogException(ex);
                    Debug.LogWarning("----------------- ERROR ----------------");
                }
            }
            else if (wasItem && !esp.show_Items)
            {
                HighlightedObject[] objs = Array.FindAll(esp.ho.ToArray(), a => a.dType == 3);
                for (int i = 0; i < objs.Length; i++)
                {
                    if (objs[i] != null && objs[i].h != null)
                    {
                        UnityEngine.GameObject.Destroy(objs[i].h);
                        esp.ho.Remove(objs[i]);
                    }
                }
                wasItem = false;
            }
        }
Exemplo n.º 11
0
 public void lightOn(Color color)
 {
     if (highlighter == null)
     {
         return;
     }
     curColor = color;
     highlighter.ConstantOn(color);
     state = HighligerState.On;
 }
Exemplo n.º 12
0
        private static void Modify(Part part, Color color, bool recursive)
        {
            // Update the part with the requested settings.
            part.SetHighlightColor(color);
            part.SetHighlight(true, recursive);

            Highlighter highlighter = part.highlighter;

            highlighter.SeeThroughOn();
            highlighter.ConstantOn(color);
        }
Exemplo n.º 13
0
        IEnumerator <float> _Constant(Color color1, float time, float duration = 1.0f)
        {
            if (highlighter == null)
            {
                yield break;
            }
            highlighter.ConstantOn(color1, time);
            yield return(Timing.WaitForSeconds(duration));

            highlighter.ConstantOff(time);
        }
Exemplo n.º 14
0
 //
 private void UpdateInternal()
 {
     if (revealCount > 0)
     {
         h.ConstantOn(revealColor);
     }
     else
     {
         h.ConstantOff();
     }
 }
Exemplo n.º 15
0
 // Update is called once per frame
 void Update()
 {
     if (Show)
     {
         hlighter.ConstantOn(Color.white);
     }
     else
     {
         hlighter.ConstantOff();
     }
 }
Exemplo n.º 16
0
    public void HighlightAndDehighlight(Color color)
    {
        highlighter.ConstantOn(color, 1);

        originalEmissionColor = instadMaterial.GetColor("_EmissionColor");

        iTween.ValueTo(gameObject, iTween.Hash("from", originalEmissionColor, "to", color, "time", 1, "onupdate", "OnEmissionUpdate"));
//		colorTweener = instadMaterial.DOColor (color, "_EmissionColor", 1f);
//		meshRenderer.material.SetColor(,);
        StartCoroutine(DeHighlight(1.5f));
    }
Exemplo n.º 17
0
 // Complete this graffiti.
 private void Complete()
 {
     highlighter.FlashingOff();
     highlighter.ConstantOn(Color.yellow);
     GetComponent <Animator>().Play("Completed");
     completed    = true;
     mask.texture = new Texture2D((int)mask.size.x, (int)mask.size.y);
     if (OnCompleted != null)
     {
         OnCompleted(this);
     }
 }
    // Use this for initialization
    void Start()
    {
        // hh.On(Color.green);
        //  hh.ConstantParams(Color.red);
        //  hh.FlashingOn(Color.green, Color.green);
        hh.ConstantOn(Color.yellow);

        // Turn off constant highlighting
        //hh.ConstantOffImmediate();

        // Start flashing from blue to cyan color and frequency = 2f
        // hh.FlashingOn(Color.blue, Color.cyan, 2f);
    }
Exemplo n.º 19
0
        // Token: 0x06000106 RID: 262 RVA: 0x0000A2BC File Offset: 0x000084BC
        public static void highlight(Transform target, Color color)
        {
            bool flag = !target.CompareTag("Player") || target.CompareTag("Enemy") || target.CompareTag("Zombie") || target.CompareTag("Animal") || target.CompareTag("Agent");

            if (flag)
            {
                Highlighter highlighter = target.GetComponent <Highlighter>();
                bool        flag2       = highlighter == null;
                if (flag2)
                {
                    highlighter = target.gameObject.AddComponent <Highlighter>();
                }
                highlighter.ConstantOn(color, 0.25f);
            }
        }
Exemplo n.º 20
0
        public static void highlight(Transform target, Color color)
        {
            if (target.CompareTag("Player") || target.CompareTag("Enemy") || target.CompareTag("Zombie") || target.CompareTag("Animal") || target.CompareTag("Agent"))
            {
                return;
            }
            Highlighter highlighter = target.GetComponent <Highlighter>();

            if (highlighter == null)
            {
                highlighter = target.gameObject.AddComponent <Highlighter>();
            }
            highlighter.ConstantOn(color);
            highlighter.SeeThroughOff();
        }
Exemplo n.º 21
0
 // Token: 0x06000002 RID: 2 RVA: 0x000020E8 File Offset: 0x000002E8
 private void FindObjects()
 {
     this._players = FindObjectsOfType <Player>();
     if (EspMenu.PlayersGlow)
     {
         foreach (Player player in this._players)
         {
             if (!(Player.player.name == player.name) && player.gameObject.GetComponent <Highlighter>() == null)
             {
                 Highlighter highlighter = player.gameObject.AddComponent <Highlighter>();
                 highlighter.ConstantParams(Color.red);
                 highlighter.OccluderOn();
                 highlighter.SeeThroughOn();
                 highlighter.ConstantOn();
             }
         }
     }
     this._zombies = FindObjectsOfType <Zombie>();
     if (EspMenu.ZombieGlow)
     {
         foreach (Zombie zombie in this._zombies)
         {
             if (zombie.gameObject.GetComponent <Highlighter>() == null)
             {
                 Highlighter highlighter2 = zombie.gameObject.AddComponent <Highlighter>();
                 highlighter2.ConstantParams(Color.blue);
                 highlighter2.OccluderOn();
                 highlighter2.SeeThroughOn();
                 highlighter2.ConstantOn();
             }
         }
     }
     if (EspMenu.ShowItems)
     {
         this._items = FindObjectsOfType <InteractableItem>();
     }
     if (EspMenu.ShowVehicles)
     {
         this._vehicles = FindObjectsOfType <InteractableVehicle>();
     }
 }
Exemplo n.º 22
0
        static void Postfix(MapObjectView __instance, Highlighter ___m_Highlighter)
        {
            var self = __instance;

            if (___m_Highlighter == null || self.GetComponent <DetectedSecretComponent>() == null)
            {
                return;
            }
            try {
                // Don't highlight if the secret door is open.
                if (self.Interactions.OfType <StandardDoor>().Any(d => d.GetState()))
                {
                    return;
                }
                // Secret door, not opened: highlight it.
                ___m_Highlighter.ConstantOn(BlueprintRoot.Instance.UIRoot.PerceptedLootColor, 0);
            }
            catch (Exception e) {
                Log.Error(e);
            }
        }
        public void Highlight(bool on)
        {
            plaque.SetActive(on);

            if (on)
            {
                var color = StakeColors[use];
                var model = part.FindModelTransform("model");
                if (highlighter == null)
                {
                    var go = model.gameObject;
                    highlighter = go.GetComponent <Highlighter>();
                    if (highlighter == null)
                    {
                        highlighter = go.AddComponent <Highlighter>();
                    }
                }
                if (bound)
                {
                    var color2 = XKCDColors.LightGreyBlue;
                    highlighter.FlashingOn(color, color2, 1.0f);
                }
                else
                {
                    highlighter.ConstantOn(color);
                }
                part.SetHighlightColor(color);
                part.SetHighlight(true, false);

                UpdatePlaque();
            }
            else
            {
                if (highlighter != null)
                {
                    part.SetHighlightDefault();
                    highlighter.Off();
                }
            }
        }
Exemplo n.º 24
0
        /// <summary>
        /// 是否打开高亮阴影
        /// </summary>
        /// <param name="isShow"></param>
        public void OpenOrNotFullViewModel(bool isShow)
        {
            if (!mIsShowShadowModel)
            {
                return;
            }
            if (mViewGameObject == null)
            {
                return;
            }
            mViewGameObject.SetActive(isShow);
            Highlighter highlighter = mViewGameObject.AddSingleComponent <Highlighter>();

            if (isShow)
            {
                highlighter.ConstantOn(Color.black);
            }
            else
            {
                highlighter.ConstantOff();
            }
        }
Exemplo n.º 25
0
    /// <summary>
    /// API:修改物体是否开启高亮
    /// </summary>
    /// <param name="showHightlight">是否开启高亮</param>
    /// <param name="type">高亮类型</param>
    public void SwithHightlight(bool showHightlight, HighlightType type)
    {
        switch (type)
        {
        case HighlightType.Once:
            if (showHightlight)
            {
                h.ConstantOnImmediate(highlightColor);
            }
            else
            {
                h.ConstantOffImmediate();
            }
            break;

        case HighlightType.Constant:
            if (showHightlight)
            {
                h.ConstantOn(highlightColor);
            }
            else
            {
                h.ConstantOff();
            }
            break;

        case HighlightType.Flash:
            if (showHightlight)
            {
                h.FlashingOn(highlightColor, new Color(0, 0, 0, 0));
            }
            else
            {
                h.TweenStop();
            }
            break;
        }
    }
Exemplo n.º 26
0
 // Token: 0x06000007 RID: 7 RVA: 0x000028A8 File Offset: 0x00000AA8
 public static void ToggleGlowZombies()
 {
     EspMenu.ZombieGlow = !EspMenu.ZombieGlow;
     foreach (Zombie zombie in FindObjectsOfType <Zombie>())
     {
         Highlighter highlighter = zombie.gameObject.GetComponent <Highlighter>();
         if (!EspMenu.ZombieGlow)
         {
             highlighter.ConstantOffImmediate();
         }
         else
         {
             if (highlighter == null)
             {
                 highlighter = zombie.gameObject.AddComponent <Highlighter>();
             }
             highlighter.ConstantParams(Color.blue);
             highlighter.OccluderOn();
             highlighter.SeeThroughOn();
             highlighter.ConstantOn();
         }
     }
 }
Exemplo n.º 27
0
 void SetHightlight()
 {
     ray = Camera.main.ScreenPointToRay(Input.mousePosition);
     if (Physics.Raycast(ray, out hitInfo))
     {
         GameObject go = hitInfo.collider.gameObject;
         if (go.tag == "Player")
         {
             if (lastHighlighter == null)
             {
                 lastHighlighter = go.GetComponent <Highlighter>();
                 lastHighlighter.ConstantOn(Color.green);
             }
         }
         else
         {
             if (lastHighlighter != null)
             {
                 lastHighlighter.ConstantOff();
                 lastHighlighter = null;
             }
         }
     }
 }
Exemplo n.º 28
0
    // Update is called once per frame
    void Update()
    {
        if (modelController.CheckButton())
        {
            transformed  = modelController.transforme;
            distance1    = modelController.distance1;
            distance2    = modelController.distance2;
            oldPosition1 = modelController.oldRemove1;
            oldPosition2 = modelController.oldRemove2;

            if (Input.GetMouseButtonDown(0))
            {
                Ray        mRay = Camera.main.ScreenPointToRay(Input.GetTouch(0).position);
                RaycastHit mHit;
                LayerMask  mask = 1 << LayerMask.NameToLayer("Sphere");
                if (Physics.Raycast(mRay, out mHit, 20f, mask.value))
                {
                    if (mHit.collider.gameObject == alphaBase)
                    {
                        h1.ConstantOn(Color.yellow);
                        h2.ConstantOffImmediate();
                        alphaBaseFlag  = true;
                        screenBaseFlag = false;
                    }
                    else if (mHit.collider.gameObject == screenBase)
                    {
                        h2.ConstantOn(Color.yellow);
                        h1.ConstantOffImmediate();
                        alphaBaseFlag  = false;
                        screenBaseFlag = true;
                    }
                }
            }
            if (Input.touchCount == 1 && Input.GetTouch(0).phase == TouchPhase.Moved)
            {
                Vector2 deltaposition = Input.GetTouch(0).deltaPosition;
                //
                Vector3 translated = Vector3.Project(deltaposition, transformed).x *Vector3.right;
                if (alphaBaseFlag && (Vector3.Distance(magnifierBase.transform.parent.gameObject.transform.position, alphaBase.transform.parent.gameObject.transform.position) < 0.42 * Model.transform.localScale.x) && (Vector3.Distance(magnifierBase.transform.parent.gameObject.transform.position, alphaBase.transform.parent.gameObject.transform.position) > 0.05 * Model.transform.localScale.x))
                {
                    var player = ClientScene.localPlayers[0].gameObject.GetComponent <Player>();
                    player.CheckAuthority(GetComponent <NetworkIdentity>(), player.GetComponent <NetworkIdentity>());
                    CmdAlphaBaseTranslate(translated);
                }
                else if (screenBaseFlag && (Vector3.Distance(magnifierBase.transform.parent.gameObject.transform.position, screenBase.transform.parent.transform.position) < 0.42 * Model.transform.localScale.x) && (Vector3.Distance(magnifierBase.transform.parent.gameObject.transform.position, screenBase.transform.parent.gameObject.transform.position) > 0.05 * Model.transform.localScale.x))
                {
                    var player = ClientScene.localPlayers[0].gameObject.GetComponent <Player>();
                    player.CheckAuthority(GetComponent <NetworkIdentity>(), player.GetComponent <NetworkIdentity>());
                    CmdScreenBaseTranslate(translated);
                }
            }
            if (alphaBaseFlag && (Vector3.Distance(magnifierBase.transform.parent.gameObject.transform.position, alphaBase.transform.parent.gameObject.transform.position) >= 0.42 * Model.transform.localScale.x))
            {
                var player = ClientScene.localPlayers[0].gameObject.GetComponent <Player>();
                player.CheckAuthority(GetComponent <NetworkIdentity>(), player.GetComponent <NetworkIdentity>());
                CmdAlphaBaseTranslateForward(transformed.x * Vector3.left);
            }
            else if (alphaBaseFlag && (Vector3.Distance(magnifierBase.transform.parent.gameObject.transform.position, alphaBase.transform.parent.gameObject.transform.position) <= 0.05 * Model.transform.localScale.x))
            {
                var player = ClientScene.localPlayers[0].gameObject.GetComponent <Player>();
                player.CheckAuthority(GetComponent <NetworkIdentity>(), player.GetComponent <NetworkIdentity>());
                CmdAlphaBaseTranslateBack(transformed.x * Vector3.left);
            }
            else if (screenBaseFlag && (Vector3.Distance(magnifierBase.transform.parent.gameObject.transform.position, screenBase.transform.parent.gameObject.transform.position) >= 0.42 * Model.transform.localScale.x))
            {
                var player = ClientScene.localPlayers[0].gameObject.GetComponent <Player>();
                player.CheckAuthority(GetComponent <NetworkIdentity>(), player.GetComponent <NetworkIdentity>());
                CmdScreenBaseTranslateBack(transformed.x * Vector3.left);
            }
            else if (screenBaseFlag && (Vector3.Distance(magnifierBase.transform.parent.gameObject.transform.position, screenBase.transform.parent.gameObject.transform.position) <= 0.05 * Model.transform.localScale.x))
            {
                var player = ClientScene.localPlayers[0].gameObject.GetComponent <Player>();
                player.CheckAuthority(GetComponent <NetworkIdentity>(), player.GetComponent <NetworkIdentity>());
                CmdScreenBaseTranslateForward(transformed.x * Vector3.left);
            }

            if (Input.touchCount > 1)
            {
                h1.ConstantOffImmediate();
                h2.ConstantOffImmediate();
                alphaBaseFlag  = false;
                screenBaseFlag = false;
            }
        }
    }
Exemplo n.º 29
0
 /// <summary>
 /// 自动式高亮
 /// </summary>
 public void HighlightOn()
 {
     h.ConstantOn(Color.red);
 }
Exemplo n.º 30
0
 /// <summary>
 /// һֱ��
 /// </summary>
 public void ConstantLight()
 {
     h.ConstantOn();
 }