Init
This commit is contained in:
30
Assets/Scripts/HotUpdate/Main/Player/AttackController.cs
Normal file
30
Assets/Scripts/HotUpdate/Main/Player/AttackController.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class AttackController : MonoBehaviour
|
||||
{
|
||||
public GameObject Bullet;
|
||||
public GameObject Root;
|
||||
public float CD;
|
||||
public float Timer;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
public void DoAttack()
|
||||
{
|
||||
GameObject go = Instantiate(Bullet);
|
||||
go.transform.position = Root.transform.position;
|
||||
go.transform.localScale = new Vector3(0.002f, 0.002f, 0.002f);
|
||||
go.transform.rotation = Root.transform.rotation;
|
||||
Timer = Time.time;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user