// Start is called before the first frame update void Start() { gameMaster = GameObject.FindGameObjectWithTag("GameMaster").GetComponent <GameMaster>(); spriteRenderer = GetComponent <SpriteRenderer>(); spacecraftControls = GetComponent <SpacecraftControls>(); trail = GameObject.Find("spacecraft_trail"); spacecraftMovement = GetComponent <SpacecraftMovement>(); spacecraftDeath = GetComponent <SpacecraftDeath>(); cinemachine = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CinemachineBrain>(); Vector2 lastCheckointPos = gameMaster.getLastCheckpointPos(); if (lastCheckointPos != null) { trail.SetActive(false); transform.position = lastCheckointPos; trail.SetActive(true); } Quaternion spacecraftRotation = gameMaster.getSpacecraftRotation(); if (spacecraftRotation != null) { transform.rotation = spacecraftRotation; } }
// Start is called before the first frame update void Start() { countdown = GameObject.Find("CountdownCanvas").GetComponent <Canvas>(); countdownAnimator = countdown.GetComponent <Animator>(); spacecraftControls = FindObjectOfType <SpacecraftControls>(); spacecraftMovement = FindObjectOfType <SpacecraftMovement>(); levelTime = FindObjectOfType <LevelTime>(); gameMaster = GameObject.FindGameObjectWithTag("GameMaster").GetComponent <GameMaster>(); playLevelCountdown = gameMaster.getPlayCountdown(); countdownTime = 4.0f; decreaseCountDownTime = countdownTime; countdownPlaying = false; if (playLevelCountdown) { beginCountdown(); } else { levelTime.startTimer(); } }
// Start is called before the first frame update void Start() { spacecraftMovement = GetComponent <SpacecraftMovement>(); }