Created
February 11, 2020 15:22
-
-
Save tubakihimeLoveHate/99074be1c0823b06ddbf60aac06a6e7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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