#Trap
This commit is contained in:
AliIbnAbiTalib
2023-04-06 22:49:27 +02:00
parent 8c81a72bb8
commit 6954dc5c88
7 changed files with 83 additions and 45 deletions
+9
View File
@@ -0,0 +1,9 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Trap : MonoBehaviour
{
public Player target;
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e9469e33d7a7b9241a723b431a7e98e5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -363,6 +363,8 @@ public class PlayablePlayer : Player
{
currentField.placedItem = items[index];
GameObject temp = Instantiate(items[index].gameObject);
Trap t = temp.GetComponent<Trap>();
t.target = this;
temp.transform.position = currentField.transform.position + (Vector3.up / 2);
activeItem = Item.Type.None;
}
@@ -110,6 +110,8 @@ public abstract class Player : MonoBehaviour
{
currentField.placedItem = items[index];
GameObject temp = Instantiate(items[index].gameObject);
Trap t = temp.GetComponent<Trap>();
t.target = this;
temp.transform.position = currentField.transform.position + (Vector3.up / 2);
activeItem = Item.Type.None;
}