Added animations, two state machines
This commit is contained in:
8
Assets/Scripts/Animation.meta
Normal file
8
Assets/Scripts/Animation.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 180b429b297df4e46b69598de96e21f4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
34
Assets/Scripts/Animation/BirdEyesBehavior.cs
Normal file
34
Assets/Scripts/Animation/BirdEyesBehavior.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using UnityEngine;
|
||||
using Pixelplacement;
|
||||
|
||||
public class BirdEyesBehavior : MonoBehaviour
|
||||
{
|
||||
private StateMachine statemachine;
|
||||
private Animator animator;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
statemachine = GetComponent<StateMachine>();
|
||||
animator = GetComponentInChildren<Animator>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CorrectItem()
|
||||
{
|
||||
animator.SetTrigger("RightGuess");
|
||||
}
|
||||
|
||||
void IncorrectItem()
|
||||
{
|
||||
animator.SetTrigger("WrongGuess");
|
||||
}
|
||||
void BirdReveal()
|
||||
{
|
||||
statemachine.ChangeState ("BirdSpawned");
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Animation/BirdEyesBehavior.cs.meta
Normal file
2
Assets/Scripts/Animation/BirdEyesBehavior.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 13d59d3c42170824b8f92557822d9bf0
|
||||
26
Assets/Scripts/Animation/GardenerChaseBehavior.cs
Normal file
26
Assets/Scripts/Animation/GardenerChaseBehavior.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using UnityEngine;
|
||||
using Pixelplacement;
|
||||
|
||||
public class GardenerChaseBehavior : MonoBehaviour
|
||||
{
|
||||
public Spline ChaseSpline;
|
||||
public Transform GardenerObject;
|
||||
public float chaseDuration;
|
||||
public float chaseDelay;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
Tween.Spline (ChaseSpline, GardenerObject, 0, 1, false, chaseDuration, chaseDelay, Tween.EaseInOut, Tween.LoopType.PingPong);
|
||||
}
|
||||
|
||||
void Awake()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Animation/GardenerChaseBehavior.cs.meta
Normal file
2
Assets/Scripts/Animation/GardenerChaseBehavior.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: abefccb95d18f534f81d5158b8fc721f
|
||||
Reference in New Issue
Block a user