Ejemplo n.º 1
0
 public void OnBuildingSelected(EditBuilding building)
 {
     if (mCurrentOpBuilding)
     {
         if (building == mCurrentOpBuilding)
         {
             mCurrentOpBuilding.mSelected = false;
             mCurrentOpBuilding           = null;
             TownEditGui_N.Instance.SetOpBuild(null);
         }
         else
         {
             mCurrentOpBuilding.mSelected = false;
             mCurrentOpBuilding           = building;
             mCurrentOpBuilding.mSelected = true;
             TownEditGui_N.Instance.SetOpBuild(mCurrentOpBuilding);
         }
     }
     else
     {
         mCurrentOpBuilding           = building;
         mCurrentOpBuilding.mSelected = true;
         TownEditGui_N.Instance.SetOpBuild(mCurrentOpBuilding);
     }
     mDragMode = false;
 }
Ejemplo n.º 2
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            Classi.SiteModule _SiteModule = (Classi.SiteModule)HttpContext.Current.Items["SiteModule"];
            this.GridTitle1.hplsNuovo.NavigateUrl = "../Gestione/EditBuilding.aspx?ItemID=0&FunId=" + _SiteModule.ModuleId;
            this.GridTitle1.hplsNuovo.Visible     = _SiteModule.IsEditable;

            this.DataGridRicerca.Columns[1].Visible = true;
            this.DataGridRicerca.Columns[2].Visible = _SiteModule.IsEditable;

            FunId    = _SiteModule.ModuleId;
            HelpLink = _SiteModule.HelpLink;

            this.PageTitle1.Title = _SiteModule.ModuleTitle;
//			txtsBL_ID.Attributes.Add("onkeypress","SoloNumeri();");
            txtsBL_ID.Attributes.Add("onpaste", "return false;");

            if (!Page.IsPostBack)
            {
                BindProgetti();

                if (Context.Handler is TheSite.Gestione.EditBuilding)
                {
                    _fp = (TheSite.Gestione.EditBuilding)Context.Handler;
                    if (_fp != null)
                    {
                        _myColl = _fp._Contenitore;
                        _myColl.SetValues(this.Page.Controls);
                        Ricerca();
                    }
                }
            }
        }
Ejemplo n.º 3
0
 public void DeletBuilding()
 {
     if (null != mCurrentOpBuilding && mCurrentOpBuilding.DeletEnable)
     {
         mEditBuildingList.Remove(mCurrentOpBuilding);
         Destroy(mCurrentOpBuilding.gameObject);
         mCurrentOpBuilding = null;
     }
 }
Ejemplo n.º 4
0
 public void CancelSelect()
 {
     if (mCurrentOpBuilding)
     {
         mDragMode = false;
         mCurrentOpBuilding.mSelected = false;
         mCurrentOpBuilding           = null;
     }
 }
Ejemplo n.º 5
0
 public void PutBuildingDown()
 {
     if (mDragMode && null != mCurrentOpBuilding)
     {
         mDragMode = false;
         mCurrentOpBuilding.mSelected = false;
         mCurrentOpBuilding           = null;
         TownEditGui_N.Instance.SetOpBuild(null);
     }
 }
Ejemplo n.º 6
0
 public void OnBuildingDrag(EditBuilding building)
 {
     if (building == mCurrentOpBuilding)
     {
         if (!mDragMode)
         {
             if (Vector3.Distance(Input.mousePosition, mMousePos) > 0)
             {
                 mDragMode = true;
             }
         }
         else
         {
             mMousePos = Input.mousePosition;
         }
     }
 }
Ejemplo n.º 7
0
    public void InitEdit()
    {
        mIsActive = true;
        if (mPerfab == null)
        {
            mPerfab = Block45CurMan.self;
        }
        for (int i = 0; i < mTownDataList.Count; i++)
        {
            BlockBuilding building = BlockBuilding.GetBuilding(mTownDataList[i].mBuildingId);

            GameObject editObj = new GameObject();
            editObj.name = "EditBuilding";
            editObj.transform.position   = mTownDataList[i].mPosition;
            editObj.transform.rotation   = Quaternion.Euler(0, mTownDataList[i].mRot * 90, 0);
            editObj.transform.localScale = Vector3.one;

            EditBuilding editBuilding = editObj.AddComponent <EditBuilding>();
            editBuilding.Init(building, mPerfab);
            mEditBuildingList.Add(editBuilding);
        }
    }
Ejemplo n.º 8
0
    public void OnCreateBuilding(string fileName)
    {
        if (mPerfab == null)
        {
            mPerfab = Block45CurMan.self;
        }
        BlockBuilding building = BlockBuilding.GetBuilding(fileName);

        GameObject editObj = new GameObject();

        editObj.name = "EditBuilding";
        editObj.transform.position   = Vector3.zero;
        editObj.transform.rotation   = Quaternion.identity;
        editObj.transform.localScale = Vector3.one;

        EditBuilding editBuilding = editObj.AddComponent <EditBuilding>();

        editBuilding.Init(building, mPerfab);

        mEditBuildingList.Add(editBuilding);

        OnBuildingSelected(editBuilding);
        mDragMode = true;
    }
Ejemplo n.º 9
0
 public void SetOpBuild(EditBuilding editBuilding)
 {
     mOpBuilding  = editBuilding;
     mCurrentFile = null;
 }