mirror of
https://github.com/imperialsushi/gutterball-3.git
synced 2025-06-15 05:07:42 +00:00
New Version 1.6
New 125 balls & powerups. Improved graphics.
This commit is contained in:
parent
b35433ae45
commit
71779ef7ac
9413 changed files with 193360 additions and 264803 deletions
|
@ -0,0 +1,45 @@
|
|||
using UnityEngine;
|
||||
|
||||
[ExecuteInEditMode]
|
||||
public class WaterTile : MonoBehaviour
|
||||
{
|
||||
public PlanarReflection reflection;
|
||||
public WaterBase waterBase;
|
||||
|
||||
public void Start ()
|
||||
{
|
||||
AcquireComponents();
|
||||
}
|
||||
|
||||
private void AcquireComponents()
|
||||
{
|
||||
if (!reflection) {
|
||||
if (transform.parent)
|
||||
reflection = (PlanarReflection)transform.parent.GetComponent<PlanarReflection>();
|
||||
else
|
||||
reflection = (PlanarReflection)transform.GetComponent<PlanarReflection>();
|
||||
}
|
||||
|
||||
if (!waterBase) {
|
||||
if (transform.parent)
|
||||
waterBase = (WaterBase)transform.parent.GetComponent<WaterBase>();
|
||||
else
|
||||
waterBase = (WaterBase)transform.GetComponent<WaterBase>();
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public void Update ()
|
||||
{
|
||||
AcquireComponents();
|
||||
}
|
||||
#endif
|
||||
|
||||
public void OnWillRenderObject()
|
||||
{
|
||||
if (reflection)
|
||||
reflection.WaterTileBeingRendered(transform, Camera.current);
|
||||
if (waterBase)
|
||||
waterBase.WaterTileBeingRendered(transform, Camera.current);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue