private void Start()
    {
        weaponSystem          = GetComponent <WeaponSystem>();
        weaponSystem.isEnnemy = true;
        // create scaled weapon
        difficulty   = DifficultyScaler;
        baseWeapon   = GetComponent <BaseWeapon>();
        scaledWeapon = baseWeapon.Clone().Scale(difficulty);
        // Equip new weapon
        weaponSystem.EquipWeapon(scaledWeapon);
        aimSystem = GetComponent <BaseAimSystem>();

        healthSystem         = GetComponent <HealthSystem>();
        healthSystem.OnDied += HealthSystem_OnDied;
        collisionSystem      = GetComponent <CharacterCollisionSystem>();
        collisionSystem.OnPlayerCollisionEnter.AddListener(BodyCollider_OnEnter);
        collisionSystem.OnPlayerCollisionExit.AddListener(BodyCollider_OnExit);
        collisionSystem.OnBulletCollisionEnter.AddListener(OnBulletCollision);

        entryDetector = rangeDetection.GetComponent <OverlapCollider>();
        entryDetector.OnEnter.AddListener(EntryDetection_OnEnter);
        rangeDetection.transform.localScale = new Vector3(targettingRange, 1, targettingRange);
    }
Esempio n. 2
0
 private void OnEnable()
 {
     _lastTool = Tool.None;
     _script   = target as OverlapCollider;
     _icon     = Resources.Load("Overlap/Icons/ic_16x16_OverlapCollider") as Texture2D;
 }