コード例 #1
0
    void Update()
    {
        if (CurrentCamera == null)
        {
            CurrentCamera = Camera.main;

            if (CurrentCamera == null)
            {
                CurrentCamera = Camera.current;
            }
        }
        if (Camera.current != null)
        {
            if (CurrentCamera != Camera.current)
            {
                CurrentCamera = Camera.current;
            }
        }

        // check a current camera
        Mode = NavMode.Third;
        for (int i = 0; i < CockpitCamera.Length; i++)
        {
            if (CockpitCamera [i] != null)
            {
                if (CockpitCamera [i].camera.enabled)
                {
                    if (i == PrimaryCameraIndex)
                    {
                        Mode = NavMode.Cockpit;
                    }
                }
            }
        }
    }
コード例 #2
0
ファイル: Navigation.cs プロジェクト: luco2018/UTF_Core
 void AnalyticClick()
 {
     _navMode = NavMode.analytic;
     titleMenu.SetActive(false);
     FilterSystem.Instance.canvas.SetActive(true);
     FilterSystem.Instance.BaseFilter();
 }
コード例 #3
0
ファイル: Navigation.cs プロジェクト: luco2018/UTF_Core
 void RunTestClick()
 {
     _navMode = NavMode.testing;
     titleMenu.SetActive(false);
     Menu.Instance.menuParent.SetActive(true);
     StartCoroutine(ResultsIO.Instance.Init());            //begin the baseline fetch/testsystem
 }
コード例 #4
0
ファイル: NavWindow.cs プロジェクト: Moth-Tolias/Pulsar4x
        internal override void Display()
        {
            if (!IsActive)
            {
                return;
            }
            ImGui.SetNextWindowSize(new Vector2(600f, 400f), ImGuiCond.FirstUseEver);
            if (ImGui.Begin("Nav Control", ref IsActive, _flags))
            {
                BorderGroup.Begin("Mode");
                if (ImGui.Button("Manual Thrust"))
                {
                    _navMode = NavMode.Thrust;
                }
                if (ImGui.Button("Hohmann Transfer"))
                {
                    _navMode = NavMode.HohmannTransfer;
                }
                if (ImGui.Button("Phase Change"))
                {
                    _navMode = NavMode.PhaseChange;
                }
                if (ImGui.Button("High Δv Intercept"))
                {
                    _navMode = NavMode.HighDVIntercept;
                }
                if (ImGui.Button("Porkchop Plot"))
                {
                    _navMode = NavMode.PorkChopPlot;
                }
                BorderGroup.End();
                ImGui.NewLine();
                ImGui.Text("Availible Δv: " + Stringify.Velocity(_totalDV));
                switch (_navMode)
                {
                case NavMode.Thrust:
                {
                    DisplayThrustMode();
                    break;
                }

                case NavMode.PhaseChange:
                    DisplayPhaseChangeMode();
                    break;

                case NavMode.HohmannTransfer:
                    DisplayHohmannMode();
                    break;

                case NavMode.None:
                    break;

                default:
                    break;
                }
            }
        }
コード例 #5
0
 void Update()
 {
     // check a current camera
     Mode = NavMode.Third;
     for (int i = 0; i < CockpitCamera.Length; i++)
     {
         if (CockpitCamera [i] != null)
         {
             if (CockpitCamera [i].GetComponent <Camera>().enabled)
             {
                 if (i == PrimaryCameraIndex)
                 {
                     Mode = NavMode.Cockpit;
                 }
             }
         }
     }
 }
コード例 #6
0
 void Update()
 {
     if (CockpitCamera)
     {
         if (CockpitCamera.GetComponent <Camera>().enabled)
         {
             Mode = NavMode.Cockpit;
         }
         else
         {
             Mode = NavMode.Third;
         }
     }
     else
     {
         Mode = NavMode.Third;
     }
 }
