This commit is contained in:
Gerard Gascón 2025-04-24 17:19:36 +02:00
commit 001bb14f16
951 changed files with 270074 additions and 0 deletions

View file

@ -0,0 +1,37 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Humo : MonoBehaviour, IPooledObject{
int transparencia;
float currentTrans;
float scale;
public float speed;
public float fadeSpeed;
public float scaleSpeed;
HumoLookAt lookat;
RawImage image;
// Start is called before the first frame update
public void OnObjectSpawn(){
lookat = GetComponentInParent<HumoLookAt>();
image = GetComponent<RawImage>();
transparencia = Random.Range(25, 75);
currentTrans = transparencia;
scale = Random.Range(1f, 2.5f);
transform.localScale = new Vector3(scale, scale, scale);
image.color = new Color(image.color.r, image.color.g, image.color.b, currentTrans / 255);
transform.rotation = lookat.t;
}
// Update is called once per frame
void Update(){
transform.Translate(Vector2.up * speed * Time.deltaTime);
currentTrans = currentTrans - fadeSpeed;
image.color = new Color(image.color.r, image.color.g, image.color.b, currentTrans / 255);
image.transform.localScale = new Vector3(scale - scaleSpeed * Time.deltaTime, scale - scaleSpeed * Time.deltaTime, scale - scaleSpeed * Time.deltaTime);
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8a8bd9c4625299f49b9ed371a00c56a0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,8 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HumoLookAt : MonoBehaviour{
public Quaternion t;
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 16d7bcebca6755b4e919596bec218166
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: