예제 #1
0
    public void Initialize(int difficulty)
    {
        timer            = FindObjectOfType <TimeProgress>();
        cityDisplayers   = FindObjectsOfType <InformationDisplayer>();
        europeAdjuster   = FindObjectOfType <EuropeScreenAdjuster>();
        spriteManager    = GameObject.Find("Finland").GetComponent <SpriteManager>();
        cameraController = Camera.main.GetComponent <CameraMotionController>();
        gamePane         = GameObject.FindGameObjectWithTag("GamePane");
        random           = new System.Random();

        TuneLocations(difficulty);
        TuneTime(difficulty);
        TuneSprite(difficulty);
        TuneFlipping(difficulty);

        // Tuning the positions of the cities is unfinished(?)
        // TuneFinlandRotation(difficulty);

        if (difficulty > 8)
        {
            gyroInstructions = GameObject.Find("GyroInstructionsPane");
            gyroInstructions.GetComponent <Canvas>().enabled = true;
            gyroInstructions.GetComponentsInChildren <SpriteRenderer>().ToList().ForEach(sr => sr.enabled = true);
            PlaceCityManager mgr = FindObjectOfType <PlaceCityManager>();
            gyroInstructions.GetComponent <FadingInstructor>().Fade(1f, 2f, mgr.initialInstructionDuration + mgr.initialInstructionFadeDuration);
            if (random.Next(0, 2) == 0)
            {
                TunePaneRotationInXYPlane(difficulty);
            }
            else
            {
                TunePanePanning(difficulty);
            }
        }
    }
예제 #2
0
 private void OnDisable()
 {
     if (mainCameraController != null)
     {
         mainCameraController.followTarget = null;
         mainCameraController = null;
     }
 }
예제 #3
0
 void OnSceneLoaded(Scene scene, LoadSceneMode mode)
 {
     if (scene.name == "WorkPlace")
     {
         objCam = Camera.main.GetComponent <CameraMotionController>();
         //canvas = GameObject.Instantiate(canvasPrefab);
         indicationScript = GameObject.FindGameObjectWithTag("Indication").GetComponent <IndicationScript>();
         uiManager        = GameObject.FindGameObjectWithTag("Canvas").GetComponent <UIManager>();
         uiManager.gameObject.SetActive(false);
         startGame();
     }
 }
예제 #4
0
        private void OnEnable()
        {
            Camera mainCamera = Camera.main;

            if (mainCamera != null)
            {
                CameraMotionController controller = mainCamera.GetComponent <CameraMotionController>();
                if (controller != null)
                {
                    mainCameraController = controller;
                    mainCameraController.followTarget = transform;
                }
            }
        }
예제 #5
0
 public virtual void actionCam(IUsersInput input, CameraMotionController obj)
 {
 }
예제 #6
0
 public void act(ObjectMotionController obj, CameraMotionController objCam)
 {
     action.action(this, obj);
     action.actionCam(this, objCam);
 }
예제 #7
0
 public override void actionCam(IUsersInput input, CameraMotionController obj)
 {
     obj.MoveDistanceFromObject(input.GetButtonX() - input.GetButtonY());
     obj.MoveDown(input.GetVertical() * input.speed);
     obj.MoveRight(input.GetHorizontal() * input.speed);
 }