Beispiel #1
0
 public void Initialize(Abillity selectedAbillity, GameObject weaponHolder)
 {
     abillity      = selectedAbillity;
     myButtonImage = GetComponent <Image>();
     //abillitySource = GetComponent<AudioSource>();
     myButtonImage.sprite = abillity.aSprite;
     // coolDownDuration = abillity.shootRateBall; // check cooldownduratioon is important but what about shootrateBall??
     abillity.Initialize(weaponHolder);
     AbillityReady();
 }
Beispiel #2
0
 void Start()
 {
     player      = GameObject.Find("Main Camera").GetComponent <Player>();
     abillity    = GameObject.Find("Main Camera").GetComponent <Abillity>();
     money       = GameObject.Find("Money").GetComponent <Text>();
     wave        = GameObject.Find("WaveSpawner").GetComponent <WaveSpawner>();
     currentWave = GameObject.Find("currentWaveText").GetComponent <Text>();
     mainBase    = GameObject.Find("Base").GetComponent <Base>();
     if (player.getClassName() == "General")
     {
         useAbilltiyButton.GetComponent <Image>().sprite = Resources.Load <Sprite>("UI/b5");
     }
     else if (player.getClassName() == "Scientist")
     {
         useAbilltiyButton.GetComponent <Image>().sprite = Resources.Load <Sprite>("UI/b4");
     }
     else if (player.getClassName() == "Engineer")
     {
         useAbilltiyButton.GetComponent <Image>().sprite = Resources.Load <Sprite>("UI/b6");
     }
     endScreen.SetActive(false);
     gameResult.SetActive(false);
     finalScore.SetActive(false);
 }