mirror of
https://github.com/frizbee19/FebGameJam.git
synced 2026-10-11 18:19:11 +00:00
elevator yay
This commit is contained in:
1 parent
3af1373c33
commit
6a3b521cb7
5 files changed
+1517
-364
No files matched your search
@@ -0,0 +1,13 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class PlatformTrigger : Trigger
|
||||
{
|
||||
public GameObject platform;
|
||||
public override void Action()
|
||||
{
|
||||
platform.GetComponent<Platform>().isMoving = true;
|
||||
platform.GetComponent<Platform>().Activate();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 705c1491fdb252841a61a0ff750d556d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -13,10 +13,15 @@ public class Platform : MonoBehaviour
|
||||
{
|
||||
if(isMoving)
|
||||
{
|
||||
startPos = transform.position;
|
||||
StartCoroutine(LerpPosition(positionToMoveTo, length));
|
||||
Activate();
|
||||
}
|
||||
}
|
||||
|
||||
public void Activate() {
|
||||
startPos = transform.position;
|
||||
StartCoroutine(LerpPosition(positionToMoveTo, length));
|
||||
|
||||
}
|
||||
IEnumerator LerpPosition(Vector3 targetPosition, float duration)
|
||||
{
|
||||
float time = 0;
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user