Exemple #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();
        }
    }
Exemple #2
0
 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;
 }
Exemple #4
0
 public GenerateCellEventActions(CellEventGenerator eventGenerator, GameCameraController gameCameraController)
     : base(
         null,
         null,
         new ClickToGenerateCellEvent(eventGenerator),
         new DragToMoveCamera(gameCameraController),
         null
         )
 {
 }
Exemple #5
0
 public ClickToClickableObjectActions(GameCameraController gameCameraController)
     : base(
         null,
         new ClickDownToClickableObject(),
         new ClickUpToClickableObject(),
         new DragToMoveCamera(gameCameraController),
         new ScrollToZoomCamera(gameCameraController)
         )
 {
 }
Exemple #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;
    }
Exemple #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>();
    }
Exemple #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> ();
 }
Exemple #11
0
 public EraseCellEventActions(CellEventGenerator eventGenerator, CellMapper cellMapper, GameCameraController gameCameraController)
     : base(
         null,
         null,
         new ClickToEraseCellEvent(eventGenerator, cellMapper),
         new DragToMoveCamera(gameCameraController),
         null
         )
 {
 }
Exemple #12
0
 void Start()
 {
     fromTarget = transform;
     controller = GetComponent <GameCameraController> ();
 }
Exemple #13
0
 public ScrollToZoomCamera(GameCameraController gameCameraController)
 {
     this.gameCameraController = gameCameraController;
 }
Exemple #14
0
    private void SetNewCameraBounds()
    {
        GameCameraController camera = Camera.main.gameObject.GetComponent <GameCameraController>();

        camera.SetNewBounds(_collider.bounds);
    }
Exemple #15
0
 public DragToMoveCamera(GameCameraController gameCameraController)
 {
     this.gameCameraController = gameCameraController;
 }