Example #1
0
 public IEnumerator Init(CraftCamera _craftCamera, bool _tutorial)
 {
     // ISSUE: object of a compiler-generated type is created
     return((IEnumerator) new UICtrl.\u003CInit\u003Ec__Iterator0()
     {
         _craftCamera = _craftCamera,
         _tutorial = _tutorial,
         \u0024this = this
     });
 }
        private static void HousingCraftScene_Start(Housing.CraftCamera ___craftCamera, Camera[] ___cameras)
        {
            Console.WriteLine("HousingCraftCamera_Start");

            craftCamera = ___craftCamera;
            if (___cameras.IsNullOrEmpty())
            {
                return;
            }
            //          housingCamera = ___cameras[0];

            AdjustCameraSettings(_cameraMoveSpeed.Value, _orthographicCamera.Value);
        }
Example #3
0
 protected override void LateUpdate()
 {
     if (this.bLock)
     {
         return;
     }
     this.isControlNow = false;
     if (!this.isControlNow)
     {
         VirtualCameraController.NoCtrlFunc noCtrlCondition = this.NoCtrlCondition;
         bool flag = false;
         if (noCtrlCondition != null)
         {
             foreach (VirtualCameraController.NoCtrlFunc invocation in noCtrlCondition.GetInvocationList())
             {
                 flag |= invocation();
             }
         }
         if (!flag)
         {
             if (this.InputTouchProc())
             {
                 this.isControlNow = true;
             }
             else if (this.InputMouseProc())
             {
                 this.isControlNow = true;
             }
         }
     }
     if (!this.isControlNow)
     {
         VirtualCameraController.NoCtrlFunc keyCondition = this.KeyCondition;
         bool flag = true;
         if (keyCondition != null)
         {
             foreach (VirtualCameraController.NoCtrlFunc invocation in keyCondition.GetInvocationList())
             {
                 flag &= invocation();
             }
         }
         CraftCamera craftCamera = this;
         craftCamera.isControlNow = ((craftCamera.isControlNow ? 1 : 0) | (!flag ? 0 : (this.InputKeyProc() ? 1 : 0))) != 0;
     }
     if (!this.isControlNow)
     {
         VirtualCameraController.NoCtrlFunc zoomCondition = this.ZoomCondition;
         bool flag1 = true;
         if (zoomCondition != null)
         {
             foreach (VirtualCameraController.NoCtrlFunc invocation in zoomCondition.GetInvocationList())
             {
                 flag1 &= invocation();
             }
         }
         bool        flag2       = Object.op_Implicit((Object)EventSystem.get_current()) && EventSystem.get_current().IsPointerOverGameObject();
         CraftCamera craftCamera = this;
         craftCamera.isControlNow = ((craftCamera.isControlNow ? 1 : 0) | (flag2 || !flag1 ? 0 : (this.InputMouseWheelZoomProc() ? 1 : 0))) != 0;
     }
     if (Object.op_Inequality((Object)EventSystem.get_current(), (Object)null) && !EventSystem.get_current().IsPointerOverGameObject())
     {
         return;
     }
     this.isControlNow = false;
 }
        public override void Init(UICtrl _uiCtrl, bool _tutorial)
        {
            base.Init(_uiCtrl, _tutorial);
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonAdd), (Action <M0>)(_ => this.UICtrl.AddUICtrl.Active = !this.UICtrl.AddUICtrl.Active));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonUndo), (Action <M0>)(_ =>
            {
                if (!Singleton <UndoRedoManager> .IsInstance())
                {
                    return;
                }
                Singleton <UndoRedoManager> .Instance.Undo();
            }));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonRedo), (Action <M0>)(_ =>
            {
                if (!Singleton <UndoRedoManager> .IsInstance())
                {
                    return;
                }
                Singleton <UndoRedoManager> .Instance.Redo();
            }));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonCamera), (Action <M0>)(_ => this.Camera = !this.Camera));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonAxis), (Action <M0>)(_ => this.Axis     = !this.Axis));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonGrid), (Action <M0>)(_ => this.Grid     = !this.Grid));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonSave), (Action <M0>)(_ => this.Save()));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonLoad), (Action <M0>)(_ => this.UICtrl.SaveLoadUICtrl.Open()));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonReset), (Action <M0>)(_ =>
            {
                ConfirmScene.Sentence     = "初期化しますか?\n" + "セットされたアイテムは削除されます。".Coloring("#DE4529FF").Size(24);
                ConfirmScene.OnClickedYes = (Action)(() =>
                {
                    this.UICtrl.ListUICtrl.VirtualizingTreeView.SelectedIndex = -1;
                    Singleton <Manager.Housing> .Instance.ResetObject();
                    this.UICtrl.ListUICtrl.UpdateUI();
                    Singleton <UndoRedoManager> .Instance.Clear();
                });
                ConfirmScene.OnClickedNo = (Action)(() => {});
                Singleton <Game> .Instance.LoadDialog();
            }));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonEnd), (Action <M0>)(_ =>
            {
                if (Singleton <CraftScene> .Instance.IsShortcutUI)
                {
                    return;
                }
                if (Singleton <CraftScene> .Instance.CraftInfo.IsOverlapNow)
                {
                    this.IsMessage = true;
                    MapUIContainer.PushMessageUI("配置に問題があるものが存在します", 2, 1, (Action)(() => this.IsMessage = false));
                }
                else
                {
                    ConfirmScene.Sentence     = "ハウジングを終了しますか?";
                    ConfirmScene.OnClickedYes = (Action)(() =>
                    {
                        Singleton <CraftScene> .Instance.SceneEnd();
                        ObservableExtensions.Subscribe <Unit>((IObservable <M0>)MapUIContainer.StartFade(FadeCanvas.PanelType.Blackout, (FadeType)0, 1f, true), (Action <M0>)(__ => {}), (Action)(() => this.EndHousing()));
                    });
                    ConfirmScene.OnClickedNo = (Action)(() => Singleton <CraftScene> .Instance.IsEndCheck = false);
                    Singleton <Game> .Instance.LoadDialog();
                    Singleton <CraftScene> .Instance.IsEndCheck = true;
                }
            }));
            ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.cameraReactive, (Action <M0>)(_b => this.spritesCamera.SafeProc <Sprite>(!_b ? 1 : 0, (Action <Sprite>)(_s => ((Selectable)this.buttonCamera).get_image().set_sprite(_s)))));
            ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.axisReactive, (Action <M0>)(_b =>
            {
                this.spritesAxis.SafeProc <Sprite>(!_b ? 1 : 0, (Action <Sprite>)(_s => ((Selectable)this.buttonAxis).get_image().set_sprite(_s)));
                GuideObject guideObject = Singleton <GuideManager> .Instance.GuideObject;
                if (!Object.op_Implicit((Object)guideObject))
                {
                    return;
                }
                guideObject.visibleOutside = _b;
            }));
            ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.gridReactive, (Action <M0>)(_b =>
            {
                this.spritesGrid.SafeProc <Sprite>(!_b ? 1 : 0, (Action <Sprite>)(_s => ((Selectable)this.buttonGrid).get_image().set_sprite(_s)));
                if (!Singleton <GuideManager> .IsInstance())
                {
                    return;
                }
                Singleton <GuideManager> .Instance.VisibleGrid = _b;
            }));
            CraftCamera craftCamera = this.UICtrl.CraftCamera;

            craftCamera.NoCtrlCondition = craftCamera.NoCtrlCondition + new VirtualCameraController.NoCtrlFunc(this.NoCameraCtrl);
            if (Singleton <UndoRedoManager> .IsInstance())
            {
                Singleton <UndoRedoManager> .Instance.CanUndoChange += new EventHandler <CanhangeArgs>(this.CanUndoChange);
                Singleton <UndoRedoManager> .Instance.CanRedoChange += new EventHandler <CanhangeArgs>(this.CanRedoChange);
            }
            ((Selectable)this.buttonUndo).set_interactable(false);
            ((Selectable)this.buttonRedo).set_interactable(false);
            if (!_tutorial)
            {
                return;
            }
            ((Selectable)this.buttonSave).set_interactable(false);
            ((Selectable)this.buttonLoad).set_interactable(false);
        }