void Awake() { m_controller = GetComponent <PlatformerCharacterController>(); m_weaponBox = transform.Find("WeaponBox"); m_feetBox = transform.Find("FeetBox"); m_renderer = GetComponent <Renderer>(); m_hurt = GetComponent <AudioSource>(); }
public void ReloadCheckpoint() { Destroy(m_gameState.Entities); m_gameState = Instantiate(m_lastCheckpointState); m_gameState.name = "GameState"; m_gameState.Entities = Instantiate(m_lastCheckpointState.Entities); m_gameState.Entities.SetActive(true); m_gameState.Entities.name = "Entities"; m_playerCharacter = m_lastCheckpoint.SpawnPlayer(); SubscribePlayerEvents(); m_allowMovement = true; }
public PlatformerCharacterController SpawnPlayer() { m_used = true; GameObject player = (GameObject)Instantiate(Resources.Load("Prefabs/Player")); player.name = "Player"; player.transform.position = transform.position; PlatformerCharacterController pcc = player.GetComponent <PlatformerCharacterController>(); pcc.Life = GameManager.Instance.Life; CameraMovement camera = GameObject.Find("Main Camera").GetComponent <CameraMovement>(); camera.Target = player.transform; return(pcc); }
public void PlayerSpawned(PlatformerCharacterController player) { m_playerCharacter = player; SubscribePlayerEvents(); }
// Use this for initialization void Awake() { m_controller = GetComponent <PlatformerCharacterController>(); m_sideCollision = transform.Find("SideCollisionDetector"); AudioHurt = GetComponent <AudioSource>(); }