Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9fa4fc6
Added unfinished starter for slider
AlexCreamer Mar 30, 2024
55a2143
Prototype slider with spacebar functionality
AlexCreamer Apr 13, 2024
1ef4c4b
Tree collider ray-cast added
AlexCreamer May 17, 2024
359fe89
Upgraded to Unity 6
AlexCreamer May 20, 2024
f422844
Look ma, some tree damage and poof!
AlexCreamer May 22, 2024
de53a7a
Starter prototype for ore mining
AlexCreamer May 29, 2024
4a35f41
New mini temp terrain to reduce build time
AlexCreamer Jun 16, 2024
9c2a599
Minor updates
AlexCreamer Jun 29, 2024
ef5a1e0
Mining Circles systems more construction
AlexCreamer Jul 1, 2024
fc828e0
Mining Action Circles working
AlexCreamer Jul 2, 2024
7620dc8
Small updates
AlexCreamer Jul 10, 2024
f298c93
Small updates
AlexCreamer Jul 19, 2024
2060c09
Update to Mining system and Tree Cutting system. More work to do here.
AlexCreamer Jul 19, 2024
4473be7
Working on wood cutting and central event system
AlexCreamer Jul 27, 2024
217e66e
Tree cutting working with central event system. Need to fix mining sy…
AlexCreamer Jul 27, 2024
9bd4094
Updated mining system to use new central event system.
AlexCreamer Jul 28, 2024
5193f26
Update to Mining and Woodcutting
AlexCreamer Jul 29, 2024
07f62d2
Messing around: starting with the inventory system and upgraded to 60…
AlexCreamer Sep 4, 2024
0462668
Starting addition of inventory system - 6000.0.20f1
AlexCreamer Sep 26, 2024
aa5e874
Inventory system - drag and drop
AlexCreamer Sep 30, 2024
a7e4e03
Upgrade inventory system. Item added to inventory after resource tree…
AlexCreamer Nov 7, 2024
ae8c6a0
Tree cutting inventory babygit add -A!
AlexCreamer Nov 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Empty file added .exrc
Empty file.
149 changes: 149 additions & 0 deletions Assets/ActionEventSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
using FishNet.Example.ColliderRollbacks;
using UnityEngine;

public class ActionEventSystem : MonoBehaviour
{
//public static ActionEventSystem instance;
[SerializeField] private Camera PlayerCamera;
public float actionRange = 200f;
public LayerMask actionMask;

// Attach network scripts from player to this script
//[TextArea]
[Header("Player harvesting scripts")]
public TreeCutting treeCutting;
public OreCutting oreCutting;

// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
actionMask = LayerMask.GetMask("HarvestObject");
}
/*
private void Awake()
{
if (instance != null)
{
Destroy(gameObject);
}
else
{
DontDestroyOnLoad(gameObject);
instance = this;
}
}
*/
// Update is called once per frame
void Update()
{
if (Input.GetMouseButtonDown(0))
{
//if (Animator != null) Animator.SetTrigger("Attack");
//FunctionTimer.Create(AnimationEvent_OnHit, 0.5f);

//Ray CameraRay = PlayerCamera.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0f));

Ray ray = PlayerCamera.ScreenPointToRay(Input.mousePosition);
//RaycastHit hit;
Debug.Log("apple");
Debug.DrawRay(PlayerCamera.transform.position, PlayerCamera.ScreenToWorldPoint(Input.mousePosition), Color.green);
Debug.Log("banana");

if (Physics.Raycast(ray, out RaycastHit HitInfo, 200f))
{
Debug.Log("Kiwi");
Debug.Log("HitInfo.collider.gameObject: " + HitInfo.collider.gameObject);
if (HitInfo.collider.gameObject.GetComponent<TreeHealth>())
{



Debug.Log("Peach");
GameObject localPlayer = PlayerBehaviour.instance.gameObject;

Vector3 directionToTarget = localPlayer.transform.position - HitInfo.transform.position;
float angle = Vector3.Angle(localPlayer.transform.forward, directionToTarget);

// Print angle
Debug.Log("angle: " + angle);

if (angle > 90)
{
Debug.Log("angle is greater than 90");
// Cut the tree here
}


Debug.Log("Orange");
Debug.Log("HitInfo.transform.gameObject: " + HitInfo.transform.gameObject);
GameObject objectToAction = HitInfo.transform.gameObject;

if (objectToAction.TryGetComponent(out ResourceNode resourceNode))
{
// Check if the object is a tree
if (objectToAction.TryGetComponent(out TreeHealth treeHealth))
{
// Not sure if the following "if" statements work.
if (treeHealth == null)
{
Debug.LogError("treeHealth is null");
}
if (resourceNode == null)
{
Debug.LogError("resourceNode is null");
}
if (objectToAction == null)
{
Debug.LogError("objectToAction is null");
}
//
if (HitInfo.collider == null)
{
Debug.LogError("HitInfo is null");
}
if (treeCutting == null)
{
Debug.LogError("treeCutting is null");
}

// Print all values
Debug.Log("treeHealth: " + treeHealth);
Debug.Log("resourceNode: " + resourceNode);
Debug.Log("objectToAction: " + objectToAction);
Debug.Log("HitInfo: " + HitInfo);


treeCutting.StartCuttingEvent(treeHealth, resourceNode, objectToAction, HitInfo, gameObject);

}

// Check if object is an ore
else if (objectToAction.TryGetComponent(out OreHealth oreHealth))
{
// Not sure if the following "if" statements work.
if (oreHealth == null)
{
Debug.LogError("oreHealth is null");
}
if (resourceNode == null)
{
Debug.LogError("resourceNode is null");
}
if (objectToAction == null)
{
Debug.LogError("objectToAction is null");
}
//
if (HitInfo.collider == null)
{
Debug.LogError("HitInfo is null");
}

oreCutting.StartMiningEvent(oreHealth, resourceNode, objectToAction, HitInfo, gameObject);
}
}
}
}
}
}
}
2 changes: 2 additions & 0 deletions Assets/ActionEventSystem.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

