コード例 #1
0
ファイル: MapEventTool.cs プロジェクト: liangmbs/VistaLight
    public void RespondMouseLeftClick()
    {
        RaycastHit2D ray = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);

        if (ray.collider != null && ray.collider.tag == "Background")
        {
            MapEvent   mapEvent   = CreateMapEvent(ray.point);
            GameObject mapEventGO = mapController.AddMapEvent(mapEvent);
            GameObject.Find("MapEditorController").GetComponent <MapEditorController>().SelectOne(mapEventGO.GetComponent <MapEventVO>());
        }
        else if (ray.collider != null && ray.collider.tag == "Event")
        {
            GameObject.Find("MapEditorController").GetComponent <MapEditorController>().SelectOne(ray.collider.gameObject.GetComponent <MapEventVO>());
        }
    }