Firstborn/Assets/Kevin Iglesias/Villager Animations Pack/Example Scene/Scripts/CookingSMB.cs
Schaken-Mods 959e80cf72 assets upload
assets upload description.
2023-03-28 12:16:30 -05:00

58 lines
1.4 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace KevinIglesias {
public class CookingSMB : StateMachineBehaviour {
public float timePoint;
public bool salt;
public bool dropSalt;
public bool tube;
public bool dropTube;
CookingScript cookingComponent;
bool changeDone;
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
if(cookingComponent == null)
{
cookingComponent = animator.GetComponent<CookingScript>();
}
changeDone = false;
if(cookingComponent == null)
{
changeDone = true;
}
}
override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
if(!changeDone)
{
if(stateInfo.normalizedTime >= timePoint)
{
if(salt)
{
cookingComponent.GetSalt(dropSalt);
}else{
cookingComponent.GetTube(dropTube);
}
changeDone = true;
}
}
}
}
}