Browse Source

Did some fixing for the inventory

master
JoshuaReason 5 years ago
parent
commit
dbf9e14b01
8 changed files with 98 additions and 77 deletions
  1. +3
    -3
      Assets/Prefabs/Character.prefab
  2. +20
    -0
      Assets/Prefabs/UI/Player Canvas.prefab
  3. +36
    -57
      Assets/Scenes/Client Scenes/ClientScene.unity
  4. +17
    -2
      Assets/Scenes/ColourCollide_Smaller.unity
  5. +9
    -1
      Assets/Scripts/Logic/Blocks/LogicBlock.cs
  6. +0
    -13
      Assets/Scripts/Logic/Blocks/Move.cs
  7. +8
    -0
      Assets/Scripts/LogicBlocks.meta
  8. +5
    -1
      Assets/Scripts/Managers/GameManager.cs

+ 3
- 3
Assets/Prefabs/Character.prefab View File

@ -48,12 +48,12 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
nextScene: MainMenu
startingInventory: {fileID: 11400000, guid: 57948efb1cd9603419511d2dd2eabc3d, type: 2}
CurrentBlock: {fileID: 0}
_currentBlock: {fileID: 0}
Ignore:
serializedVersion: 2
m_Bits: 0
Inventory: {fileID: 11400000, guid: b6fa892e4c159bf46a2c4cda19627e97, type: 2}
CharacterModel: Bear
--- !u!114 &2631002120179805110
MonoBehaviour:
m_ObjectHideFlags: 0
@ -99,7 +99,7 @@ MonoBehaviour:
character: {fileID: 2862111851184665482}
blockReader:
LogicChain: []
waitTime: 0.5
waitTime: 1.5
--- !u!65 &4912471391544438089
BoxCollider:
m_ObjectHideFlags: 0

+ 20
- 0
Assets/Prefabs/UI/Player Canvas.prefab View File

@ -774,6 +774,7 @@ GameObject:
- component: {fileID: 5195354182462625305}
- component: {fileID: 5195354182462625302}
- component: {fileID: 5195354182462625303}
- component: {fileID: 1240851277759925011}
m_Layer: 5
m_Name: Player Canvas
m_TagString: Untagged
@ -864,6 +865,25 @@ MonoBehaviour:
m_BlockingMask:
serializedVersion: 2
m_Bits: 307
--- !u!114 &1240851277759925011
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5195354182462625300}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 65239890e888fd246a0b0985573deed6, type: 3}
m_Name:
m_EditorClassIdentifier:
Inventory: {fileID: 5195354183134146528}
AnimationSpeed: 0.5
TrayUI: {fileID: 0}
Client: {fileID: 11400000, guid: 8dca4719b56d91143b236583a436c911, type: 2}
TimeText: {fileID: 0}
Title: {fileID: 2665231842396078511}
TotalTime: 30
--- !u!1 &5195354182925078845
GameObject:
m_ObjectHideFlags: 0

+ 36
- 57
Assets/Scenes/Client Scenes/ClientScene.unity View File

