예제 #1
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);
        }
예제 #2
0
        void Awake()
        {
            // create static instance if there is not one
            if (Instance == null)
            {
                Instance = this;
            }
            else
            {
                if (Instance != this)
                {
                    Destroy(this.gameObject);
                }
            }

            if (m_MusicManager == null)
            {
                m_MusicManager = FindObjectOfType <MusicManager>();
            }
            if (m_NotificationManager == null)
            {
                m_NotificationManager = FindObjectOfType <NotificationManager>();
            }
            if (m_PlayerDecorations == null)
            {
                m_PlayerDecorations = FindObjectOfType <PlayerDecorations>();
            }
            if (m_DatabaseManager == null)
            {
                m_DatabaseManager = FindObjectOfType <DatabaseManager>();
            }
            if (m_PlayerMovement == null)
            {
                m_PlayerMovement = FindObjectOfType <PlayerMovement>();
            }
            if (m_UIManager == null)
            {
                m_UIManager = FindObjectOfType <UIManager>();
            }
            if (m_DeathStar == null)
            {
                m_DeathStar = FindObjectOfType <DeathStar>();
            }
            if (m_CameraFollow == null)
            {
                m_CameraFollow = FindObjectOfType <CameraFollow>();
            }
            if (m_WarpZoneManager == null)
            {
                m_WarpZoneManager = FindObjectOfType <WarpZoneManager>();
            }
            if (m_BackDropManager == null)
            {
                m_BackDropManager = FindObjectOfType <BackdropManager>();
            }
            if (m_StatsManager == null)
            {
                m_StatsManager = FindObjectOfType <StatsManager>();
            }
            if (m_PlayerStats == null)
            {
                m_PlayerStats = FindObjectOfType <PlayerStats>();
            }
            if (m_DadEventManager == null)
            {
                m_DadEventManager = FindObjectOfType <DadEventManager>();
            }
            if (m_PlayerBoost == null)
            {
                m_PlayerBoost = FindObjectOfType <PlayerBoost>();
            }
            if (m_SolarSystemSpawner == null)
            {
                m_SolarSystemSpawner = FindObjectOfType <SolarSystemSpawner>();
            }
            if (m_StreakManager == null)
            {
                m_StreakManager = FindObjectOfType <StreakManager>();
            }
        }