77 lines
1.4 KiB
C#
77 lines
1.4 KiB
C#
|
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;
|
|||
|
|
|||
|
|
|||
|
|
|||
|
// 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>();
|
|||
|
}
|
|||
|
|
|||
|
// Update is called once per frame
|
|||
|
void Update()
|
|||
|
{
|
|||
|
Skill_Watering();
|
|||
|
Skill_Pick();
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
//ʰȡ
|
|||
|
void Skill_Pick()
|
|||
|
{
|
|||
|
if (Input.GetKeyDown(KeyCode.F))
|
|||
|
{
|
|||
|
currentItem = skill_Pick.Pick();
|
|||
|
}
|
|||
|
if (Input.GetKeyDown(KeyCode.Q))
|
|||
|
{
|
|||
|
skill_Pick.Drop(currentItem);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//<2F><>Խ<EFBFBD><D4BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
void Jump()
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
//<2F><>ˮ
|
|||
|
void Skill_Watering()
|
|||
|
{
|
|||
|
if (currentItem == null)
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
if (Input.GetMouseButtonDown(0))
|
|||
|
{
|
|||
|
skill_Watering.StartWatering(currentItem);
|
|||
|
}
|
|||
|
if (Input.GetMouseButtonUp(0))
|
|||
|
{
|
|||
|
skill_Watering.StopWatering(currentItem);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
}
|