_xiaofang/xiaofang/Assets/Script/Item/NoFire.cs
2024-12-27 17:43:27 +08:00

40 lines
690 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NoFire : MonoBehaviour
{
//ÅçÉäµã
private GameObject MuzzlePos;
public bool isuse = false;
// Start is called before the first frame update
void Start()
{
Init();
}
// Update is called once per frame
void Update()
{
}
void Init()
{
MuzzlePos = transform.Find("Muzzle").gameObject;
MuzzlePos.SetActive(false);
}
public void StartFire()
{
MuzzlePos.SetActive(true);
isuse=true;
}
public void StopFire()
{
MuzzlePos.SetActive(false);
isuse=false;
}
}