Skip to content

Instantly share code, notes, and snippets.

@tubakihimeLoveHate
Created February 11, 2020 15:22
Show Gist options
  • Save tubakihimeLoveHate/99074be1c0823b06ddbf60aac06a6e7f to your computer and use it in GitHub Desktop.
Save tubakihimeLoveHate/99074be1c0823b06ddbf60aac06a6e7f to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FireController : MonoBehaviour
{
AnimatorStateInfo state;
Animator animator;
public GameObject fireEffect;
// Start is called before the first frame update
void Start()
{
animator= GetComponent<Animator>();
animator.SetBool("start",true);
}
// Update is called once per frame
void Update()
{
state = animator.GetCurrentAnimatorStateInfo(0);
if(state.normalizedTime > 1){
fireEffect.gameObject.SetActive(true);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment