// Use this for initialization void Start() { DontDestroyOnLoad(transform.gameObject); controllerThing = GameObject.Find("Controller Thing"); controller = controllerThing.GetComponent <ControllerThing>(); abilities = controllerThing.GetComponent <PlayerAbilityController>(); cooldowns = controllerThing.GetComponent <PlayerCDController>(); health = GetComponent <Health>(); anim = GetComponent <Animator>(); h2 = health.health; }
void OnTriggerStay(Collider col) { PlayerAbilityController abilityController = col.GetComponent <PlayerAbilityController>(); if (abilityController == null) { return; } abilityController.EnableAbility(abilityType); StartCoroutine(Cooldown()); }
public void OnConnect(PlayerAbilityController ownAbilities) { _uiIcons = FindObjectsOfType <AbilitySlot>(); HotKeys = _uiIcons.Select(icon => icon.Key).ToArray(); for (int i = 0; i < _uiIcons.Length; i++) { AbilitySlot slot = _uiIcons[i]; if (ownAbilities.AvailableAbilities.Length > i) { CombatAbility ability = ownAbilities.AvailableAbilities[i]; _equippedAbilities.Add(slot.Key, ability); ability.AbilityCast += _uiIcons[i].ResetLoadingProgress; slot.SetIcon(ability.Icon); slot.SetCooldown(ability.Cooldown); } } }
// Use this for initialization void Start() { DontDestroyOnLoad(transform.gameObject); healVisual = GameObject.CreatePrimitive(PrimitiveType.Cylinder); healVisual.SetActive(false); DontDestroyOnLoad(healVisual); healVisual.GetComponent <Renderer>().material.color = Color.green; controllerThing = GameObject.Find("Controller Thing"); controller = controllerThing.GetComponent <ControllerThing>(); abilities = controllerThing.GetComponent <PlayerAbilityController>(); cooldowns = controllerThing.GetComponent <PlayerCDController>(); health = GetComponent <Health>(); anim = GetComponent <Animator>(); h2 = health.health; }
public void TransformParticle() { if (this.isTransforming) { return; } PlayerAbilityController abilityController = GameStateManager.Instance.game.player.playerAbility; // Transform the particle, and extract the image information to the particleImageContainer PlayerAbilityBase info = GameStateManager.Instance.game.player.playerAbility.TransformParticle(true); GameObject particleImage = Instantiate(info.canvasVisualsPrefab, this.particleImageContainer.transform); particleImage.transform.SetParent(this.particleImageContainer.transform); this.curTransformObject = particleImage; this.commonNameText.text = info.commonName; this.formulaText.text = info.chemicalName; this.descriptionText.text = info.description; GameStateManager.Instance.game.backgroundHandler.ChangeColor(true); // Animation effect StartCoroutine(this.transformCor()); }