예제 #1
0
        public void AddHighlightForActor(PoolObjHandle <ActorRoot> actor, bool bPauseGame)
        {
            if (!actor)
            {
                return;
            }
            ActorRoot handle = actor.get_handle();

            if (!handle.InCamera)
            {
                return;
            }
            GameObject gameObject = Singleton <CResourceManager> .GetInstance().GetResource("UGUI/Form/System/Dialog/WeakGuideHighlighter.prefab", typeof(GameObject), 4, false, false).m_content as GameObject;

            if (gameObject != null)
            {
                GameObject gameObject2 = Object.Instantiate(gameObject) as GameObject;
                if (gameObject2 != null)
                {
                    if (NewbieGuideScriptControl.FormGuideMask == null)
                    {
                        NewbieGuideScriptControl.OpenGuideForm();
                    }
                    CUIFormScript formGuideMask = NewbieGuideScriptControl.FormGuideMask;
                    Transform     transform     = formGuideMask.transform;
                    Vector3       v             = CUIUtility.WorldToScreenPoint(Camera.main, (Vector3)handle.location);
                    Vector3       vector        = CUIUtility.ScreenToWorldPoint(formGuideMask.GetCamera(), v, transform.position.z);
                    Transform     transform2    = gameObject2.transform;
                    transform2.SetSiblingIndex(1);
                    transform2.SetParent(NewbieGuideScriptControl.FormGuideMask.transform);
                    formGuideMask.InitializeWidgetPosition(gameObject2, vector);
                    transform2.position   = vector;
                    transform2.localScale = Vector3.one;
                    CUIEventScript cUIEventScript = gameObject2.AddComponent <CUIEventScript>();
                    CUIEventScript expr_117       = cUIEventScript;
                    expr_117.onClick = (CUIEventScript.OnUIEventHandler)Delegate.Combine(expr_117.onClick, new CUIEventScript.OnUIEventHandler(this.HighliterForActorClickHandler));
                    Singleton <CBattleGuideManager> .GetInstance().PauseGame(gameObject2, false);
                }
            }
        }
예제 #2
0
        public void AddHighlightForActor(PoolObjHandle <ActorRoot> actor, bool bPauseGame)
        {
            if (actor != 0)
            {
                ActorRoot handle = actor.handle;
                if (handle.InCamera)
                {
                    GameObject content = Singleton <CResourceManager> .GetInstance().GetResource("UGUI/Form/System/Dialog/WeakGuideHighlighter.prefab", typeof(GameObject), enResourceType.UIPrefab, false, false).m_content as GameObject;

                    if (content != null)
                    {
                        GameObject widget = UnityEngine.Object.Instantiate(content) as GameObject;
                        if (widget != null)
                        {
                            if (NewbieGuideScriptControl.FormGuideMask == null)
                            {
                                NewbieGuideScriptControl.OpenGuideForm();
                            }
                            CUIFormScript formGuideMask = NewbieGuideScriptControl.FormGuideMask;
                            Transform     transform     = formGuideMask.transform;
                            Vector3       screenPoint   = (Vector3)CUIUtility.WorldToScreenPoint(Camera.main, (Vector3)handle.location);
                            Vector3       worldPosition = CUIUtility.ScreenToWorldPoint(formGuideMask.GetCamera(), screenPoint, transform.position.z);
                            Transform     transform2    = widget.transform;
                            transform2.SetSiblingIndex(1);
                            transform2.SetParent(NewbieGuideScriptControl.FormGuideMask.transform);
                            formGuideMask.InitializeWidgetPosition(widget, worldPosition);
                            transform2.position   = worldPosition;
                            transform2.localScale = Vector3.one;
                            CUIEventScript local1 = widget.AddComponent <CUIEventScript>();
                            local1.onClick = (CUIEventScript.OnUIEventHandler)Delegate.Combine(local1.onClick, new CUIEventScript.OnUIEventHandler(this.HighliterForActorClickHandler));
                            Singleton <CBattleGuideManager> .GetInstance().PauseGame(widget, false);
                        }
                    }
                }
            }
        }