void CooldownKeyboard(AbilityTypes type, float timeMiliseconds) { AbilityKeyboardWrapper targetKeyboard = InputManager.Instance.KeyboardInput.GetAbilityKeyboard(type); if (targetKeyboard != null) { UICooldownController keyboardCooldownController = Utils.Pool.PoolManager.GetObject(GameManager.Instance.PrefabLibrary.UIKeyboardCooldownPrefab) as UICooldownController; RectTransform keyboardRectTransform = targetKeyboard.GetComponent <RectTransform>(); RectTransform cooldownControllerRectTransform = keyboardCooldownController.GetComponent <RectTransform>(); cooldownControllerRectTransform.SetParent(keyboardRectTransform.parent); cooldownControllerRectTransform.anchorMin = keyboardRectTransform.anchorMin; cooldownControllerRectTransform.anchorMax = keyboardRectTransform.anchorMax; cooldownControllerRectTransform.offsetMin = keyboardRectTransform.offsetMin; cooldownControllerRectTransform.offsetMax = keyboardRectTransform.offsetMax; keyboardCooldownController.Cooldown(timeMiliseconds); } }
void CooldownJoystick(AbilityTypes type, float timeMiliseconds) { AbilityVirtualButtonWrapper targetJoystick = InputManager.Instance.VirtualJoystickInput.GetAbilityJoystick(type); if (targetJoystick != null) { UICooldownController joystickCooldownController = Utils.Pool.PoolManager.GetObject(GameManager.Instance.PrefabLibrary.UIJoystickCooldownPrefab) as UICooldownController; RectTransform joystickRectTransform = targetJoystick.GetComponent <RectTransform>(); RectTransform cooldownControllerRectTransform = joystickCooldownController.GetComponent <RectTransform>(); cooldownControllerRectTransform.SetParent(joystickRectTransform.parent, false); cooldownControllerRectTransform.anchorMin = joystickRectTransform.anchorMin; cooldownControllerRectTransform.anchorMax = joystickRectTransform.anchorMax; cooldownControllerRectTransform.offsetMin = joystickRectTransform.offsetMin; cooldownControllerRectTransform.offsetMax = joystickRectTransform.offsetMax; cooldownControllerRectTransform.anchoredPosition = joystickRectTransform.anchoredPosition; joystickCooldownController.Cooldown(timeMiliseconds); } }