public void GameInitialize() { GameObject playerObj = GameObject.FindGameObjectWithTag("Player"); PlayerController player = playerObj.GetComponent <PlayerController>(); if (player) { player.Initialize(); } Camera mainCamera = Camera.main; GameCameraController cameraController = mainCamera.GetComponent <GameCameraController>(); if (cameraController) { cameraController.Initialize(); } Coins = 0; foreach (GameBlockController block in this.blocks) { block.Initialize(); } foreach (GameCoinController coin in this.coins) { coin.Initialize(); } foreach (EnemyController enemy in this.enemies) { enemy.Initialize(); } }
public void Init() { GCamControl = this; camDepth = GameRenderer.GRenderer.getZUnitsCamera(); cam = GetComponent <Camera> (); cam.farClipPlane = Mathf.Abs(camDepth) + 100; }
public void Init() { GCamControl = this; camDepth = GameRenderer.GRenderer.getZUnitsCamera (); cam = GetComponent<Camera> (); cam.farClipPlane = Mathf.Abs(camDepth) + 100; }
public GenerateCellEventActions(CellEventGenerator eventGenerator, GameCameraController gameCameraController) : base( null, null, new ClickToGenerateCellEvent(eventGenerator), new DragToMoveCamera(gameCameraController), null ) { }
public ClickToClickableObjectActions(GameCameraController gameCameraController) : base( null, new ClickDownToClickableObject(), new ClickUpToClickableObject(), new DragToMoveCamera(gameCameraController), new ScrollToZoomCamera(gameCameraController) ) { }
private void Awake() { INSTANCE = this; // 场景摄像机 this._cachedMainCameraTransform = this.sceneCamera.transform; this.sceneCamera.fieldOfView = 45f; //GameObject obj2 = new GameObject("_CameraFocus"); //obj2.AddComponent<CameraFocus>().cameraPrefab = this.cameraObj; //GameObject obj3 = new GameObject("_CameraDragFocus"); //obj3.AddComponent<CameraDragFocus>().cameraPrefab = this.cameraObj; this.sensitiveX *= Mathf.Lerp(0.5f, 1.5f, Profile.sensitive / 2f); this.sensitiveY *= Mathf.Lerp(0.5f, 1.5f, Profile.sensitive / 2f); }
void BuildCamera() { // Create a new camera as a child of this script's GameObject (and rename it) Camera cameraPrefab = Resources.Load("GameCamera/GameCamera", typeof(Camera)) as Camera; Camera camera = Instantiate(cameraPrefab, this.gameObject.transform) as Camera; GameCameraController gcc = camera.GetComponent <GameCameraController> (); gcc.gameCamera = camera; // Translate it to the level-specific starting position camera.transform.Translate(cameraLocation.x, 0.0f, cameraLocation.y, Space.World); camera.orthographicSize = cameraSize; GameObject prefab = Resources.Load <GameObject> ("GameCamera/CameraPanel"); GameObject cameraPanel = Instantiate(prefab, canvas.gameObject.transform); CameraPanelBehaviour cpb = cameraPanel.GetComponent <CameraPanelBehaviour> (); cpb.gameCamera = camera; }
public override void Initialize(int ownerUniqueID) { base.Initialize(ownerUniqueID); mainCamera = Camera.main; attributes.healthMaximum = 100; attributes.speedStandingSlow = 10; attributes.speedStandingFast = 10; attributes.speedAiming = 8; attributes.speedSprinting = 15; state.velocityTime = 0.15f; state.health = attributes.healthMaximum; cameraController = GameObject.FindObjectOfType <GameCameraController>(); }
public DevelopCellActions( CellGenerator cellGenerator, CellMapper cellMapper, int replaceCellRecordId, int blankCellRecordId, int generateBlankRange, GameCameraController gameCameraController ) : base( null, null, new ClickToDevelopCell( cellGenerator, cellMapper, replaceCellRecordId, blankCellRecordId, generateBlankRange ), new DragToMoveCamera(gameCameraController), null ) { }
void Start() { fromTarget = transform; controller = GetComponent<GameCameraController> (); }
public EraseCellEventActions(CellEventGenerator eventGenerator, CellMapper cellMapper, GameCameraController gameCameraController) : base( null, null, new ClickToEraseCellEvent(eventGenerator, cellMapper), new DragToMoveCamera(gameCameraController), null ) { }
void Start() { fromTarget = transform; controller = GetComponent <GameCameraController> (); }
public ScrollToZoomCamera(GameCameraController gameCameraController) { this.gameCameraController = gameCameraController; }
private void SetNewCameraBounds() { GameCameraController camera = Camera.main.gameObject.GetComponent <GameCameraController>(); camera.SetNewBounds(_collider.bounds); }
public DragToMoveCamera(GameCameraController gameCameraController) { this.gameCameraController = gameCameraController; }