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

            npcMaster.EventNpcDeath += TurnOffChild;
            npcMaster.EventNpcDeath += DestroyGO;
        }
示例#2
0
        void SetInitialReferences()
        {
            npcMaster = GetComponent <NPC_Master>();

            if (GetComponent <NavMeshAgent>() != null)
            {
                myNavMeshAgent = GetComponent <NavMeshAgent>();
            }
        }
示例#3
0
        void SetInitialReferences()
        {
            npcMaster = GetComponent <NPC_Master>();

            if (GetComponent <Animator>() != null)
            {
                myAnimator = GetComponent <Animator>();
            }
        }
示例#4
0
        void SetInitialReferences()
        {
            npcMaster = GetComponent <NPC_Master>();

            if (GetComponent <NPC_StatePattern>() != null)
            {
                npcStatePattern = GetComponent <NPC_StatePattern>();
            }
        }
示例#5
0
        void SetInitialReferences()
        {
            npcStatePattern = GetComponent <NPC_StatePattern>();
            npcMaster       = GetComponent <NPC_Master>();

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

            npcRelationsMaster = gameManager.GetComponent <GameManager_NPCRelationsMaster>();
        }
示例#6
0
        public void ProcessDamage(int damage)
        {
            int damageToApply = damage * damageMultiplier;

            if (npcMaster == null)
            {
                npcMaster = transform.root.GetComponent <NPC_Master>();
            }
            npcMaster.CallEventNpcDeductHealth(damageToApply);
        }
示例#7
0
        void SetInitialReferences()
        {
            npcMaster = transform.root.GetComponent <NPC_Master>();

            if (GetComponent <Collider>() != null)
            {
                myCollider = GetComponent <Collider>();
            }
            if (GetComponent <Rigidbody>() != null)
            {
                myRigidbody = GetComponent <Rigidbody>();
            }
        }
示例#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;
 }
 private void Awake()
 {
     waitTime  = Time.time + 3f;
     npcMaster = transform.root.GetComponent <NPC_Master>();
 }
示例#11
0
 void SetInitialReferences()
 {
     npcMaster = GetComponent <NPC_Master>();
     npcHealth = (npcHealth >= npcMaxHealth) ? npcMaxHealth : npcHealth;
 }
示例#12
0
 void SetInitialReferences()
 {
     npcMaster = transform.root.GetComponent <NPC_Master>();
 }
示例#13
0
 void SetInitialReferences()
 {
     npcMaster    = transform.root.GetComponent <NPC_Master>();
     scoreManager = GameManager_References._player.GetComponent <ScoreManager> ();
 }