- Home /
Cooldown Spells and Icons
Hello, Im new to unity3d. I want to make a rpg game but i dont know how to make the skill icon and the cooldown. Please help me :( my script:
using UnityEngine; using System.Collections;
public class SpecialAttack : MonoBehaviour { public Fighter player; public KeyCode key; public double damagePercentage; public int stunTime; public bool inAction; public GameObject partcileEffect; public int projectile; public bool opponentBased;
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
if(Input.GetKeyDown(key) && !player.specialAttack)
{
player.resetAttackFunction();
player.specialAttack = true;
inAction = true;
}
if(inAction)
{
if(player.attackFunction(stunTime, damagePercentage, key, partcileEffect, projectile, opponentBased))
{
}
else
{
inAction = false;
}
}
}
}
if its not clear then you can go to this : http://pastebin.com/3R2NzrkC
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612084603im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How do i get an ad cooldowner? 0 Answers
Can you hide a custom icon for a script in the scene view? 0 Answers
Cooldowns with Time.time 2 Answers