Dungeon campfires random placement and portal modification

This commit is contained in:
Jakub Sztuba 2023-01-13 16:25:57 +01:00
parent b58bf4c32d
commit 0ae19723f8
7 changed files with 733 additions and 501 deletions

View File

@ -276,6 +276,7 @@
<Compile Include="Assets\Scripts\Pathfinding\Node.cs" />
<Compile Include="Assets\SwitchSprite.cs" />
<Compile Include="Assets\ManageExpBar.cs" />
<Compile Include="Assets\Scripts\DungeonItemsFiller.cs" />
<Compile Include="Assets\Scripts\Pathfinding\Pathfinding.cs" />
<Compile Include="Assets\Scripts\Item\PickableController.cs" />
<Compile Include="Assets\Scripts\REFACTORING\Application\Chest\SceneChestBuilder.cs" />

View File

@ -0,0 +1,124 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6871812367389855946
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3525429541201917992}
- component: {fileID: -3986418963424125854}
- component: {fileID: -2557735283830208736}
- component: {fileID: -4011591537468410255}
m_Layer: 0
m_Name: FireCamp
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3525429541201917992
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6871812367389855946}
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: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &-3986418963424125854
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6871812367389855946}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6bbac356cbeeb02448e529b4f2d9c604, type: 3}
m_Name:
m_EditorClassIdentifier:
inRange: 0
timerDmg: 0
waitTime: 1
firstAttack: 0
baseAttack: 1
isPanelEnabled: 1
other: {fileID: 0}
--- !u!95 &-2557735283830208736
Animator:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6871812367389855946}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: f83320568db09104ab270d53cc7d8cc7, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
--- !u!212 &-4011591537468410255
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6871812367389855946}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 3
m_Sprite: {fileID: 4268471932424394617, guid: 813d71ef063a3984384ab7e19f7677e5, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1, y: 1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0

View File

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

View File

@ -49,7 +49,7 @@ BoxCollider2D:
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
m_Offset: {x: -0.023932666, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5526358, y: 0.50556314}
@ -60,7 +60,7 @@ BoxCollider2D:
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 1, y: 1}
m_Size: {x: 0.7671074, y: 1}
m_EdgeRadius: 0
--- !u!50 &5514110702475440543
Rigidbody2D:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,44 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DungeonItemsFiller : MonoBehaviour
{
public GameObject itemOriginalOne;
public GameObject itemOneContainer;
private bool wasBuilt = false;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (!wasBuilt)
{
PlaceItems(20);
}
}
private void PlaceItems(int numberOfItems)
{
Vector3 coords;
for (int i = 0; i < numberOfItems; i++)
{
//GameObject CoinClone = Instantiate(itemOriginalOne);
//GameObject CoinClone = Instantiate(itemOriginalOne, new Vector3(i * 0.6f, itemOriginalOne.transform.position.y, i * 0.75f), itemOriginalOne.transform.rotation);
coords = GameObject.FindObjectOfType<TileMapGenerator>().gameObject.GetComponent<TileMapGenerator>().randomCoordsForStanding();
var CoinClone = Instantiate(itemOriginalOne, coords, Quaternion.identity);
CoinClone.name = "ItemClone-" + (i + 1);
CoinClone.transform.parent = itemOneContainer.transform;
if (i == numberOfItems - 1)
{
wasBuilt = true;
}
}
}
}

View File

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