Пример #1
0
    private void OnEnemyCreated(Enemy enemy)
    {
        DropsItems di = enemy.gameObject.AddComponent <DropsItems>();

        DropsItems.DropData bombData = new DropsItems.DropData();
        bombData.itemName = "Bomb";
        bombData.rate     = 33;
        bombData.amount   = 1;

        di.arbitraryDrops = new DropsItems.DropData[] { bombData };
    }
Пример #2
0
    void Start()
    {
        chaser = GetComponent<ChasesPlayer>();
        hurt = GetComponent<Hurtable>();
        faces = GetComponent<FacesPlayer>();
        drops = GetComponent<DropsItems>();
        attacks = GetComponent<AttacksPlayer>();
        anim = GetComponent<Animator>();

        hurt.onDeath += hurt_onDeath;
        hurt.onHurt += hurt_onHurt;
    }
Пример #3
0
    void Start()
    {
        playerTrans = GameObject.FindGameObjectWithTag("Player").GetComponent<Transform>();
        agent = GetComponent<NavMeshAgent>();
        anim = GetComponent<Animator>();
        randMov = GetComponent<MovesRandomly>();
        drops = GetComponent<DropsItems>();
        audSrc = GetComponent<AudioSource>();

        hurt = GetComponent<Hurtable>();
        hurt.onDeath += hurt_onDeath;
    }
Пример #4
0
    void Start()
    {
        anim = GetComponent<Animator>();
        dropper = GetComponent<DropsItems>();
        chaser = GetComponent<ChasesPlayer>();
        faces = GetComponent<FacesPlayer>();
        hurt = GetComponent<Hurtable>();
        hurt.onDeath += hurt_onDeath;
        hurt.onHurt += hurt_onHurt;
        audioSrc = GetComponent<AudioSource>();

        attacks = GetComponent<AttacksPlayer>();
        attacks.onPlayerDeath += attacks_onPlayerDeath;
    }
Пример #5
0
    void Start()
    {
        anim = GetComponent<Animator>();
        dropper = GetComponent<DropsItems>();
        chaser = GetComponent<ChasesPlayer>();
        faces = GetComponent<FacesPlayer>();
        audSrc = GetComponent<AudioSource>();
        attacks = GetComponent<AttacksPlayer>();

        attacks.onPlayerHit += attacks_onPlayerHit;

        hurt = GetComponent<Hurtable>();
        hurt.onDeath += hurt_onDeath;

        hurt.onHurt += hurt_onHurt;

        tag = "enemy"; //For items to detect and deliver damage
    }
Пример #6
0
    void Start()
    {
        playerTrans = GameObject.FindGameObjectWithTag("Player").GetComponent<Transform>();
        fireBreath = GetComponentInChildren<DamagingParticleSystem>();
        anim = GetComponent<Animator>();
        audSrc = GetComponent<AudioSource>();

        drops = GetComponent<DropsItems>();

        hurt = GetComponent<Hurtable>();
        hurt.onDeath += hurt_onDeath;
    }