2024-10-21 10:08:49 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* ʹ<EFBFBD>ü<EFBFBD><EFBFBD>ܣ<EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽű<EFBFBD>
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class UseSkill : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
//private CharacterAin CharacterAin;
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>е<EFBFBD><D0B5><EFBFBD>Ʒ
|
|
|
|
|
public GameObject currentItem = null;
|
|
|
|
|
|
|
|
|
|
private Skill_Pick skill_Pick;
|
|
|
|
|
private Skill_Jump skill_Jump;
|
|
|
|
|
private Skill_watering skill_Watering;
|
2024-11-18 17:19:35 +08:00
|
|
|
|
//Fire fire = new Fire();
|
2024-10-21 10:08:49 +08:00
|
|
|
|
|
|
|
|
|
// Start is called before the first frame update
|
|
|
|
|
void Start()
|
|
|
|
|
{
|
|
|
|
|
skill_Pick = transform.GetComponent<Skill_Pick>();
|
|
|
|
|
skill_Jump = transform.GetComponent<Skill_Jump>();
|
|
|
|
|
skill_Watering = transform.GetComponent<Skill_watering>();
|
2024-10-23 20:48:23 +08:00
|
|
|
|
|
2024-10-21 10:08:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
|
void Update()
|
|
|
|
|
{
|
|
|
|
|
Skill_Watering();
|
|
|
|
|
Skill_Pick();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//ʰȡ
|
|
|
|
|
void Skill_Pick()
|
|
|
|
|
{
|
|
|
|
|
if (Input.GetKeyDown(KeyCode.F))
|
|
|
|
|
{
|
2024-11-07 19:13:50 +08:00
|
|
|
|
Debug.LogError("F");
|
2024-10-21 10:08:49 +08:00
|
|
|
|
currentItem = skill_Pick.Pick();
|
|
|
|
|
}
|
|
|
|
|
if (Input.GetKeyDown(KeyCode.Q))
|
|
|
|
|
{
|
2024-11-07 19:13:50 +08:00
|
|
|
|
currentItem = skill_Pick.Drop(currentItem);
|
2024-10-21 10:08:49 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F><>Խ<EFBFBD><D4BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
void Jump()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//<2F><>ˮ
|
|
|
|
|
void Skill_Watering()
|
|
|
|
|
{
|
|
|
|
|
if (currentItem == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (Input.GetMouseButtonDown(0))
|
|
|
|
|
{
|
2024-11-18 17:19:35 +08:00
|
|
|
|
|
2024-10-21 10:08:49 +08:00
|
|
|
|
skill_Watering.StartWatering(currentItem);
|
2024-11-18 17:19:35 +08:00
|
|
|
|
|
|
|
|
|
|
2024-10-21 10:08:49 +08:00
|
|
|
|
}
|
|
|
|
|
if (Input.GetMouseButtonUp(0))
|
|
|
|
|
{
|
|
|
|
|
skill_Watering.StopWatering(currentItem);
|
|
|
|
|
}
|
2024-10-23 20:48:23 +08:00
|
|
|
|
}
|
2024-10-21 10:08:49 +08:00
|
|
|
|
|
2024-10-23 20:48:23 +08:00
|
|
|
|
|
2024-10-21 10:08:49 +08:00
|
|
|
|
}
|