コード例 #7
0
        bool HandleMouse(Rect Viewport)
        {
            var result = false;

            if (Event.current.type == EventType.MouseDown)
            {
                if (Event.current.button == 0)
                {
                    m_NavMode = NavMode.Rotating;
                }
                else if (Event.current.button == 1)
                {
                    m_NavMode = NavMode.Zooming;
                }

                m_PreviousMousePosition = Event.current.mousePosition;
                result = true;
            }

            if (Event.current.type == EventType.MouseUp || Event.current.rawType == EventType.MouseUp)
            {
                m_NavMode = NavMode.None;
            }

            if (m_NavMode != NavMode.None)
            {
                var mouseDelta = Event.current.mousePosition - m_PreviousMousePosition;
                switch (m_NavMode)
                {
                case NavMode.Rotating:
                    m_CameraTheta = (m_CameraTheta - mouseDelta.x * 0.003f) % (Mathf.PI * 2);
                    m_CameraPhi   = Mathf.Clamp(m_CameraPhi - mouseDelta.y * 0.003f, 0.2f, Mathf.PI - 0.2f);
                    break;

                case NavMode.Zooming:
                    m_CameraDistance = Mathf.Clamp(mouseDelta.y * 0.01f + m_CameraDistance, 1, 10);
                    break;
                }
                result = true;
            }

            m_PreviousMousePosition = Event.current.mousePosition;
            return(result);
        }
コード例 #8
0
 public NavigatingToParameters(NavMode mode, INavigationInfo from, INavigationInfo to, bool resuming, IPropertyBagEx sessionState)
     : base(from, to, sessionState)
 {
     this.Resuming       = resuming;
     this.NavigationMode = mode;
 }
コード例 #9
0
        private void HandleState()
        {
            NavMode target = agent.data.targetMode;

            switch (target)
            {
            case NavMode.MoveToCrowd:

                if (mPlanner != mMoveToCrowd)
                {
                    TransitionState(mMoveToCrowd);
                }

                break;

            case NavMode.FollowGoalCrowd:

                if (mPlanner != mFollowGoal)
                {
                    TransitionState(mFollowGoal);
                }

                break;

            case NavMode.MoveToSimple:

                if (mPlanner != mSimpleMove)
                {
                    TransitionState(mSimpleMove);
                }

                break;

            case NavMode.MoveToLocal:

                if (mPlanner != mLocalMove)
                {
                    TransitionState(mLocalMove);
                }

                break;

            case NavMode.SuspendInCrowd:

                if (mPlanner != mSuspendInCrowd)
                {
                    TransitionState(mSuspendInCrowd);
                }

                break;

            case NavMode.Suspended:

                if (mPlanner != NullState.Instance)
                {
                    Suspend();
                }

                break;
            }
        }
コード例 #10
0
ファイル: MainForm.cs プロジェクト: paladin74/Dapple
 private void toolStripNavButton_MouseRemoveCapture(object sender, EventArgs e)
 {
     this.timerNavigation.Enabled = true;
     this.timerNavigation.Enabled = false;
     this.eNavMode = NavMode.None;
 }
コード例 #11
0
ファイル: MainForm.cs プロジェクト: paladin74/Dapple
 private void c_bZoomOut_MouseDown(object sender, MouseEventArgs e)
 {
     this.timerNavigation.Enabled = true;
     this.bNavTimer = false;
     this.eNavMode = NavMode.ZoomOut;
 }
コード例 #12
0
ファイル: MainForm.cs プロジェクト: paladin74/Dapple
 private void c_bRotateRight_MouseDown(object sender, MouseEventArgs e)
 {
     this.timerNavigation.Enabled = true;
     this.bNavTimer = false;
     this.eNavMode = NavMode.RotateLeft;
 }
コード例 #13
0
ファイル: Player.cs プロジェクト: GillianYue/Bubbla
 public void setNavigationMode(NavMode mode)
 {
     navigationMode = mode;
 }
コード例 #14
0
ファイル: Indicator.cs プロジェクト: bigstupidx/RC-Plane-Sim
 void Start()
 {
     Mode = NavMode.Third;
 }
コード例 #15
0
 public NavigatingToParameters(NavMode mode, INavigationInfo from, INavigationInfo to, bool resuming, IDictionary <string, object> sessionState)
     : base(from, to, sessionState)
 {
     this.Resuming       = resuming;
     this.NavigationMode = mode;
 }
コード例 #16
0
	void Update ()
	{
		if(CockpitCamera){
			if (CockpitCamera.GetComponent<Camera>().enabled) {
				Mode = NavMode.Cockpit;	
			} else {
				Mode = NavMode.Third;
			}
		}else{
			Mode = NavMode.Third;
		}
	}