Bomb bonus created

This commit is contained in:
mamontow 2021-09-02 10:29:57 +03:00
parent be9e4bb16b
commit e1dde52d70
20 changed files with 696 additions and 290 deletions

View File

@ -9640,7 +9640,7 @@ ParticleSystem:
serializedVersion: 7
lengthInSec: 2
simulationSpeed: 1
stopAction: 0
stopAction: 2
cullingMode: 3
ringBufferMode: 0
ringBufferLoopRange: {x: 0, y: 1}

View File

@ -0,0 +1,166 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &8305872390849316384
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8305872390849316396}
- component: {fileID: 8305872390849316397}
- component: {fileID: 8305872390849316386}
- component: {fileID: 8305872390849316387}
m_Layer: 0
m_Name: BombPref
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8305872390849316396
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8305872390849316384}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 3330558348385784510}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &8305872390849316397
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8305872390849316384}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 090bbb9ba9296734786191db30f18c2d, type: 3}
m_Name:
m_EditorClassIdentifier:
owner: 1
damage: 100
collisionVFX: {fileID: 2214609422064327837, guid: 234698f23c9068940b633be5a4f146ea,
type: 3}
--- !u!135 &8305872390849316386
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8305872390849316384}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.6
m_Center: {x: 0, y: 0.67, z: 0}
--- !u!54 &8305872390849316387
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8305872390849316384}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 0
m_IsKinematic: 1
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!1001 &8305872391170760256
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 8305872390849316396}
m_Modifications:
- target: {fileID: 6736513976106618110, guid: 18fb35664a7886842aa1702160b555a8,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6736513976106618110, guid: 18fb35664a7886842aa1702160b555a8,
type: 3}
propertyPath: m_LocalScale.y
value: 0.7652393
objectReference: {fileID: 0}
- target: {fileID: 6736513976106618110, guid: 18fb35664a7886842aa1702160b555a8,
type: 3}
propertyPath: m_LocalScale.z
value: 0.7652393
objectReference: {fileID: 0}
- target: {fileID: 6736513976106618110, guid: 18fb35664a7886842aa1702160b555a8,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6736513976106618110, guid: 18fb35664a7886842aa1702160b555a8,
type: 3}
propertyPath: m_LocalPosition.y
value: 0.67
objectReference: {fileID: 0}
- target: {fileID: 6736513976106618110, guid: 18fb35664a7886842aa1702160b555a8,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6736513976106618110, guid: 18fb35664a7886842aa1702160b555a8,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: 6736513976106618110, guid: 18fb35664a7886842aa1702160b555a8,
type: 3}
propertyPath: m_LocalRotation.x
value: -0.7071068
objectReference: {fileID: 0}
- target: {fileID: 6736513976106618110, guid: 18fb35664a7886842aa1702160b555a8,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 6736513976106618110, guid: 18fb35664a7886842aa1702160b555a8,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 6736513976106618110, guid: 18fb35664a7886842aa1702160b555a8,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -90
objectReference: {fileID: 0}
- target: {fileID: 6736513976106618110, guid: 18fb35664a7886842aa1702160b555a8,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6736513976106618110, guid: 18fb35664a7886842aa1702160b555a8,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6736513976106828952, guid: 18fb35664a7886842aa1702160b555a8,
type: 3}
propertyPath: m_Name
value: Bomb
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 18fb35664a7886842aa1702160b555a8, type: 3}
--- !u!4 &3330558348385784510 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6736513976106618110, guid: 18fb35664a7886842aa1702160b555a8,
type: 3}
m_PrefabInstance: {fileID: 8305872391170760256}
m_PrefabAsset: {fileID: 0}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: abdfd5b61d4a8664fb8222503bb9f3e8
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,18 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2758ee7f0b824d54fad918b91c9de5d1, type: 3}
m_Name: bonus_def_bomb
m_EditorClassIdentifier:
bonusType: 1
bonusAction: {fileID: 11400000, guid: c8f5b3d386f2eef429665afd445a13e9, type: 2}
icon: {fileID: 21300000, guid: d71026faa27bca6489aeb2015e2f8a1c, type: 3}
bonusLevel: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 28c26b456985d4a4cafb8d2c7f61973b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -75,7 +75,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1acd690d26225ec48941ae511fd00f74, type: 3}
m_Name:
m_EditorClassIdentifier:
bonus: {fileID: 11400000, guid: 97e9706d13c45c84982fb30afc5136fd, type: 2}
bonus: {fileID: 11400000, guid: 28c26b456985d4a4cafb8d2c7f61973b, type: 2}
aliveTime: 10
--- !u!1001 &3542199505056966218
PrefabInstance:

