Files
FueraDeEscala/Assets/Game Kit Controller/Scripts/Weapons/projectileImpactSystem.cs
Robii Aragon fd87a6ffd5 add ckg
plantilla base para movimiento básico
2026-02-05 05:07:55 -08:00

49 lines
1.3 KiB
C#

using System.Collections;
using System.Collections.Generic;
using GameKitController.Audio;
using UnityEngine;
public class projectileImpactSystem : MonoBehaviour
{
public AudioSource mainAudioSource;
public destroyGameObject mainDestroyGameObject;
public void activateImpactElements (Vector3 newPosition, AudioElement impactSoundEffect)
{
// print ("----Activate impact elements " + gameObject.activeSelf + " " + mainDestroyGameObject.destroyCoroutineActive);
transform.position = newPosition;
if (mainAudioSource != null) {
impactSoundEffect.audioSource = mainAudioSource;
}
// print (impactSoundEffect.length);
if (impactSoundEffect.clip != null) {
mainDestroyGameObject.setTimer (impactSoundEffect.clip.length + 0.2f);
}
if (gameObject.activeSelf) {
mainDestroyGameObject.checkToDestroyObjectInTime (false);
} else {
gameObject.SetActive (true);
}
GKC_Utils.checkAudioSourcePitch (mainAudioSource);
AudioPlayer.Play (impactSoundEffect, gameObject);
decalManager.setImpactSoundParent (transform);
}
public void changeDestroyForSetActiveFunction (bool state)
{
mainDestroyGameObject.changeDestroyForSetActiveFunction (state);
}
public void setSendObjectToPoolSystemToDisableState (bool state)
{
mainDestroyGameObject.setSendObjectToPoolSystemToDisableState (state);
}
}