Ejemplo n.º 1
0
    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();
        }
    }
Ejemplo n.º 2
0
 public void Init()
 {
     GCamControl      = this;
     camDepth         = GameRenderer.GRenderer.getZUnitsCamera();
     cam              = GetComponent <Camera> ();
     cam.farClipPlane = Mathf.Abs(camDepth) + 100;
 }
Ejemplo n.º 3
0
 public void Init()
 {
     GCamControl = this;
     camDepth = GameRenderer.GRenderer.getZUnitsCamera ();
     cam = GetComponent<Camera> ();
     cam.farClipPlane = Mathf.Abs(camDepth) + 100;
 }
Ejemplo n.º 4
0
 public GenerateCellEventActions(CellEventGenerator eventGenerator, GameCameraController gameCameraController)
     : base(
         null,
         null,
         new ClickToGenerateCellEvent(eventGenerator),
         new DragToMoveCamera(gameCameraController),
         null
         )
 {
 }
Ejemplo n.º 5
0
 public ClickToClickableObjectActions(GameCameraController gameCameraController)
     : base(
         null,
         new ClickDownToClickableObject(),
         new ClickUpToClickableObject(),
         new DragToMoveCamera(gameCameraController),
         new ScrollToZoomCamera(gameCameraController)
         )
 {
 }
Ejemplo n.º 6
0
 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;
    }
Ejemplo n.º 8
0
    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>();
    }
Ejemplo n.º 9
0
 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> ();
 }
Ejemplo n.º 11
0
 public EraseCellEventActions(CellEventGenerator eventGenerator, CellMapper cellMapper, GameCameraController gameCameraController)
     : base(
         null,
         null,
         new ClickToEraseCellEvent(eventGenerator, cellMapper),
         new DragToMoveCamera(gameCameraController),
         null
         )
 {
 }
Ejemplo n.º 12
0
 void Start()
 {
     fromTarget = transform;
     controller = GetComponent <GameCameraController> ();
 }
Ejemplo n.º 13
0
 public ScrollToZoomCamera(GameCameraController gameCameraController)
 {
     this.gameCameraController = gameCameraController;
 }
Ejemplo n.º 14
0
    private void SetNewCameraBounds()
    {
        GameCameraController camera = Camera.main.gameObject.GetComponent <GameCameraController>();

        camera.SetNewBounds(_collider.bounds);
    }
Ejemplo n.º 15
0
 public DragToMoveCamera(GameCameraController gameCameraController)
 {
     this.gameCameraController = gameCameraController;
 }