Advertisement
uurha

Untitled

Oct 5th, 2022
1,056
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.AI;
  5. using UnityEngine.UI;
  6.  
  7. public class WarController : MonoBehaviour
  8. {
  9.     public bool attack;
  10.     public Button bAttack;
  11.  
  12.     public void Start()
  13.     {
  14.         attack = false;
  15.         bAttack.onClick.AddListener(Attack);
  16.     }
  17.  
  18.     public void Update()
  19.     {
  20.  
  21.         if (attack)
  22.         {
  23.             attack = false;
  24.           //
  25.         }
  26.        
  27.     }
  28.     public void Attack()
  29.     {
  30.         attack = !attack        
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement