void Awake() { player = GameObject.FindGameObjectWithTag("Player"); lunaCharacterController = GetComponent<LunaCharacterController>(); playerScript = GetComponent<PlayerScript>(); pStats = GetComponent<AbilityBar> (); fireballSpawn = GameObject.FindGameObjectWithTag("FireballSpawn"); }
private void CreateAbilityBar() { Vector2 screenResolution = new Vector2(Screen.width, Screen.height); abilityBar = Instantiate(abilityBarPrefab); abilityBar.transform.SetParent(FindObjectOfType <Canvas>().transform); abilityBar.transform.position += new Vector3(screenResolution.x, screenResolution.y, 0); abilityBar.setAbilityCooldown(1 - _cooldownValue / Cooldown); //abilityBar.transform.Find("Bullet").GetComponent<Image>().color = bulletBarColor; }
// Use this for initialization IEnumerator Start() { playerUnitPanels = new List <PlayerUnitPanel>(); canvas = GetComponentInChildren <Canvas>(); player = transform.root.GetComponent <Player>(); targetManager = player.GetComponentInChildren <TargetManager>(); formationManager = player.GetComponentInChildren <FormationManager>(); dialogManager = player.GetComponentInChildren <DialogManager>(); playerUnitBar = GetComponentInChildren <PlayerUnitBar>(); enemyUnitBar = GetComponentInChildren <EnemyUnitBar>(); selectionIndicator = GetComponentInChildren <SelectionIndicator>(); abilityBar = GetComponentInChildren <AbilityBar>(); // upperBar = GetComponentInChildren<UpperBar>(); generalIndicatorBar = GetComponentInChildren <GeneralIndicatorBar>(); enemyCountBar = GetComponentInChildren <EnemyCountBar>(); unitPanelWrapper = GetComponentInChildren <UnitPanelWrapper>(); animator = GetComponent <Animator>(); if (player && player.human) { while (!animator || !player || !targetManager || !formationManager) { yield return(new WaitForSeconds(0.1f)); } } ResourceManager.StoreSelectBoxItems(selectBoxSkin, healthy, damaged, critical); SetCursorState(CursorState.Select); buildAreaHeight = Screen.height - RESOURCE_BAR_HEIGHT - SELECTION_NAME_HEIGHT - 2 * BUTTON_SPACING; List <AudioClip> sounds = new List <AudioClip>(); List <float> volumes = new List <float>(); sounds.Add(clickSound); volumes.Add(clickVolume); audioElement = new AudioElement(sounds, volumes, "HUD", null); Cursor.lockState = CursorLockMode.Locked; cursorPosition = new Vector3(Screen.width / 2, Screen.height / 2); lastCursorPosition = new Vector3(Screen.width / 2, Screen.height / 2); }
// Start is called before the first frame update void Start() { characters = FindObjectsOfType <SelectableCharacter>(); foreach (SelectableCharacter character in characters) { character.onClicked.AddListener((eventData) => { OnCharacterWasClicked(character); }); character.onPointerEnter.AddListener((eventData) => { OnCharacterPointed(character); }); character.onPointerExit.AddListener((eventData) => { OnCharacterPointerExited(character); }); } if (abilityBar == null) { abilityBar = GetComponentInChildren <AbilityBar>(); } }
private void DrawAbilityBar(AbilityBar abilityBar, Unit unit) { if (!unit || !unit.GetAbilityAgent()) { return; } var abilitySlots = abilityBar.AbilitySlots; var selection = player.SelectedObject; // var selectedUnit = (Unit)selection; var abilities = unit.GetAbilityAgent().abilities; var multiAbilities = unit.GetAbilityAgent().abilitiesMulti; abilityBar.DrawAbilities( abilities, multiAbilities, targetManager.InMultiMode, targetManager.InMultiMode ? player.selectedAlliesTargettingAbility : player.selectedAllyTargettingAbility ); }
void Start() { instance = this; contentRectPos = contentRect.position; AddAbilityTest(); }
public void AddAbility(Research research) { AbilityBar.AddAbility(int.Parse(research.meta)); }
// Use this for initialization void Start() { inspector = GetComponentInChildren <UnitInspector>(); inspector.gameObject.SetActive(false); abilityBar = GetComponentInChildren <AbilityBar>(); }
private void Awake() { singleton = this; }
// Use this for initialization public void Start() { abilityBar = GetComponentInChildren <AbilityBar>(); unitIndicator = GetComponentInChildren <Indicator>(); }