private void OnEnable()
        {
            npcMaster = GetComponent <NPC_Master>();

            npcMaster.EventNpcDeath += TurnOffChild;
            npcMaster.EventNpcDeath += DestroyGO;
        }
Exemplo n.º 2
0
        void SetInitialReferences()
        {
            npcMaster = GetComponent <NPC_Master>();

            if (GetComponent <NavMeshAgent>() != null)
            {
                myNavMeshAgent = GetComponent <NavMeshAgent>();
            }
        }
Exemplo n.º 3
0
        void SetInitialReferences()
        {
            npcMaster = GetComponent <NPC_Master>();

            if (GetComponent <Animator>() != null)
            {
                myAnimator = GetComponent <Animator>();
            }
        }
Exemplo n.º 4
0
        void SetInitialReferences()
        {
            npcMaster = GetComponent <NPC_Master>();

            if (GetComponent <NPC_StatePattern>() != null)
            {
                npcStatePattern = GetComponent <NPC_StatePattern>();
            }
        }
Exemplo n.º 5
0
        void SetInitialReferences()
        {
            npcStatePattern = GetComponent <NPC_StatePattern>();
            npcMaster       = GetComponent <NPC_Master>();

            GameObject gameManager = GameObject.Find("GameManager");

            npcRelationsMaster = gameManager.GetComponent <GameManager_NPCRelationsMaster>();
        }
Exemplo n.º 6
0
        public void ProcessDamage(int damage)
        {
            int damageToApply = damage * damageMultiplier;

            if (npcMaster == null)
            {
                npcMaster = transform.root.GetComponent <NPC_Master>();
            }
            npcMaster.CallEventNpcDeductHealth(damageToApply);
        }
Exemplo n.º 7
0
        void SetInitialReferences()
        {
            npcMaster = transform.root.GetComponent <NPC_Master>();

            if (GetComponent <Collider>() != null)
            {
                myCollider = GetComponent <Collider>();
            }
            if (GetComponent <Rigidbody>() != null)
            {
                myRigidbody = GetComponent <Rigidbody>();
            }
        }
Exemplo n.º 8
0
        void SetInitialReferences()
        {
            gunMaster   = GetComponent <Gun_Master>();
            myTransform = transform;

            if (transform.root.GetComponent <NPC_Master>() != null)
            {
                npcMaster = transform.root.GetComponent <NPC_Master>();
            }

            if (transform.root.GetComponent <NPC_StatePattern>() != null)
            {
                npcStatePattern = transform.root.GetComponent <NPC_StatePattern>();
            }
        }
 private void Start()
 {
     npcStatePattern = gameObject.transform.root.GetComponent <NPC_StatePattern>();
     npcMaster       = gameObject.transform.root.GetComponent <NPC_Master>();
     head            = (head == null) ? npcStatePattern.head : head;
 }
Exemplo n.º 10
0
 private void Awake()
 {
     waitTime  = Time.time + 3f;
     npcMaster = transform.root.GetComponent <NPC_Master>();
 }
Exemplo n.º 11
0
 void SetInitialReferences()
 {
     npcMaster = GetComponent <NPC_Master>();
     npcHealth = (npcHealth >= npcMaxHealth) ? npcMaxHealth : npcHealth;
 }
Exemplo n.º 12
0
 void SetInitialReferences()
 {
     npcMaster = transform.root.GetComponent <NPC_Master>();
 }
Exemplo n.º 13
0
 void SetInitialReferences()
 {
     npcMaster    = transform.root.GetComponent <NPC_Master>();
     scoreManager = GameManager_References._player.GetComponent <ScoreManager> ();
 }