add ckg
plantilla base para movimiento básico
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
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<AudioSource> ();
|
||||
AudioPlayer.PlayOneShot (currentProjectileInfo.impactAudioElement, gameObject);
|
||||
}
|
||||
|
||||
setProjectileUsedState (true);
|
||||
|
||||
objectToDamage = col.GetComponent<Collider> ().gameObject;
|
||||
|
||||
mainRigidbody.isKinematic = true;
|
||||
|
||||
|
||||
Rigidbody objectToDamageRigidbody = objectToDamage.GetComponent<Rigidbody> ();
|
||||
|
||||
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 ();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3bb53fc348906ac46831436b1831e807
|
||||
timeCreated: 1614339086
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Powers/New Projectiles Behaviors/brainwashAIProjectile.cs
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,62 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using GameKitController.Audio;
|
||||
|
||||
public class removeGravityFromCharactersProjectile : projectileSystem
|
||||
{
|
||||
[Header ("Custom Settings")]
|
||||
[Space]
|
||||
|
||||
public string remoteEventName = "Remove Gravity From Character";
|
||||
|
||||
public applyEffectOnArea mainAreaEffectOnArea;
|
||||
|
||||
//when the bullet touchs a surface, then
|
||||
public void checkObjectDetected (Collider col)
|
||||
{
|
||||
if (canActivateEffect (col)) {
|
||||
if (currentProjectileInfo.impactAudioElement != null) {
|
||||
currentProjectileInfo.impactAudioElement.audioSource = GetComponent<AudioSource> ();
|
||||
AudioPlayer.PlayOneShot (currentProjectileInfo.impactAudioElement, gameObject);
|
||||
}
|
||||
|
||||
setProjectileUsedState (true);
|
||||
|
||||
mainAreaEffectOnArea.gameObject.SetActive (true);
|
||||
|
||||
mainAreaEffectOnArea.setEffectActiveState (true);
|
||||
|
||||
mainRigidbody.isKinematic = true;
|
||||
|
||||
creatImpactParticles ();
|
||||
|
||||
disableBullet (currentProjectileInfo.impactDisableTimer);
|
||||
}
|
||||
}
|
||||
|
||||
public override void resetProjectile ()
|
||||
{
|
||||
base.resetProjectile ();
|
||||
|
||||
mainAreaEffectOnArea.gameObject.SetActive (false);
|
||||
|
||||
mainAreaEffectOnArea.setEffectActiveState (false);
|
||||
}
|
||||
|
||||
public void applyEffect (GameObject objectToAffect)
|
||||
{
|
||||
if (objectToAffect != null) {
|
||||
playerComponentsManager currentplayerComponentsManager = objectToAffect.GetComponent<playerComponentsManager> ();
|
||||
|
||||
if (currentplayerComponentsManager != null) {
|
||||
|
||||
remoteEventSystem currentRemoteEventSystem = currentplayerComponentsManager.getRemoteEventSystem ();
|
||||
|
||||
if (currentRemoteEventSystem != null) {
|
||||
currentRemoteEventSystem.callRemoteEvent (remoteEventName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88488d3d7a4d62543998201bd8c6e668
|
||||
timeCreated: 1614623613
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Scripts/Powers/New Projectiles Behaviors/removeGravityFromCharactersProjectile.cs
|
||||
uploadId: 814740
|
||||
Reference in New Issue
Block a user