/// <summary> /// Constructor /// </summary> /// <param name="character">Personaje a controlar</param> public StopState(FSMBehaviour character) : base(character, StateID.Stop) { Direction = Vector3.zero; TrackPosition = character.GetComponent<TrackLocation>(); }
/// <summary> /// Inicializacion /// </summary> private void Start() { // Inicializo variables TrackPosition = Player.GetComponentInChildren<TrackLocation>(); }
protected override void Start() { // Busco componentes TrackPosition = GetComponentInChildren<TrackLocation>(); Movement = GetComponentInChildren<MovementManager>(); // Desactivo el componente de inmunidad GetComponentInChildren<Inmunity>().enabled = false; // Configuro las animaciones Mecanim = GetComponentInChildren<Animator>(); MecanimState = Animator.StringToHash("StateID"); // Localizo las capas ObstaclesLayer = LayerMask.NameToLayer("Obstacles"); RampsLayer = LayerMask.NameToLayer("Ramps"); base.Start(); // Agrego los sonidos Sounds = new List<AudioSource>(); foreach (State state in StatesMap.Values) { AudioSource source = gameObject.AddComponent<AudioSource>(); source.clip = (AudioClip)Resources.Load("Audio/" + state.ID.ToString()); if (state.ID == StateID.Forward) source.loop = true; Sounds.Add(source); } }
protected override void Start() { TrackPosition = GetComponentInChildren<TrackLocation>(); PlayerLocation = GameManager.Instance.PlayerLocation; base.Start(); }
/// <summary> /// Inicializacion /// </summary> private void Start() { // Inicializo variables TrackPosition = GetComponentInChildren<TrackLocation>(); // Busco los componentes Controller = GetComponentInChildren<CharacterController>(); RigidbodyComponent = GetComponentInChildren<Rigidbody>(); Me = transform; }