Example #1
0
 /// <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>();
 }
Example #2
0
 /// <summary>
 /// Inicializacion
 /// </summary>
 private void Start()
 {
     // Inicializo variables
     TrackPosition = Player.GetComponentInChildren<TrackLocation>();
 }
Example #3
0
    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);
        }
    }
Example #4
0
 protected override void Start()
 {
     TrackPosition = GetComponentInChildren<TrackLocation>();
     PlayerLocation = GameManager.Instance.PlayerLocation;
     base.Start();
 }
Example #5
0
    /// <summary>
    /// Inicializacion
    /// </summary>
    private void Start()
    {
        // Inicializo variables
        TrackPosition = GetComponentInChildren<TrackLocation>();

        // Busco los componentes
        Controller = GetComponentInChildren<CharacterController>();
        RigidbodyComponent = GetComponentInChildren<Rigidbody>();
        Me = transform;
    }