Beispiel #1
0
    private void OnPushedNo()
    {
        FarmRoot instance = FarmRoot.Instance;

        if (null != instance)
        {
            FarmScenery scenery = instance.Scenery;
            scenery.CancelSetting();
            this.Close(false);
            SoundMng.Instance().TryPlaySE("SEInternal/Common/se_106", 0f, false, true, null, -1);
        }
    }
Beispiel #2
0
    private void StartFarmObjectPutMode(int facilityID)
    {
        FarmRoot farmRoot = FarmRoot.Instance;

        if (null == farmRoot)
        {
            global::Debug.LogError("FarmRoot Not Found");
            this.ClosePanel(true);
            return;
        }
        FarmObjectSetting settingObject = farmRoot.SettingObject;
        FarmObjectSelect  selectObject  = farmRoot.SelectObject;
        FarmScenery       scenery       = farmRoot.Scenery;

        selectObject.ClearSelectState();
        selectObject.EnabledTouchedEvent(false);
        bool flag = false;

        if (null != settingObject.farmObject && settingObject.settingMode == FarmObjectSetting.SettingMode.BUILD)
        {
            if (facilityID == settingObject.farmObject.facilityID)
            {
                flag = true;
            }
            else
            {
                scenery.CancelSetting();
                StockFacilityConfirmation componentInChildren = Singleton <GUIMain> .Instance.GetComponentInChildren <StockFacilityConfirmation>();

                componentInChildren.DeleteObject();
            }
        }
        if (!flag && scenery.BuildFarmObject(facilityID))
        {
            farmRoot.farmUI.CreateStockFacilityConfirmation();
            farmRoot.SetActiveNotTouchObject(false);
        }
        PartsMenu.instance.gameObject.SetActive(false);
        this.CloseAction(true);
    }