/// <summary> /// Initialize the module. /// </summary> /// <param name="player">The player controller itself.</param> /// <param name="input">Input, if available.</param> public void Initialize(GoldPlayerController player, GoldInput input) { // If the module has already been initialized, stop here. if (HasBeenInitialized) { return; } playerController = player; if (input != null) { playerInput = input; } if (player != null) { rootActionMap = player.ActionMap; } OnInitialize(); HasBeenInitialized = true; }
/// <summary> /// Gets all the references the player needs. /// </summary> public virtual void GetReferences() { playerInput = gameObject.GetComponent <GoldInput>(); controller = gameObject.GetComponent <CharacterController>(); }