Ejemplo n.º 1
0
        private void Awake()
        {
            hitEventChannel = GameObject.FindGameObjectWithTag(Tags.GameController).GetComponent <HitEventChannel>();

            var aSources = GetComponents(typeof(AudioSource));

            audioSource = (AudioSource)aSources[7];
        }
        private void InitializeComponent()
        {
            health    = GetComponent <Health>();
            mover     = GetComponent <Mover>();
            destroyer = GetComponent <RootDestroyer>();

            var rootTransform = transform.root;

            npcSensorSight = rootTransform.GetComponentInChildren <NpcSensorSight>();
            npcSensorSound = rootTransform.GetComponentInChildren <NpcSensorSound>();
            hitSensor      = rootTransform.GetComponentInChildren <HitSensor>();
            handController = hand.GetComponent <HandController>();

            npcDeathEventChannel = GameObject.FindWithTag(Tags.GameController).GetComponent <NpcDeathEventChannel>();
            hitEventChannel      = GameObject.FindWithTag(Tags.GameController).GetComponent <HitEventChannel>();
        }