public void UseItem(StatusItem item) { EnduranceBody body = GetComponent <EnduranceBody>(); if (item.Type == ItemAttribute.Repair) { body.AddHealth(item.strongth); } }
public static EnduranceBody Block(EnduranceBody prefab, Transform trans) { if (poolBlock == null) { poolBlock = FindGameObject(containerTag, nameBlock); } return(Instantiate( prefab, trans.position, trans.rotation, poolBlock.transform)); }
private void DoOnDestroy() { if (isDestroy) { return; } isDestroy = true; Vector2 scale = SpriteSize() / (4 * Mathf.Sqrt(2)); for (int i = 0; i < 4; i++) { EnduranceBody block = Builder.Block(prefabBody, transform); block.transform.position += Quaternion.Euler(0f, 0f, 90f * i) * scale; } if (prefabSmoke != null) { Builder.Effecter(prefabSmoke, transform); } }