Zweite Beta der Animation, jetzt mit Wechsel der Animationen bei Bewegung TODO: Pixel Perfect RigidBodys -> Frank soll ja nicht auf dem flacheren Teil des Steins schweben. Ausserdem Friction Einstellungen per Object ausfindig machen
This commit is contained in:
27
Assets/AssetsFORELLE/Script/IsMovingTester.cs
Normal file
27
Assets/AssetsFORELLE/Script/IsMovingTester.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class IsMovingTester : MonoBehaviour
|
||||
{
|
||||
private Animator animator;
|
||||
private Rigidbody2D rb;
|
||||
|
||||
void Start()
|
||||
{
|
||||
animator = GetComponent<Animator>();
|
||||
rb = GetComponent<Rigidbody2D>();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (rb.velocity.magnitude > 0.1f)
|
||||
{
|
||||
animator.SetBool("IsMoving", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
animator.SetBool("IsMoving", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/AssetsFORELLE/Script/IsMovingTester.cs.meta
generated
Normal file
11
Assets/AssetsFORELLE/Script/IsMovingTester.cs.meta
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4760965f3d035f84db6a6741d746428c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user