using UnityEngine; using System.Collections; using System.Collections.Generic; using GameKitController.Audio; public class brainwashAIProjectile : projectileSystem { [Header ("Custom Settings")] [Space] public string factionToConfigure = "Friend Soldiers"; public bool setNewName; public string newName; public bool AIIsFriend; public string newTag = "friend"; public bool followPartnerOnTriggerEnabled = true; public bool setPlayerAsPartner = true; public bool useRemoteEvents; //when the bullet touchs a surface, then public void checkObjectDetected (Collider col) { if (canActivateEffect (col)) { if (currentProjectileInfo.impactAudioElement != null) { currentProjectileInfo.impactAudioElement.audioSource = GetComponent (); AudioPlayer.PlayOneShot (currentProjectileInfo.impactAudioElement, gameObject); } setProjectileUsedState (true); objectToDamage = col.GetComponent ().gameObject; mainRigidbody.isKinematic = true; Rigidbody objectToDamageRigidbody = objectToDamage.GetComponent (); Transform currentCharacter = null; GameObject currentCharacterGameObject = applyDamage.getCharacterOrVehicle (objectToDamage); if (currentCharacterGameObject != null) { currentCharacter = currentCharacterGameObject.transform; } if (objectToDamageRigidbody != null) { if (currentCharacter != null) { GKC_Utils.activateBrainWashOnCharacter (currentCharacter.gameObject, factionToConfigure, newTag, setNewName, newName, followPartnerOnTriggerEnabled, setPlayerAsPartner, AIIsFriend, currentProjectileInfo.owner, useRemoteEvents, currentProjectileInfo.remoteEventNameList); } } disableBullet (currentProjectileInfo.impactDisableTimer); } } public override void resetProjectile () { base.resetProjectile (); } }