示例#1
0
        override protected void Awake()
        {
            base.Awake();

            GetPixelPerfectPlugin();

            GetSprite();

            ProCamera2D.AddPostMover(this);
        }
示例#2
0
        protected override void Awake()
        {
            base.Awake();

            SetRepeatingObject(ObjectToRepeat, ObjectOnStage);

            _cameraToUseTransform = CameraToUse.transform;

            ProCamera2D.AddPostMover(this);
        }
        override protected void Awake()
        {
            base.Awake();

            if (ProCamera2D == null)
            {
                return;
            }

            if (Application.isPlaying)
            {
                CalculateParallaxObjectsOffset();
            }

            foreach (var layer in ParallaxLayers)
            {
                if (layer.ParallaxCamera != null)
                {
                    layer.CameraTransform = layer.ParallaxCamera.transform;
                }
            }

            // We need this so we can toggle on/off the parallax
            _initialSpeeds = new float[ParallaxLayers.Count];
            for (int i = 0; i < _initialSpeeds.Length; i++)
            {
                _initialSpeeds[i] = ParallaxLayers[i].Speed;
            }


            // Disable the extension if the camera is not in orthographic projection
            if (ProCamera2D.GameCamera != null)
            {
                _initialOrtographicSize = ProCamera2D.GameCamera.orthographicSize;

                if (!ProCamera2D.GameCamera.orthographic)
                {
                    enabled = false;
                }
            }

            #if PC2D_TK2D_SUPPORT
            if (ProCamera2D.Tk2dCam != null)
            {
                _initialOrtographicSize = ProCamera2D.Tk2dCam.CameraSettings.orthographicSize / ProCamera2D.Tk2dCam.ZoomFactor;

                if (ProCamera2D.Tk2dCam.CameraSettings.projection != tk2dCameraSettings.ProjectionType.Orthographic)
                {
                    enabled = false;
                }
            }
            #endif

            ProCamera2D.AddPostMover(this);
        }
        override protected void Awake()
        {
            base.Awake();

            if (ProCamera2D == null)
            {
                enabled = false;
                return;
            }

            GetPixelPerfectPlugin();

            GetSprite();

            ProCamera2D.AddPostMover(this);
        }
示例#5
0
        override protected void Awake()
        {
            base.Awake();

            if (ObjectToRepeat == null)
            {
                Debug.LogWarning("ProCamera2D Repeater extension - No ObjectToRepeat defined!");
                return;
            }

            _objStartPosition = new Vector3(
                Vector3H(ObjectToRepeat.position),
                Vector3V(ObjectToRepeat.position),
                Vector3D(ObjectToRepeat.position));

            _cameraToUseTransform = CameraToUse.transform;

            if (ObjectOnStage)
            {
                InitCopy(ObjectToRepeat);
            }

            ProCamera2D.AddPostMover(this);
        }