Пример #1
0
        void Start()
        {
            _camAnimation = FindObjectOfType <CameraAnimation>();
            _character    = FindObjectOfType <ThirdPersonCharacter>();
            _autoCam      = FindObjectOfType <AutoCam>();

            _originalSpeed    = _character.m_MoveSpeedMultiplier;
            _originalMove     = _autoCam.m_MoveSpeed;
            _originalTurn     = _autoCam.m_TurnSpeed;
            _originalRoll     = _autoCam.m_RollSpeed;
            _originalSpinTurn = _autoCam.m_SpinTurnLimit;

            var messageBus = ApplicationManager.Instance.GetService <IMessageBus>();

            messageBus.AsObservable <OnZoomChanged>()
            .Subscribe(msg =>
            {
                if (msg.LevelOfDetails == _levelOfDetails)
                {
                    return;
                }

                bool isZoomOut = msg.LevelOfDetails < _levelOfDetails;

                _camAnimation.Play(_character.transform, CameraAnimationDuration, isZoomOut);
                _levelOfDetails = msg.LevelOfDetails;
                TweakMovementValues(isZoomOut);
            });
        }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     cam = this.GetComponent <AutoCam>();
     GameManager.mainCam = this.GetComponent <CameraControl>();
     pivot = transform.Find("Pivot");
     focus = cam.Target.Find("Pivot");
 }
    private void Start()
    {
        myCamera         = GetComponentInChildren <Camera>();
        autoCam          = GetComponent <AutoCam>();
        cameraController = GetComponent <CameraController>();

        checkSize();
    }
Пример #4
0
    private IEnumerator Start()
    {
        yield return(new WaitForSeconds(1));

        camController = GetComponent <AutoCam>();
        if (controllerSO.model.player != null)
        {
            camController.SetTarget(controllerSO.model.player.transform);
        }
    }
    public void ActivateMenuOnUnit(UnitController unit)
    {
        currentUnit = unit;
        Camera.main.GetComponentInParent <CameraController>().enabled = false;
        AutoCam ac = Camera.main.GetComponentInParent <AutoCam>();

        ac.enabled = true;
        ac.SetTarget(unit.transform);
        activeMenu.SetActive(true);
    }
Пример #6
0
    public void SwitchToPlayer(Player player)
    {
        state = State.Character;
        superiorCamera.enabled  = false;
        characterCamera.enabled = camerasEnabled;
        AutoCam autoCam = characterCamera.GetComponent <AutoCam>();

        autoCam.enabled  = true;
        autoCam.m_Target = player.seenCam;
    }
Пример #7
0
    public override void OnStartClient()
    {
        gameBoard.gameObject.SetActive(false);
        cam = Camera.main.GetComponent <AutoCam>();

        FleetVessel.OnShipMoveStart  += Ship_OnShipMoveStart;
        FleetVessel.OnShipMoveEnd    += Ship_OnShipMoveEnd;
        FleetVessel.OnShipSpawnStart += Ship_OnShipSpawnStart;
        FleetVessel.OnShipSpawnEnd   += Ship_OnShipSpawnEnd;
    }
Пример #8
0
        private void Awake()
        {
            //Windows以外は無効にする
#if !UNITY_STANDALONE_WIN
            Destroy(gameObject);
#endif
            displayCameras = Config.displayCameras;

            vCamera = GetComponent <Camera>();
            autoCam = GetComponent <AutoCam>();
        }
Пример #9
0
    //register clicks

    // Start is called before the first frame update
    void Start()
    {
        //get the tile based on this objects position in heighracy
        //regionColour = GetComponent<Material>();
        //Debug.Log("Setting tile colour");
        // spawner = G
        rend         = GetComponent <Renderer>();
        rend.enabled = true;
        camera       = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <AutoCam>();
        //set colour of tile based on region
        if (this.gameObject.tag == "Background")
        {
            rend.sharedMaterial = regionColours[4];
        }
    }
Пример #10
0
    // Use this for initialization
    private void Start()
    {
        deathCanvas = Instantiate(deathCanvas);
        text        = deathCanvas.GetComponent <DeathCanvas>().text;
        background  = deathCanvas.GetComponent <DeathCanvas>().background;

        cam = Camera.main.transform.parent.transform.parent.GetComponent <AutoCam>();
        cam.SetTarget(CamTarget);
        CamEndPosition    = new Vector3(transform.position.x + CamEndPosition.x, transform.position.y + CamEndPosition.y, transform.position.z + CamEndPosition.z);
        beginTime         = Time.time;
        textColor.a       = textAlpha;
        text.color        = textColor;
        backgroundColor.a = backgroundAlpha;
        background.color  = backgroundColor;
    }
