Super Knight : Enter the Dungeon
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class EffectGain : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public Transform particle;
|
|
|
|
|
public DropItem dropItem;
|
|
|
|
|
|
|
|
|
|
public void OnGain(Character owner, DropItem drop, Transform target, System.Action OnEnd)
|
|
|
|
|
{
|
|
|
|
|
dropItem.item = drop.item;
|
|
|
|
|
dropItem.OnInitialized();
|
|
|
|
|
|
|
|
|
|
owner.OnGain(drop.gameObject, () =>
|
|
|
|
|
{
|
|
|
|
|
OnEnd();
|
|
|
|
|
|
|
|
|
|
if (particle != null)
|
|
|
|
|
{
|
|
|
|
|
Transform particleParent = particle.parent;
|
|
|
|
|
particle.SetParent(target);
|
|
|
|
|
particle.localPosition = Vector3.zero;
|
|
|
|
|
particle.localEulerAngles = Vector3.zero;
|
|
|
|
|
particle.SetParent(particleParent);
|
|
|
|
|
particle.gameObject.SetActive(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dropItem.gameObject.SetActive(true);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|