コード例 #1
0
    /**
     * Start function
     */
    public void StartMe()
    {
        PlayerClass ownerClass; // The class of the player owner
        AlienClass alienClass; // Container for the alien class, if it is true

        cameraController = Camera.main.GetComponent<CameraController>();
        movementController = Player.MyPlayer.GetComponent<MovementController>();
        contextAwareBoxScript = ContextAwareBox.GetComponent<ContextAwareBox>();
        activationTileController = ContextAwareBox.GetComponent<ActivationTileController>();
        playerOwnerScript = Player.MyPlayer.GetComponent<Player>();
        ownerClass = playerOwnerScript.GetPlayerClassObject();
        ClassTitle.text = ownerClass.GetPlayerClassType();

        if (ownerClass.GetPrimaryAbility() == null)  // No ability
            PrimaryAbilityText.text = "No name";
        else { // Set button text and abilities
            if (ownerClass.GetClassTypeEnum() == Classes.BETRAYER) { // Alien. Need to account for alien ui
                alienClass = (AlienClass)ownerClass;
                setClassTitleForAlien(alienClass);
                AlienPrimaryAbilityButton.SetActive(true);
                PrimaryAbilityText.text = alienClass.GetHumanClass().GetPrimaryAbility().GetAbilityName();
                AlienPrimaryAbilityText.text = ownerClass.GetPrimaryAbility().GetAbilityName();

                alienClass.GetHumanClass().GetPrimaryAbility().SetClassPanel(ClassPanel);
                alienClass.GetHumanClass().GetPrimaryAbility().ExtraInitializing();
            } else // Ordinary human class. Just set the appropriate text
                PrimaryAbilityText.text = ownerClass.GetPrimaryAbility().GetAbilityName();

            ownerClass.GetPrimaryAbility().SetClassPanel(ClassPanel);
            ownerClass.GetPrimaryAbility().ExtraInitializing();
        }
        CurrentPlayer = Player.MyPlayer; // Current player variable for engineer class
        setPortraits(ownerClass);
    }
コード例 #2
0
 /**
  * Start function. Need to do the following:
  * - Initialize variables only if the game objects have been set
  * - Get the default icon which is "Background"
  */
 public void StartMe()
 {
     selected = false;
     if (UiSlot != null)
         uiSlotImage = UiSlot.GetComponent<Image>();
     if (ContextAwareBox != null)
         contextBoxScript = ContextAwareBox.GetComponent<ContextAwareBox>();
     if (Container != null)
         containerScript = Container.GetComponent<InventoryUIScript>();
 }
コード例 #3
0
 /**
  * Starting function
  */
 public void StartMe()
 {
     if (ContextAwareBox != null) {
         contextBoxScript = ContextAwareBox.GetComponent<ContextAwareBox>();
     }
 }