public void UpdateData(IHasCooldown cd)
        {
            if (ReferenceEquals(cd, null))
            {
                ClearCooldownData();

                return;
            }

            var newData = cdSystem.GetCooldown(cd.Id);

            var curDataNotNull = !ReferenceEquals(data, null);
            var sameData       = curDataNotNull && ReferenceEquals(data, newData);

            if (sameData)
            {
                return;
            }

            data?.RemoveListenAction(UpdateDisplay);

            id   = cd.Id;
            data = newData;

            data?.AddListenAction(UpdateDisplay);
        }
Esempio n. 2
0
        private void InitTimer()
        {
            castingTimeWait = new WaitForSeconds(timeToCast);

            cd = cooldownSys.GetCooldown(Id);
        }