public override void Initialize <T>(T data, bool isWink) { effect = data as Resource.Effect; this.isWink = isWink; Debug.Log($"{effect.spritePath}"); GetComponent <Image>().sprite = Resources.Load <Sprite>(effect.spritePath); SetDescription(); }
void ApplyItemEffect(Character character, Resource.Effect effect, bool isAlreadySameEffectActive) { if (!isAlreadySameEffectActive) { // Debug.Log("Applying Effect" + effect.name); GameObject effectTimerGO = new GameObject(character.Name + ":" + effect.name); effectTimerGO.transform.SetParent(CharacterManager.Instance.gameObject.transform.Find("ItemEffectTimer")); effectTimerGO.AddComponent <ItemEffectTimer>().StartEffect(character, effect); } else { GameObject effectTimerGO = CharacterManager.Instance.gameObject.transform.Find("ItemEffectTimer/" + effect.instanceID).gameObject; effectTimerGO.GetComponent <ItemEffectTimer>().IncreaseDuration(effect.duration); // Debug.Log(effectTimerGO.name); } }
public void StartEffect(Character _character, Resource.Effect _effect) { character = _character; effect = _effect; }