예제 #1
0
    void OnGUI()
    {
        if (true == GUILayout.Button("ReStart"))
        {
            GameObject routesObj = null;

            RouteStruct [] routes = new RouteStruct[m_RouteSize];

            for (int i = 0; i < m_RouteSize; ++i)
            {
                routes[i] = new RouteStruct();
                routesObj = GameObject.Find("CameraRoute" + i.ToString());
                if (null != routesObj)
                {
                    routes[i].Position = routesObj.transform.position;
                }

                routesObj = GameObject.Find("CameraRouteTarget" + i.ToString());
                if (null != routesObj)
                {
                    routes[i].TargetPosition = routesObj.transform.position;
                }
            }
            SetupRoutes(routes);
            StartMove();
        }
        if (true == GUILayout.Button("Pause/Resume"))
        {
            if (m_CameraState != CameraRoutesState.MoveToTarget)
            {
                StartMove();
            }
            else
            {
                StopMove();
            }
        }
    }
	void OnGUI()
	{
		if( true == GUILayout.Button( "ReStart" ) )
		{
			GameObject routesObj = null ;

			RouteStruct [] routes = new RouteStruct[ m_RouteSize ] ;
			
			for( int i = 0 ; i < m_RouteSize ; ++i )
			{
				routes[ i ] = new RouteStruct() ;
				routesObj = GameObject.Find( "CameraRoute" + i.ToString() ) ;
				if( null != routesObj )
				{
					routes[ i ].Position = routesObj.transform.position ;
				}
				
				routesObj = GameObject.Find( "CameraRouteTarget" + i.ToString() ) ;
				if( null != routesObj )
				{
					routes[ i ].TargetPosition = routesObj.transform.position ;
				}
				
			}			
			SetupRoutes( routes ) ;
			StartMove() ;			
			
		}
		if( true == GUILayout.Button( "Pause/Resume" ) )
		{
			if( m_CameraState != CameraRoutesState.MoveToTarget )
				StartMove() ;
			else
				StopMove() ;
		}		
	}
	public void SetupRoutes( RouteStruct [] _Routes )
	{
		m_Routes = _Routes ;
		m_RouteIndex = 0 ;
	}