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); } } }
private void OnDisable() { if (mainCameraController != null) { mainCameraController.followTarget = null; mainCameraController = null; } }
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(); } }
private void OnEnable() { Camera mainCamera = Camera.main; if (mainCamera != null) { CameraMotionController controller = mainCamera.GetComponent <CameraMotionController>(); if (controller != null) { mainCameraController = controller; mainCameraController.followTarget = transform; } } }
public virtual void actionCam(IUsersInput input, CameraMotionController obj) { }
public void act(ObjectMotionController obj, CameraMotionController objCam) { action.action(this, obj); action.actionCam(this, objCam); }
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); }