plantilla base para movimiento básico
This commit is contained in:
Robii Aragon
2026-02-05 05:07:55 -08:00
parent 195b696771
commit 779f2c8b20
14443 changed files with 23840465 additions and 452 deletions

View File

@@ -0,0 +1,67 @@
using System.Collections;
using System.Collections.Generic;
using GameKitController.Audio;
using UnityEngine;
public class laserMine : projectileSystem
{
[Header ("Main Settings")]
[Space]
public GameObject laserBeam;
public bool disableByTime;
public float timeToDisable;
public bool infiniteEnergy;
public int numberOfContactsToDisable;
int currentNumberOfContacts;
public void increaseNumberOfContacts ()
{
if (!infiniteEnergy) {
currentNumberOfContacts++;
if (currentNumberOfContacts >= numberOfContactsToDisable) {
disableBullet (0);
projectilePaused = false;
}
}
}
public void checkObjectDetected (Collider col)
{
if (canActivateEffect (col)) {
if (currentProjectileInfo.impactAudioElement != null) {
currentProjectileInfo.impactAudioElement.audioSource = GetComponent<AudioSource> ();
AudioPlayer.PlayOneShot (currentProjectileInfo.impactAudioElement, gameObject);
}
setProjectileUsedState (true);
//set the bullet kinematic
objectToDamage = col.GetComponent<Collider> ().gameObject;
Vector3 previousVelocity = mainRigidbody.linearVelocity;
//print (objectToDamage.name);
mainRigidbody.isKinematic = true;
if (currentProjectileInfo.adhereToSurface) {
attachProjectileToSurface ();
}
if (disableByTime) {
disableBullet (timeToDisable);
} else {
projectilePaused = true;
}
}
}
public override void resetProjectile ()
{
base.resetProjectile ();
currentNumberOfContacts = 0;
}
}