114 changes: 114 additions & 0 deletions Assets/AddressableAssetsData/AddressableAssetSettings.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
%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: 468a46d0ae32c3544b7d98094e6448a9, type: 3}
m_Name: AddressableAssetSettings
m_EditorClassIdentifier:
m_DefaultGroup: 562e54830f7fa6c4a9dc4b28b9b7114a
m_currentHash:
serializedVersion: 2
Hash: a867fe6cc77641794dfe54e2b21ea9db
m_OptimizeCatalogSize: 0
m_BuildRemoteCatalog: 0
m_CatalogRequestsTimeout: 0
m_DisableCatalogUpdateOnStart: 0
m_InternalIdNamingMode: 0
m_InternalBundleIdMode: 1
m_AssetLoadMode: 0
m_BundledAssetProviderType:
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider
m_AssetBundleProviderType:
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider
m_IgnoreUnsupportedFilesInBuild: 0
m_UniqueBundleIds: 0
m_EnableJsonCatalog: 0
m_NonRecursiveBuilding: 1
m_CCDEnabled: 0
m_maxConcurrentWebRequests: 3
m_UseUWRForLocalBundles: 0
m_BundleTimeout: 0
m_BundleRetryCount: 0
m_BundleRedirectLimit: -1
m_SharedBundleSettings: 0
m_SharedBundleSettingsCustomGroupIndex: 0
m_ContiguousBundles: 1
m_StripUnityVersionFromBundleBuild: 0
m_DisableVisibleSubAssetRepresentations: 0
m_BuiltInBundleNaming: 0
mBuiltInBundleCustomNaming:
m_MonoScriptBundleNaming: 0
m_CheckForContentUpdateRestrictionsOption: 0
m_MonoScriptBundleCustomNaming:
m_RemoteCatalogBuildPath:
m_Id:
m_RemoteCatalogLoadPath:
m_Id:
m_ContentStateBuildPathProfileVariableName:
m_CustomContentStateBuildPath:
m_ContentStateBuildPath:
m_BuildAddressablesWithPlayerBuild: 0
m_overridePlayerVersion: '[UnityEditor.PlayerSettings.bundleVersion]'
m_GroupAssets:
- {fileID: 11400000, guid: 507cc395d7f736148ab69ad1100a8001, type: 2}
m_BuildSettings:
m_LogResourceManagerExceptions: 1
m_BundleBuildPath: Temp/com.unity.addressables/AssetBundles
m_ProfileSettings:
m_Profiles:
- m_InheritedParent:
m_Id: d03c44aa155744d47bfb77b2420b842b
m_ProfileName: Default
m_Values:
- m_Id: 2783672f151d07b4fa4db6700a9dca9b
m_Value: '{UnityEngine.AddressableAssets.Addressables.RuntimePath}/[BuildTarget]'
- m_Id: 5645313b35e066a4aaf32695845a92c0
m_Value: '[UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget]'
- m_Id: b1d511631d8387840b80e66cdfc71024
m_Value: <undefined>
- m_Id: d58bc4176e21d9744a442841d2e52d06
m_Value: 'ServerData/[BuildTarget]'
- m_Id: fa2274866e0aeb74e894560f33e41b6d
m_Value: '[UnityEditor.EditorUserBuildSettings.activeBuildTarget]'
m_ProfileEntryNames:
- m_Id: 2783672f151d07b4fa4db6700a9dca9b
m_Name: Local.LoadPath
m_InlineUsage: 0
- m_Id: 5645313b35e066a4aaf32695845a92c0
m_Name: Local.BuildPath
m_InlineUsage: 0
- m_Id: b1d511631d8387840b80e66cdfc71024
m_Name: Remote.LoadPath
m_InlineUsage: 0
- m_Id: d58bc4176e21d9744a442841d2e52d06
m_Name: Remote.BuildPath
m_InlineUsage: 0
- m_Id: fa2274866e0aeb74e894560f33e41b6d
m_Name: BuildTarget
m_InlineUsage: 0
m_ProfileVersion: 1
m_LabelTable:
m_LabelNames:
- default
m_SchemaTemplates: []
m_GroupTemplateObjects:
- {fileID: 11400000, guid: a5dac73b603d79446829db7ed9c48829, type: 2}
m_InitializationObjects: []
m_CertificateHandlerType:
m_AssemblyName:
m_ClassName:
m_ActivePlayerDataBuilderIndex: 2
m_DataBuilders:
- {fileID: 11400000, guid: d0cbc252516600c4cab02ae7136cbec7, type: 2}
- {fileID: 11400000, guid: 1f6f04afbdae44146bed71b1f74bce84, type: 2}
- {fileID: 11400000, guid: 32ae2e68f7ae7334bb751c769464e3a1, type: 2}
m_ActiveProfileId: d03c44aa155744d47bfb77b2420b842b

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
%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: 1a3c5d64ac83548c09dd1678b9f6f1cd, type: 3}
m_Name: Packed Assets
m_EditorClassIdentifier:
m_SchemaObjects:
- {fileID: 3689498582553609845}
- {fileID: 5830244726355074738}
m_Description: Pack assets into asset bundles.
m_Settings: {fileID: 11400000, guid: c6ae8d145acb1c84ab9aa0422fdc5b52, type: 2}
--- !u!114 &3689498582553609845
MonoBehaviour:
m_ObjectHideFlags: 1
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: e5d17a21594effb4e9591490b009e7aa, type: 3}
m_Name: BundledAssetGroupSchema
m_EditorClassIdentifier:
m_Group: {fileID: 0}
m_InternalBundleIdMode: 1
m_Compression: 1
m_IncludeAddressInCatalog: 1
m_IncludeGUIDInCatalog: 1
m_IncludeLabelsInCatalog: 1
m_InternalIdNamingMode: 0
m_CacheClearBehavior: 0
m_IncludeInBuild: 1
m_BundledAssetProviderType:
m_AssemblyName:
m_ClassName:
m_ForceUniqueProvider: 0
m_UseAssetBundleCache: 1
m_UseAssetBundleCrc: 1
m_UseAssetBundleCrcForCachedBundles: 1
m_UseUWRForLocalBundles: 0
m_Timeout: 0
m_ChunkedTransfer: 0
m_RedirectLimit: -1
m_RetryCount: 0
m_BuildPath:
m_Id:
m_LoadPath:
m_Id:
m_BundleMode: 0
m_AssetBundleProviderType:
m_AssemblyName:
m_ClassName:
m_UseDefaultSchemaSettings: 0
m_SelectedPathPairIndex: 0
m_BundleNaming: 0
m_AssetLoadMode: 0
--- !u!114 &5830244726355074738
MonoBehaviour:
m_ObjectHideFlags: 1
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: 5834b5087d578d24c926ce20cd31e6d6, type: 3}
m_Name: ContentUpdateGroupSchema
m_EditorClassIdentifier:
m_Group: {fileID: 0}
m_StaticContent: 0

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading