コード例 #1
0
        void LoadStyles()
        {
            Texture textureDone  = (Texture)Resources.Load("ic_done");
            Texture textureError = (Texture)Resources.Load("ic_error_outline");

            m_PluginStatus = new StatusContent(
                new GUIContent("Android Performance Tuner is enabled", textureDone),
                new GUIContent("Android Performance Tuner is disabled", textureError));

            m_ApiStatus = new StatusContent(
                new GUIContent("API key is not set", textureError),
                new GUIContent("API key is set", textureDone));

            m_FidelityModeStatus = new StatusContent(
                new GUIContent("Using custom fidelity", textureDone),
                new GUIContent("Using default fidelity", textureDone));

            m_AnnotationModeStatus = new StatusContent(
                new GUIContent("Using custom annotation", textureDone),
                new GUIContent("Using default annotation", textureDone));

            m_LoadingAnnotationStatus = new StatusContent(
                new GUIContent("Remove loading state from custom annotation", textureError,
                               Names.removeLoadingStateTooltip),
                new GUIContent("Remove loading state from default annotation", textureError,
                               Names.removeLoadingStateTooltip));

            m_NoFidelityMessages = new GUIContent("Number of quality levels is 0", textureError);
        }
コード例 #2
0
        void LoadStyles()
        {
            Texture textureDone  = (Texture)Resources.Load("ic_done");
            Texture textureError = (Texture)Resources.Load("ic_error_outline");

            m_PluginStatus = new StatusContent(
                new GUIContent("Android Performance Tuner is enabled", textureDone),
                new GUIContent("Android Performance Tuner is disabled", textureError));

            m_ApiStatus = new StatusContent(
                new GUIContent("API key is not set", textureError),
                new GUIContent("API key is set", textureDone));

            m_FidelityModeStatus = new StatusContent(
                new GUIContent("Using custom fidelity", textureDone),
                new GUIContent("Using default fidelity", textureDone));

            m_AnnotationModeStatus = new StatusContent(
                new GUIContent("Using custom annotation", textureDone),
                new GUIContent("Using default annotation", textureDone));

            m_LoadingAnnotationStatus = new StatusContent(
                new GUIContent("A loading state annotation is present", textureDone),
                new GUIContent("A loading state annotation is missing.", textureError));
        }
コード例 #3
0
    private IEnumerator DoToggleDebug()
    {
        _active = !_active;

        StatusContent sc = Camera.main.GetComponentInChildren <StatusContent>();

        sc.OnStatusChange((_active ? "Activating " : "Deactivating ") + "debug info", (int)_delay);

        yield return(new WaitForSeconds(_delay));

        if (!Common.IsPointerLookingToGameObject(gameObject))
        {
            sc.OnStatusChange("Idle.");

            yield break;
        }

        for (int _i = 0; _i < DebugDisplays.Length; _i++)
        {
            if (DebugDisplays[_i] != null)
            {
                DebugDisplays[_i].SetActive(_active);
            }
        }

        sc.OnStatusChange("Idle.");
    }
コード例 #4
0
    private IEnumerator Launch(Rigidbody rigidbody, Vector3 force = default(Vector3))
    {
        _countTime = Time.time;

        if (_trajectoryRenderer.positionCount > 0)
        {
            _points.Clear();

            _trajectoryRenderer.positionCount = 0;
            _trajectoryRenderer.SetPositions(_points.ToArray());
        }

        _isTrajectoryDrawn = false;

        var goLO = rigidbody.gameObject.GetComponent <LaunchableObject>();

        StatusContent sc = Camera.main.GetComponentInChildren <StatusContent>();

        sc.OnStatusChange("Launching in", (int)_preLaunchDelay);

        yield return(new WaitForSeconds(_preLaunchDelay));

        if (!Common.IsPointerLookingToGameObject(rigidbody.gameObject))
        {
            MakeBallLaunchable(rigidbody.gameObject);

            sc.OnStatusChange("Idle.");

            yield break;
        }

        rigidbody.AddForce(force != default(Vector3) ? force : LaunchForce, ForceMode.Impulse);

        sc.OnStartPlayerAnimation(true);
        sc.OnStatusSFXPlay(true);
        sc.OnStatusChange("Launched!");

        yield return(new WaitForSeconds(_postLaunchDelay));

        sc.OnStatusChange("Idle.");

        goLO.IsLaunched = true;
    }