Exemplo n.º 1
0
    protected override void Awake()
    {
        base.Awake();
        mana.Init();

        // get the collider attached to the player
        _collider          = GetComponent <Collider>();
        ragdollColliders   = GetComponentsInChildren <Collider>();
        ragdollRigidbodies = GetComponentsInChildren <Rigidbody>();
        EnableRagdoll(false);
        Anim.enabled = true;
    }
    protected virtual void Awake()
    {
        health.Init();

        Anim = GetComponentInChildren <Animator>();
        rb   = GetComponent <Rigidbody>();
        col  = GetComponent <Collider>();

        Audio = GetComponents <AudioSource>();
        // Assign audio sources for weapon and vocal SFX
        // There should be 2 audio sources to handle both SFX types playing concurrently
        if (Audio.Length == 2)
        {
            WeaponAudio = Audio[0];
            VocalAudio  = Audio[1];
        }
        else if (Audio.Length < 2)
        {
            WeaponAudio = Audio[0];
            VocalAudio  = Audio[0];
        }
    }
Exemplo n.º 3
0
 public void Init_SetsCurrentValueToMax()
 {
     Assert.Zero(instance.CurrentValue);
     instance.Init();
     Assert.AreEqual(instance.maxValue, instance.CurrentValue);
 }