View File

@ -75,7 +75,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1acd690d26225ec48941ae511fd00f74, type: 3}
m_Name:
m_EditorClassIdentifier:
bonus: {fileID: 11400000, guid: da51e27cc47c1e742bfaf861459c8c5e, type: 2}
bonus: {fileID: 11400000, guid: 28c26b456985d4a4cafb8d2c7f61973b, type: 2}
aliveTime: 10
--- !u!1001 &3542199505056966218
PrefabInstance:

View File

@ -75,7 +75,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1acd690d26225ec48941ae511fd00f74, type: 3}
m_Name:
m_EditorClassIdentifier:
bonus: {fileID: 11400000, guid: 9e80fbb3ce5dac444b0c6b02b0bf4b3f, type: 2}
bonus: {fileID: 11400000, guid: 28c26b456985d4a4cafb8d2c7f61973b, type: 2}
aliveTime: 10
--- !u!1001 &3542199505056966218
PrefabInstance:

View File

@ -0,0 +1,19 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 57f6dcf8306c22c429eb9ebde71dab56, type: 3}
m_Name: Build_Trap
m_EditorClassIdentifier:
duration: 3.15
distance: 1
actionState: 4
trapPref: {fileID: 8305872390849316384, guid: abdfd5b61d4a8664fb8222503bb9f3e8,
type: 3}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c8f5b3d386f2eef429665afd445a13e9
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -2025,7 +2025,7 @@ Transform:
m_Children:
- {fileID: 526352758}
m_Father: {fileID: 0}
m_RootOrder: 14
m_RootOrder: 15
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &185995048
MonoBehaviour:
@ -5172,7 +5172,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 15
m_RootOrder: 16
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &471392440
PrefabInstance:
@ -5870,7 +5870,7 @@ Transform:
m_LocalScale: {x: 8, y: 8, z: 8}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &508187713
PrefabInstance:
@ -8555,7 +8555,7 @@ Transform:
- {fileID: 272588901}
- {fileID: 1605217076}
m_Father: {fileID: 0}
m_RootOrder: 11
m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &752477394
PrefabInstance:
@ -9046,7 +9046,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 8
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &807330786
PrefabInstance:
@ -9966,7 +9966,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 135, y: 89.99999, z: 0}
--- !u!1 &868827590 stripped
GameObject:
@ -10186,7 +10186,7 @@ Transform:
m_Children:
- {fileID: 1946816076}
m_Father: {fileID: 0}
m_RootOrder: 13
m_RootOrder: 14
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &913312418 stripped
GameObject:
@ -11214,7 +11214,7 @@ Transform:
m_Children:
- {fileID: 1923264932}
m_Father: {fileID: 0}
m_RootOrder: 7
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 70, y: 45.000004, z: 0}
--- !u!1001 &965368894
PrefabInstance:
@ -13107,7 +13107,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 9
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1102420989
MonoBehaviour:
@ -13179,7 +13179,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1102420987}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0c0fdad2e1568414581fe4f48a238b8e, type: 3}
m_Name:
@ -18794,7 +18794,7 @@ Transform:
- {fileID: 1372657677}
- {fileID: 2040783569}
m_Father: {fileID: 0}
m_RootOrder: 17
m_RootOrder: 18
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1503763737
MonoBehaviour:
@ -18808,7 +18808,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 754e9bf36b6ab0b40a8b71c58aa34b04, type: 3}
m_Name:
m_EditorClassIdentifier:
isAIActive: 1
isAIActive: 0
botState: 0
leftInput: {x: 0, y: 0}
rightInput: {x: 0, y: 0}
@ -20953,7 +20953,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 16
m_RootOrder: 17
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1639545075
PrefabInstance:
@ -22708,7 +22708,7 @@ Transform:
- {fileID: 622020284}
- {fileID: 1511619758}
m_Father: {fileID: 0}
m_RootOrder: 10
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1801060023
MonoBehaviour:
@ -22975,7 +22975,7 @@ RectTransform:
- {fileID: 6614787374390785079}
- {fileID: 436034243}
m_Father: {fileID: 0}
m_RootOrder: 12
m_RootOrder: 13
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@ -24689,7 +24689,8 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1923264931}
m_LocalRotation: {x: 0.029971035, y: 0.000000004076362, z: -0.000000007576159, w: 0.9995508}
m_LocalRotation: {x: 0.029971035, y: -0.000000004076362, z: 0.0000000075761575,
w: 0.9995508}
m_LocalPosition: {x: 0, y: 0.87083435, z: -14.50833}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
@ -25375,7 +25376,7 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1946816075}
m_LocalRotation: {x: 0.5257311, y: 0.0000000073183117, z: -0.0000000045229647, w: 0.85065085}
m_LocalRotation: {x: 0.5257311, y: -0.000000007318311, z: 0.000000004522964, w: 0.85065085}
m_LocalPosition: {x: 0, y: 13, z: -6.5}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
@ -25644,6 +25645,75 @@ MonoBehaviour:
hCost: 0
fCost: 0
parent: {fileID: 0}
--- !u!1001 &1989109123
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 2307028534112872116, guid: 79d768bf87aadec478a5722da8c6d516,
type: 3}
propertyPath: m_Name
value: DamageBomb
objectReference: {fileID: 0}
- target: {fileID: 2310877354265898640, guid: 79d768bf87aadec478a5722da8c6d516,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2310877354265898640, guid: 79d768bf87aadec478a5722da8c6d516,
type: 3}
propertyPath: m_LocalPosition.x
value: -1.0537146
objectReference: {fileID: 0}
- target: {fileID: 2310877354265898640, guid: 79d768bf87aadec478a5722da8c6d516,
type: 3}
propertyPath: m_LocalPosition.y
value: -0.14899969
objectReference: {fileID: 0}
- target: {fileID: 2310877354265898640, guid: 79d768bf87aadec478a5722da8c6d516,
type: 3}
propertyPath: m_LocalPosition.z
value: -1.3211665
objectReference: {fileID: 0}
- target: {fileID: 2310877354265898640, guid: 79d768bf87aadec478a5722da8c6d516,
type: 3}
propertyPath: m_LocalRotation.w
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: 2310877354265898640, guid: 79d768bf87aadec478a5722da8c6d516,
type: 3}
propertyPath: m_LocalRotation.x
value: -0.7071068
objectReference: {fileID: 0}
- target: {fileID: 2310877354265898640, guid: 79d768bf87aadec478a5722da8c6d516,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2310877354265898640, guid: 79d768bf87aadec478a5722da8c6d516,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 2310877354265898640, guid: 79d768bf87aadec478a5722da8c6d516,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2310877354265898640, guid: 79d768bf87aadec478a5722da8c6d516,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2310877354265898640, guid: 79d768bf87aadec478a5722da8c6d516,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 79d768bf87aadec478a5722da8c6d516, type: 3}
--- !u!1001 &1996405558
PrefabInstance:
m_ObjectHideFlags: 0
@ -26393,7 +26463,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 18
m_RootOrder: 19
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2036756630 stripped
GameObject:

