Advertisement
Guest User

Untitled

a guest
Apr 10th, 2020
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.09 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5.  
  6. public class DaileyButton : MonoBehaviour
  7. {
  8.  
  9.     [SerializeField] public int DaileyButtons;
  10.     [SerializeField] private DaileyManagment DaileyManagment;
  11.  
  12.     private bool prizeGeholt;
  13.  
  14.  
  15.     [SerializeField] private Sprite hakenImage;
  16.     [SerializeField] private Sprite kreuzImage;
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.     // Start is called before the first frame update
  25.     void Start()
  26.     {
  27.        
  28.     }
  29.  
  30.     // Update is called once per frame
  31.     public void Update()
  32.     {
  33.         if (DaileyManagment.day == DaileyButtons)
  34.         {
  35.             GetComponent<Button>().interactable = true;
  36.         }
  37.         else
  38.         {
  39.             GetComponent<Button>().interactable = false;
  40.            
  41.         }
  42.  
  43.  
  44.  
  45.  
  46.        
  47.        
  48.     }
  49.     public void Verloren()
  50.     {
  51.         if (prizeGeholt)
  52.         {
  53.  
  54.             GetComponent<Image>().sprite = kreuzImage;
  55.         }
  56.         else
  57.         {
  58.             GetComponent<Image>().sprite = hakenImage;
  59.         }
  60.     }
  61.  
  62.  
  63.  
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement