Untitled
unknown
plain_text
4 years ago
566 B
4
Indexable
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Energia : MonoBehaviour { public int energia; // Start is called before the first frame update void Start() { energia = 0; } // Update is called once per frame void Update() { if (energia < 1000) energia++; if ( Input.GetKeyDown("space")) { if (energia >= 200) { Debug.Log("super attack"); energia = energia - 200; } } } }
Editor is loading...