Пример #11
0
    void Awake()
    {
        _loginObject = transform.GetChild(0).gameObject;

        if (IsOnline)
        {
            _loginObject.SetActive(true);
        }

        else
        {
            _loginObject.SetActive(false);

            // Setup spawn positions.

            _spawnsAvailableOffline = new List <Transform>();

            Transform playerSpawns = transform.GetChild(1);

            for (int i = 0; i < playerSpawns.childCount; ++i)
            {
                _spawnsAvailableOffline.Add(playerSpawns.GetChild(i));
            }

            // Spawn player at spawn position 0.

            Transform playerSpawn = _spawnsAvailableOffline[0];

            _spawnsAvailableOffline.RemoveAt(0);

            GameObject player = (GameObject)Instantiate(PlayerPrefabOffline, new Vector3(playerSpawn.position.x, playerSpawn.position.y + 8, playerSpawn.position.z), playerSpawn.rotation);

            _camera = GameObject.Find("Cameras").transform.GetChild(0).GetComponent <AutoCam>();

            _camera.Target = player.transform;

            // Spawn AI vehicles at subsequent available spawn positions.

            for (int i = 0; i < AiCount; ++i)
            {
                playerSpawn = _spawnsAvailableOffline[0];

                _spawnsAvailableOffline.RemoveAt(0);

                GameObject aiVehicle = (GameObject)Instantiate(AiVehiclePrefab, new Vector3(playerSpawn.position.x, playerSpawn.position.y + 8, playerSpawn.position.z), playerSpawn.rotation);
            }
        }
    }
Пример #12
0
    public void OnWin()
    {
        Camera  cam = Camera.main;
        AutoCam ac  = FindObjectOfType <AutoCam>();

        ac.enabled = false;
        FindObjectOfType <ProtectCameraFromWallClip>().enabled = false;
        //cam.transform.SetParent(null);
        cam.transform.position = camStartTrans.position;
        cam.transform.rotation = camStartTrans.rotation;
        cam.transform.DOMove(camEndTrans.position, 3);
        cam.transform.DORotateQuaternion(camEndTrans.rotation, 3).OnComplete(() =>
        {
            StartCoroutine(AutoRotate(cam));
        });
    }
        void Start()
        {
            // Find the Aeroplane's camera.
            _autoCam = GameObject.FindObjectOfType <AutoCam>();
            _pivot   = GameObject.Find("Pivot");

            // Find the user-controlled airplane.
            var userControl = GameObject.FindObjectOfType <AirplaneUserControl>();

            if (userControl == null)
            {
                Debug.LogError("FLIGHT KIT StartLevelSequence: an AeroplaneUserControl" +
                               "component is missing in the scene");
            }
            _airplane = userControl.gameObject;

            // If there is no AutoCam, we're not on a level and need to turn off this component.
            if (_autoCam == null)
            {
                Debug.LogWarning("Can't find AutoCam component in the scene.");
                this.enabled = false;
                return;
            }

            // Turn off camera turning until start of the gameplay.
            _turnSpeed         = _autoCam.TurnSpeed;
            _autoCam.TurnSpeed = 0;

            // Skip menu (for debug).
            if (playOnStart)
            {
                StartLevel();

                // Publish play event from code since it will not be published by Play button.
                var uiEvents = GameObject.FindObjectOfType <UIEventsPublisher>();
                if (uiEvents != null)
                {
                    uiEvents.PublishPlay();
                }
            }
            else
            {
                // UIEventsPublisher.OnPlayEvent += StartLevel;
                UIEventsPublisher1.OnPlayEvent += StartLevel;
            }
        }
Пример #14
0
    public void Start()
    {
        _controller = (ViewController)transform.parent.GetComponent <Login>().Controller;

        _players = new Dictionary <Guid, GameObject>();

        _spawnsAvailable = new List <Transform>();
        _spawnsTaken     = new Dictionary <Guid, Transform>();

        Transform playerSpawns = transform.parent.parent.GetChild(1);

        for (int i = 0; i < playerSpawns.childCount; ++i)
        {
            _spawnsAvailable.Add(playerSpawns.GetChild(i));
        }

        _camera = GameObject.Find("Cameras").transform.GetChild(0).GetComponent <AutoCam>();
    }
 // Start is called before the first frame update
 void Awake()
 {
     lookCam = GetComponent <AutoCam>();
 }
Пример #16
0
 private void Awake()
 {
     m_skillSystem   = this.GetComponent <CharacterSkillSystem>();
     m_characterMove = this.GetComponent <CharacterMove>();
     m_autoCam       = Camera.main.GetComponent <AutoCam>();
 }
Пример #17
0
 private void Awake()
 {
     m_characterMove      = this.GetComponent <Character3DMove>();
     m_autoCam            = Camera.main.GetComponent <AutoCam>();
     m_animatorController = this.GetComponent <AnimatorController>();
 }
    public void RTSwitch()
    {
        AutoCam ac = RTCam.GetComponent <AutoCam>();

        ac.SetTarget(TheCar);
    }