mirror of
https://github.com/Steffo99/bleach-beach.git
synced 2024-12-04 19:04:19 +00:00
Add Venice in Project
Added the Tide control script
This commit is contained in:
parent
705a48f187
commit
7ab2a3e247
2 changed files with 31 additions and 0 deletions
20
Assets/Scripts/Marea.cs
Normal file
20
Assets/Scripts/Marea.cs
Normal file
|
@ -0,0 +1,20 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Marea : MonoBehaviour {
|
||||
public BuoyancyEffector2D buoyancyEffector2D;
|
||||
float speed = 0.01f;
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
buoyancyEffector2D = GetComponent<BuoyancyEffector2D>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update () {
|
||||
if(buoyancyEffector2D.surfaceLevel>0)
|
||||
{
|
||||
buoyancyEffector2D.surfaceLevel = buoyancyEffector2D.surfaceLevel - (Time.deltaTime * speed);
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Marea.cs.meta
generated
Normal file
11
Assets/Scripts/Marea.cs.meta
generated
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ac623f28625c20343b43dd71dd93266a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in a new issue