Example #1
0
 void Start()
 {
     // SUPER JANK
     StartCoroutine(showAfterTime());
     this.transform.position = ScreenUtilities.GetWSofSSPosition(0.0f, 0.0f) + new Vector3(0, 0, Camera.main.transform.position.z + 200);
     playerMovement          = GameCritical.GameMaster.Instance.m_PlayerMovement;
 }
Example #2
0
        public WarpZone SpawnDeadZone()
        {
            Vector3 topMiddleInWorldSpace = ScreenUtilities.GetWSofSSPosition(0.5f, 1.0f);

            topMiddleInWorldSpace = new Vector3(topMiddleInWorldSpace.x, topMiddleInWorldSpace.y, GameMaster.Instance.m_PlayerMovement.transform.position.z);
            m_WarpZone            = (WarpZone)Instantiate(m_WarpZonePrefab, topMiddleInWorldSpace + m_WarpZonePrefab.GetOriginOffsetPosition(), Quaternion.identity);
            return(m_WarpZone);
        }
Example #3
0
        void Start()
        {
            // calculate camera offset by a percentage. So if offset is 0.8f then ball will be 80% up the screen.
            Vector3 playerTargetLocationWS = ScreenUtilities.GetWSofSSPosition(0.5f, m_CamOffsetAsPercentage);
            Vector3 cameraTargetLocationWS = ScreenUtilities.GetWSofSSPosition(0.5f, 0.5f);
            Vector3 camOffset = playerTargetLocationWS - cameraTargetLocationWS;

            camOffset = -camOffset;
            GameMaster.Instance.m_CameraFollow.SetOffset(camOffset, m_LerpTimeToCamOffset);

            DeathStar deathStar = GameMaster.Instance.m_DeathStar;

            if (deathStar)
            {
                deathStar.SetIsMoving(false);
            }
            SetWarpParticleSystem(true);
        }
Example #4
0
        public void SetPositionLaserPost(Vector3 pos, bool onRightSide)
        {
            m_IsOnRight = onRightSide;

            this.transform.position = pos;
            m_TargetPosition        = pos;

            // get vector based on screen percentage laser takes up
            Vector3 laserVector        = ScreenUtilities.GetWSofSSPosition(m_LaserLength, 0.0f);
            Vector3 centerScreenVector = ScreenUtilities.GetWSofSSPosition(0.0f, 0.0f);

            laserVector = centerScreenVector - laserVector;

            m_LaserBlinkInstance = Instantiate(
                m_LaserBlinkPrefab,
                this.transform.position,
                Quaternion.identity,
                this.transform);

            // orient laser based on if it is on left or right side of screen.
            if (onRightSide)
            {
                this.transform.localRotation = Quaternion.Euler(0, 0, 180.0f);
                m_LaserBlinkInstance.transform.localRotation = Quaternion.Euler(0, 0, 180.0f);
                m_TargetPosition += laserVector;
            }
            else
            {
                this.transform.localRotation = Quaternion.Euler(0, 0, 0);
                m_LaserBlinkInstance.transform.localRotation = Quaternion.Euler(0, 0, 180.0f);
                m_TargetPosition -= laserVector;
            }

            // move original position of laser
            m_LineRenderer.SetPosition(0, this.transform.position);
            m_LineRenderer.SetPosition(1, this.transform.position);
        }