Fixed: unable to undock with an aetheric drive (game requires locomotion) Entities have a chance of dropping any item on board when killed Mine behavior generalized to grid objects, used in dropped loot Added tractor beam (not itemized yet) which pulls in nearby loot (and mines!) Items are added to player inventory when they collide with the ship (and mines explode!) Added console command to spawn turret
41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using Random = UnityEngine.Random;
|
|
|
|
public class ShieldAnimation : MonoBehaviour
|
|
{
|
|
public AnimationCurve Alpha;
|
|
public AnimationCurve Radius;
|
|
public AnimationCurve AlbedoGamma;
|
|
public AnimationCurve TextureGamma;
|
|
public AnimationCurve GradientMultiplier;
|
|
public float Duration;
|
|
|
|
private float _lerp;
|
|
private Material _material;
|
|
|
|
public Vector3 Direction
|
|
{
|
|
set { _material.SetVector("_Impact", value); }
|
|
}
|
|
|
|
void OnEnable()
|
|
{
|
|
_material = GetComponent<MeshRenderer>().material;
|
|
_material.SetFloat("_DitherSampleOffset", Random.value);
|
|
_lerp = 0;
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
_lerp += Time.deltaTime / Duration;
|
|
if(_lerp > 1) GetComponent<Prototype>().ReturnToPool();
|
|
_material.SetFloat("_Alpha", Alpha.Evaluate(_lerp));
|
|
_material.SetFloat("_Radius", Radius.Evaluate(_lerp));
|
|
_material.SetFloat("_AlbedoGamma", AlbedoGamma.Evaluate(_lerp));
|
|
_material.SetFloat("_TextureGamma", TextureGamma.Evaluate(_lerp));
|
|
_material.SetFloat("_GradientMul", GradientMultiplier.Evaluate(_lerp));
|
|
}
|
|
}
|