
1.设置转身事件 (1.当触发转身,翻转角色Scale 2.实现发射镰刀功能 (1.发射有CD,CD之内无法再次发射 (2.若未击中怪物,镰刀飞出屏幕后销毁 (3.镰刀飞行方向由玩家发射时面部朝向决定 ❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤❤
54 lines
1.3 KiB
C#
54 lines
1.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using Sirenix.OdinInspector;
|
|
|
|
// ...............................
|
|
// .......................@@`.....
|
|
// ........................@@@....
|
|
// ........................,@@@`..
|
|
// .........................=@@@..
|
|
// ..........................@@@\.
|
|
// ..........................=@@@.
|
|
// ...........................@@@^
|
|
// ...........................@@@^
|
|
// ............,@@\..........=@@@.
|
|
// ........,@@@@@@@\.........@@@/.
|
|
// ......]@@@@`.\@@@@\...../@@@@..
|
|
// ...,O@@@/.....,@@@@@@@@@@@@/...
|
|
// ..@@@@/.........,@@@@@@@@/.....
|
|
// ..\@/................[.........
|
|
// ...............................
|
|
|
|
public class Sickle : MonoBehaviour
|
|
{
|
|
[ReadOnly][BoxGroup("信息")]
|
|
public int dir;
|
|
[BoxGroup("信息")]
|
|
public float speed = 10f;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
Move();
|
|
}
|
|
|
|
void Move()
|
|
{
|
|
transform.position = transform.position +=
|
|
new Vector3(//x
|
|
speed * Time.deltaTime * dir,
|
|
//y//z
|
|
0,0);
|
|
|
|
}
|
|
|
|
|
|
}
|