Пример #1
0
    void Init()
    {
        ClickableManager2D.BindClickEvent(gameObject, delegate(GameObject go, Vector3 pos) {
            Debug.Log("Clicka");
            return;

            mainCtrl.HidePop();
            Vector3 posInWorld = clickableManager.m_camera.ScreenToWorldPoint(pos);
            Vector3 posLocal   = transform.InverseTransformPoint(posInWorld);
            posLocal.z         = 0;
            if (Mark != null)
            {
                Mark.transform.localPosition = posLocal;
            }
            player.FinishFollowPath();

            List <Vector2> path = StartSearch(player.transform.localPosition, posLocal);
            if (path.Count > 0)
            {
                player.FollowPath(path);
            }
        });
        {
            ClickableEventlistener2D listener = gameObject.AddComponent <ClickableEventlistener2D>();
            listener.BeginDragEvent += delegate(GameObject gb, Vector3 dragDir) {
            };

            listener.OnDragEvent  += delegate(GameObject gb, Vector3 dragDir) {
            };
            listener.EndDragEvent += delegate(GameObject gb, Vector3 dragDir) {
            };
        }
    }
Пример #2
0
 void Init()
 {
     followPath = false;
     ClickableManager2D.BindClickEvent(gameObject, delegate(GameObject go, Vector3 pos) {
         Debug.Log("Click player");
         wildMap.mainCtrl.ShowPop(transform.position);
     });
 }
Пример #3
0
    private void BindGameObject()
    {
        mResLoader = GameMain.GetInstance().GetModule <ResLoader>();
        pUIMgr     = GameMain.GetInstance().GetModule <UIMgr>();

        clickableManager = GameObject.Find("ClickManager").GetComponent <ClickableManager2D>();
        PotLyaer         = GameObject.Find("Pots").transform;
        LineLayer        = GameObject.Find("Lines").transform;

        Map        = GameObject.Find("Map");
        mainCamera = pUIMgr.GetCamera();

        clickableManager.m_camera = mainCamera;
    }
Пример #4
0
 // Start is called before the first frame update
 void Start()
 {
     clickableManager = GameObject.Find("ClickableManager").GetComponent <ClickableManager2D>();
     Init();
     InitMap();
 }