Пример #1
0
    private void InitGame(bool isReloadingGame_ = false)
    {
        m_isPaused = true;

        m_startMenuInstance = GameObject.Find(m_startMenuPrefab.name);
        m_startMenuInstance.SetActive(true);

        m_inGameCanvasInstance = GameObject.Find(m_inGameCanvasPrefab.name);
        if (m_inGameCanvasInstance != null)
        {
            m_inGameCanvasInstance.SetActive(false);
        }

        if (isReloadingGame_)
        {
            m_gameOverCanvasInstance = Instantiate(m_gameOverCanvasPrefab);
            m_gameOverCanvasInstance.SetActive(true);
            PointsRenderer pointsRenderer = m_gameOverCanvasInstance.GetComponentInChildren <PointsRenderer>(true) as PointsRenderer;
            if (pointsRenderer)
            {
                pointsRenderer.PointsSet(m_finalScore);
            }
        }
        Time.timeScale = 0;
    }
Пример #2
0
        public void SetUp()
        {
            containingObject = new GameObject();
            subject          = containingObject.AddComponent <PointsRenderer>();

            start   = CreatePrimitive(PrimitiveType.Cube, Vector3.one * 0.01f, StartName);
            segment = CreatePrimitive(PrimitiveType.Cube, Vector3.one * 0.01f, SegmentName);
            end     = CreatePrimitive(PrimitiveType.Cube, Vector3.one * 0.01f, EndName);
        }
Пример #3
0
    private void Start()
    {
        m_rb = GetComponent <Rigidbody2D>();

        m_rb.velocity    = m_velocityVector * m_velocity;
        m_angleVector    = Vector3.one * m_velocity;
        m_pointsRenderer = m_pointsTextInstance.GetComponent <PointsRenderer>();
        m_pointsRenderer.PointsSet(m_points);
    }