Exemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        _startScore = Score;
        _player     = GameObject.FindWithTag("PlayerBody").GetComponent <BangsPhysics.RigidBody>();
        _audio      = GetComponentInChildren <Audio>();
        _audio.Forwards(true);

        Transform startTransform = GetComponent <Transform>();

        Restart.onStateDown   += Restart_onStateDown;
        TracePath.onStateDown += TracePath_onStateDown;
        TracePath.onStateUp   += TracePath_onStateUp;

        _frames = new Stack <FrameInfo>();

        _hud = HUD.GetComponent <HUD>();

        ScoreManager = new scoremanager();
        UpdateHighscores();

        Attractors = FindObjectsOfType <Attractor>();

        LineRenderer                 = gameObject.AddComponent <LineRenderer>();
        LineRenderer.material        = new Material(Shader.Find("Sprites/Default"));
        LineRenderer.widthMultiplier = 0.04f;
        LineRenderer.positionCount   = TotalSimulatePoints;
    }
Exemplo n.º 2
0
 void OnEnable()
 {
     _player         = GameObject.FindWithTag("PlayerBody").GetComponent <BangsPhysics.RigidBody>();
     _particleSystem = GetComponent <ParticleSystem>();
 }
Exemplo n.º 3
0
    void OnEnable()
    {
        _player = GameObject.FindWithTag("PlayerBody").GetComponent <BangsPhysics.RigidBody>();

        _gameState = _player.GetComponent <GameState>();
    }