void Start() { mainGameScript = FindObjectOfType <MainGameScript>(); playerGameScript = FindObjectOfType <PlayerGameScript>(); virtualCamera = GetComponent <CinemachineVirtualCamera>(); }
void OnCollisionStay2D(Collision2D other) { if (other.gameObject.CompareTag("Player")) { currentPlayer = other.gameObject.GetComponent <PlayerGameScript>(); } }
void OnCollisionExit2D(Collision2D other) { if (other.gameObject.CompareTag("Player")) { if (other.gameObject == currentPlayer.gameObject) { currentPlayer = null; } } }
void Start() { playerGameScript = FindObjectOfType <PlayerGameScript>(); infoPanel = FindObjectOfType <InfoPanel>(); sellingPanel = FindObjectOfType <SellingPanel>(); mainMenu = FindObjectOfType <MainMenu>(); audioPlayer = FindObjectOfType <AudioPlayer>(); gameState = GameState.Menu; fishingTimeLeft = fishingTime; currentFishSchool = null; tutorialProgress = 0; endOfDayDone = false; currentDay = 0; money = 0; highScore = PlayerPrefs.GetInt("HighScore", 0); audioPlayer.StartAmbiance(); }
void Start() { currentPlayer = null; weight = Random.Range(0.2f, 1.0f); }