Code de Ader et mon implémentation du art pour le Creeper et les creeplings. Aussi desert monster added. Co-authored-by: Ader Alisma 01 <adeder22@hotmail.com> Reviewed-on: #17 Reviewed-by: Ader_Alisma <ader.alisma.1@ens.etsmtl.ca> Co-authored-by: Craftelia <william-gin1@hotmail.com> Co-committed-by: Craftelia <william-gin1@hotmail.com>
23 lines
649 B
C#
23 lines
649 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Creeper : Opponent
|
|
{
|
|
[SerializeField]
|
|
private GameObject[] creeplings;
|
|
[SerializeField]
|
|
private float creeplingsSpawnRange = 2f;
|
|
|
|
public override void Death()
|
|
{
|
|
for (int i = 0; i < creeplings.Length; i++)
|
|
{
|
|
float randomX = Random.Range(0f, creeplingsSpawnRange) + transform.position.x;
|
|
Vector3 spawnPosition = new Vector3(randomX, transform.position.y, transform.position.z);
|
|
Instantiate(creeplings[i], spawnPosition, Quaternion.identity);
|
|
}
|
|
base.Death();
|
|
}
|
|
}
|