public void forceThisSpawnForPlayer(Vector3 thisSpawnLocation) { GameObject thisController = GameObject.FindWithTag("PlayerController"); pcController onController = thisController.GetComponent <pcController>(); onController.reSpawnLocation = thisSpawnLocation; }
public void setNewSpawnForPlayer() { GameObject thisController = GameObject.FindWithTag("PlayerController"); pcController onController = thisController.GetComponent <pcController>(); switch (currentScene) { case GameState.levelOne: onController.reSpawnLocation = levelOneStartingLocation; break; case GameState.levelTwo: onController.reSpawnLocation = levelTwoStartingLocation; break; } }
// Start is called before the first frame update void Start() { if (thisRigid == null) { thisRigid = GetComponent <Rigidbody2D>(); } if (thisBoss == null) { thisBoss = GameObject.FindWithTag("PlayerController"); } if (thisAudio == null) { if (GameObject.FindWithTag("AudioBasis") != null) { GameObject thisAudioHolder = GameObject.FindWithTag("AudioBasis"); thisAudio = thisAudioHolder.GetComponent <AudioSource>(); } } maxPlayerHealth = GameManager.instance.maxPlayerHealth; thisFeature = thisBoss.GetComponent <pcController>(); raycastDistanceForGrounding = GameManager.instance.distanceToGrounding; }