Untitled
Anonymous
plain_text
11/15/2021 5:49 PM
756 B
16
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...