View File

@ -77,14 +77,15 @@ public class ActionTriggerSystem : MonoBehaviour
yield return new WaitForFixedUpdate();
}
FinalActionOperations();
FinalActionOperations(action);
}
private void FinalActionOperations()
private void FinalActionOperations(PlayerAction action)
{
//OnActionEnd?.Invoke();
//OnActionSuccess?.Invoke();
_actionProgress = 0f;
action.FinishActionOperations(_playerState);
StopAllCoroutines();
_playerState.SetNewState(CharacterState.Idle);

View File

@ -29,6 +29,11 @@ public class PlayerAction : ScriptableObject
{
}
public virtual void FinishActionOperations(PlayerState currentPlayer)
{
Debug.Log("final action");
}
}
public enum ActionType

View File

@ -0,0 +1,35 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "New Trap", menuName = "Actions/New Trap")]
public class Trap : PlayerAction
{
public GameObject trapPref;
private TileInfo _target;
public override bool IsActionAllowed(TileInfo targetTile, PlayerState playerState)
{
if (!targetTile)
return false;
bool permission = base.IsActionAllowed(targetTile, playerState);
bool isMyTile = targetTile.tileOwnerIndex == playerState.ownerIndex;
permission = permission && targetTile.canBuildHere && isMyTile;
return permission;
}
public override void StartActionOperations(TileInfo targetTile)
{
base.StartActionOperations(targetTile);
_target = targetTile;
}
public override void FinishActionOperations(PlayerState currentPlayer)
{
base.FinishActionOperations(currentPlayer);
var spawnedTrap = Instantiate(trapPref, _target.tilePosition, trapPref.transform.rotation);
spawnedTrap.GetComponent<TrapObj>().SetOwner(currentPlayer.ownerIndex);
TileManagment.AssignBuildingToTile(_target, spawnedTrap);
_target.canMove = true;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 57f6dcf8306c22c429eb9ebde71dab56
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -14,8 +14,7 @@ public class TileInfo : MonoBehaviour
public TileOwner tileOwnerIndex = TileOwner.Neutral; //recieved by TileManager on game start
public List<TileOwner> easyCaptureFor = new List<TileOwner>();
public List<TileOwner> checkedFor = new List<TileOwner>();
public List<TileOwner> checkedFor = new List<TileOwner>();
public bool isBorderTile = false;
public bool easyCaptureForAll = false;
@ -29,7 +28,7 @@ public class TileInfo : MonoBehaviour
public TileInfo parent = null;
#endregion
}

View File

@ -64,7 +64,18 @@ public class TileMovement : MonoBehaviour
bool canMoveToMyTile = (tile.tileOwnerIndex == _playerState.ownerIndex);
bool canMoveToEnemyTile = (_playerState.currentTile.tileOwnerIndex == _playerState.ownerIndex);
return tile.canMove && (canMoveToMyTile || canMoveToEnemyTile);
bool canMoveThroughBuilding = true;
if (tile.buildingOnTile != null)
{
TrapObj trap = tile.buildingOnTile.GetComponent<TrapObj>();
if (trap != null)
{
canMoveThroughBuilding = trap.owner != _playerState.ownerIndex;
}
}
return tile.canMove && (canMoveToMyTile || canMoveToEnemyTile) && canMoveThroughBuilding;
}
else
{

33
Assets/Scripts/TrapObj.cs Normal file
View File

@ -0,0 +1,33 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TrapObj : MonoBehaviour
{
public TileOwner owner = TileOwner.Ariost;
public float damage = 100f;
public GameObject collisionVFX;
public void SetOwner(TileOwner newOwner)
{
owner = newOwner;
}
private void OnTriggerEnter(Collider other)
{
var healthController = other.gameObject.GetComponent<HealthController>();
var playerState = other.gameObject.GetComponent<PlayerState>();
if (healthController && owner != playerState.ownerIndex)
{
healthController.TakeDamage(damage);
if(collisionVFX!=null)
{
Instantiate(collisionVFX, collisionVFX.transform.position + transform.position, collisionVFX.transform.rotation);
}
Destroy(gameObject);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 090bbb9ba9296734786191db30f18c2d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long