public void StartMe() { SetPublicVariables(); movController = GetComponentInParent<MovementController>(); actController = ContextAwareBox.GetComponent<ActivationTileController>(); ResetOffset(); initialRotation = transform.rotation; }
/** * 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); }
/** * Start function. Needs the following: * - Initialize current context to be idle * - Initialize any other private variables * - Create onclick listeners for buttons */ public void StartMe() { Player playerScript = Player.MyPlayer.GetComponent<Player>(); // The player's script SetContextToIdle(); InventoryContextPanel[2].GetComponent<Button>().onClick.AddListener( () => ActivateAttachedItem(Player.MyPlayer)); InventoryContextPanel[3].GetComponent<Button>().onClick.AddListener( () => playerScript.RemoveItem(gameObject)); activationTileScript = GetComponent<ActivationTileController>(); activationTileScript.StartMe(); }