예제 #1
0
 public void OnSelectProjectile(EmplacementProjectileSelectButton fromButton)
 {
     SetProjectilePurchased(fromButton.obj.name);
     emplacement.ChangeProjectile(fromButton.obj);
     currentProjectileButton = fromButton;
     UpdateAll();
 }
예제 #2
0
    private void RefreshProjectileOptions()
    {
        projectileOptions = emplacement.GetProjectileOptions();

        foreach (GameObject obj in projectileOptions)
        {
            GameObject newButton = Instantiate(projectileButtonPrefab, projectileButtonParent);
            EmplacementProjectileSelectButton butt = newButton.GetComponent <EmplacementProjectileSelectButton> ();
            FeedButtonData(butt, obj);

            if (butt.obj == emplacement.GetProjectilePrefab())
            {
                currentProjectileButton = butt;
                SetProjectilePurchased(butt.obj.name);
            }
        }
    }