Ejemplo n.º 1
0
    void Initialize()
    {
        m_LayerMaskGround = CLayers.GetLayerMask_Ground();
        m_bGrounded       = Physics.CheckSphere(transform.position, 1.5f, m_LayerMaskGround);
        if (m_bGrounded == false)
        {
            print("Warning: " + gameObject.name + " isn't on the ground");
        }
        /////////RIGIDBODY/////////
        m_Rigidbody = GetComponent <Rigidbody>();
        m_fOrigDrag = GetRigidbody().drag;
        m_fOrigMass = GetRigidbody().mass;

        ///////////AI///////////
        m_Animator = GetComponent <Animator>();
        if (GetComponent <CAI>())
        {
            m_bIsAI = true;
            m_AI    = GetComponent <CAI>();
            GetAnimator().SetFloat("SpeedMultiplier", 1);
            GetRigidbody().mass = m_fMassNonKnockback;
        }
        else
        {
            m_bIsAI = false;
        }
    }
Ejemplo n.º 2
0
 //Update senses every few frames instead of every frame
 //add Time.deltaTime to a float every frame even if i don't update that frame.
 //This is to accumulate the correct values that will be used to multiply with, instead of Time.deltaTime
 void Start()
 {
     m_LayerMask         = ~CLayers.GetLayerMask_EnemyAndWeapon(); //layermask to ignore collisions with EnemyLayer and Weapon Layer
     m_AI                = GetComponent <CAI>();
     m_Player            = CPlayerControlls.GetPlayer();
     m_fCurrentSightCone = m_fNormalSightCone;
     if (m_Head == null)
     {
         print("Error: Variable m_Head of " + gameObject.name + " prefab was NULL!");
         m_Head = transform;
     }
 }
Ejemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     m_LayerMask = CLayers.GetLayerMask_Enemy();
 }