@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.4465785, g: 0.49641222, b: 0.57481694, a: 1}
m_IndirectSpecularColor: {r: 0.44657868, g: 0.49641263, b: 0.57481706, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
@ -452,18 +452,6 @@ RectTransform:
type: 3}
m_PrefabInstance: {fileID: 5195354181466942481}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1804173232 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5195354183134146528, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
type: 3}
m_PrefabInstance: {fileID: 5195354181466942481}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 36cc4df775c8e8b46a89972d8008d56d, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1902492079
GameObject:
m_ObjectHideFlags: 0
@ -537,11 +525,42 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1240851277759925011, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
type: 3}
propertyPath: TrayUI
value:
objectReference: {fileID: 1324620581}
- target: {fileID: 1240851277759925011, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
type: 3}
propertyPath: TimeText
value:
objectReference: {fileID: 1363815578}
- target: {fileID: 5195354182462625300, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
type: 3}
propertyPath: m_Name
value: Player Canvas
objectReference: {fileID: 0}
- target: {fileID: 5195354181806561359, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -0.000015258307
objectReference: {fileID: 0}
- target: {fileID: 5195354181806561359, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5195354181806561359, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0.000007958263
objectReference: {fileID: 0}
- target: {fileID: 5195354183134146528, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
type: 3}
propertyPath: inventory
value:
objectReference: {fileID: 11400000, guid: 9f2bac6895147d444858493b9609d026,
type: 2}
- target: {fileID: 5195354182462625304, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
type: 3}
propertyPath: m_LocalPosition.x
@ -662,21 +681,6 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 85.99994
objectReference: {fileID: 0}
- target: {fileID: 5195354181806561359, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -0.000022888184
objectReference: {fileID: 0}
- target: {fileID: 5195354181806561359, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5195354181806561359, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
type: 3}
propertyPath: m_AnchoredPosition.x
value: -0.000052050564
objectReference: {fileID: 0}
- target: {fileID: 5195354183101525346, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
type: 3}
propertyPath: m_AspectRatio
@ -832,12 +836,6 @@ PrefabInstance:
propertyPath: m_Color.a
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5195354183134146528, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
type: 3}
propertyPath: inventory
value:
objectReference: {fileID: 11400000, guid: 9f2bac6895147d444858493b9609d026,
type: 2}
- target: {fileID: 2665231841929910951, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
type: 3}
propertyPath: m_Name
@ -917,40 +915,21 @@ PrefabInstance:
- {fileID: 5195354182462625307, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f, type: 3}
- {fileID: 5195354183157824118, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f, type: 3}
m_SourcePrefab: {fileID: 100100000, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f, type: 3}
--- !u!1 &5195354181466942482 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 5195354182462625300, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
--- !u!114 &5195354181466942483 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 1240851277759925011, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
type: 3}
m_PrefabInstance: {fileID: 5195354181466942481}
m_PrefabAsset: {fileID: 0}
--- !u!114 &5195354181466942483
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5195354181466942482}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 65239890e888fd246a0b0985573deed6, type: 3}
m_Name:
m_EditorClassIdentifier:
Inventory: {fileID: 1804173232}
AnimationSpeed: 0.5
TrayUI: {fileID: 1324620581}
Client: {fileID: 11400000, guid: 8dca4719b56d91143b236583a436c911, type: 2}
TimeText: {fileID: 1363815578}
Title: {fileID: 5195354181466942485}
TotalTime: 30
--- !u!224 &5195354181466942484 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 2665231842684883354, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
type: 3}
m_PrefabInstance: {fileID: 5195354181466942481}
m_PrefabAsset: {fileID: 0}
--- !u!224 &5195354181466942485 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 2665231842396078511, guid: 3fbc9b76d5c4f7348b60a029bc2ba63f,
type: 3}
m_PrefabInstance: {fileID: 5195354181466942481}
m_PrefabAsset: {fileID: 0}

+ 17
- 2
Assets/Scenes/ColourCollide_Smaller.unity View File

@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.4465785, g: 0.49641222, b: 0.57481694, a: 1}
m_IndirectSpecularColor: {r: 0.44657868, g: 0.49641263, b: 0.57481706, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
@ -2633,6 +2633,16 @@ PrefabInstance:
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: isSpawnable
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: SpawnDirection
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3}
--- !u!4 &742803853 stripped
@ -3129,7 +3139,12 @@ PrefabInstance:
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: isSpawnable
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8101348915751558870, guid: d7698c69246c64044ab2a94628bf0291,
type: 3}
propertyPath: SpawnDirection
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d7698c69246c64044ab2a94628bf0291, type: 3}

+ 9
- 1
Assets/Scripts/Logic/Blocks/LogicBlock.cs View File

@ -32,6 +32,9 @@ public abstract class LogicBlock : ScriptableObject
#region ReadOnly Variables
public string DisplayName { get { return (string.IsNullOrEmpty(_DisplayName)) ? name : _DisplayName; } }
[HideInInspector]
public bool hasBeenRemoved = false;
#endregion
#region private variables
@ -144,7 +147,12 @@ public abstract class LogicBlock : ScriptableObject
LogicBlock otherLogic = other as LogicBlock;
return !Object.ReferenceEquals(null, otherLogic)
&& int.Equals(RepeatCount, otherLogic.RepeatCount);
&& string.Equals(name, otherLogic.name);
}
public override int GetHashCode()
{
return name.GetHashCode();
}
public virtual void OnDoubleClick()

+ 0
- 13
Assets/Scripts/Logic/Blocks/Move.cs View File

@ -69,19 +69,6 @@ public class Move : LogicBlock
return retVal;
}
public override bool Equals(object other)
{
if (Object.ReferenceEquals(null, other))
return false;
if (Object.ReferenceEquals(other.GetType(), other))
return false;
Move otherMove = other as Move;
return base.Equals(other)&& Direction.Equals(direction, otherMove.direction);
}
#endregion Class Functions
}

+ 8
- 0
Assets/Scripts/LogicBlocks.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8936b441d7647f74884c94f97bfb8931
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 5
- 1
Assets/Scripts/Managers/GameManager.cs View File

@ -99,7 +99,11 @@ public class GameManager : MonoBehaviour
{
if (!player.waiting)
{
//player.client.Inventory.Remove(player.blockReader.CurrentBlock);
if (!player.blockReader.CurrentBlock.hasBeenRemoved)
{
player.client.Inventory.Remove(player.blockReader.CurrentBlock);
player.blockReader.CurrentBlock.hasBeenRemoved = true;
}
player.waiting = player.blockReader.Read(player.character, AnimationTime);
}
}

Loading…
Cancel
Save