void Start()
 {
     gameOverState = false;
     endPanel.SetActive(false); // Hide while game is being played
     playerData     = GameObject.Find("Player").GetComponent <PlayerBehaviour>();
     scoreCollision = GameObject.Find("Score Collider").GetComponent <ScoreCollision>();
 }
    // Use this for initialization // start and update will call themselves through unity
    void Start()
    {
        playerBehaviour = GameObject.Find("Player").GetComponent <PlayerBehaviour>();
        stateController = GameObject.Find("State Controller").GetComponent <StateController>();
        scoreCollision  = GameObject.Find("Score Collider").GetComponent <ScoreCollision>();
        id = GameObject.Find("Incoming Object Detection").GetComponent <IncomingDetection>();

        slideDeathCounter = StoredData.slideDeath;
        jumpDeathCounter  = StoredData.jumpDeath;
        action.reward3    = Mathf.Max(StoredData.reward2, StoredData.reward1) + 1;
    }
コード例 #3
0
 /// <summary>
 /// On Score collision event method.
 /// </summary>
 /// <param name="score">Score to add.</param>
 protected virtual void OnScoreCollision(ushort score) =>
 ScoreCollision?.Invoke(score);