Commit 2e546999 authored by 18류지석's avatar 18류지석

아이템 애드온 클래스 제작

parent 92356b8c
......@@ -21,7 +21,7 @@ GameObject:
- component: {fileID: 4921126351507724}
- component: {fileID: 212944448011839934}
m_Layer: 0
m_Name: Fog
m_Name: fog
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_SourcePrefab: {fileID: 0}
m_RootGameObject: {fileID: 1813912364111484}
m_IsPrefabAsset: 1
--- !u!1 &1208630702526062
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6
m_Component:
- component: {fileID: 224901548203493508}
- component: {fileID: 222462642363945872}
- component: {fileID: 114051075353211474}
m_Layer: 5
m_Name: Inventory Background
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1813912364111484
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6
m_Component:
- component: {fileID: 224677920009192142}
- component: {fileID: 223614052718207098}
- component: {fileID: 114829131213021812}
- component: {fileID: 114010573879188626}
- component: {fileID: 114499813606064436}
m_Layer: 5
m_Name: Inventory Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &114010573879188626
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1813912364111484}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &114051075353211474
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1208630702526062}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &114499813606064436
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1813912364111484}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f387f56bed3e2d34b8a70ebc65ac286e, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &114829131213021812
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1813912364111484}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
--- !u!222 &222462642363945872
CanvasRenderer:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1208630702526062}
m_CullTransparentMesh: 0
--- !u!223 &223614052718207098
Canvas:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1813912364111484}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 0
m_SortingLayerID: 0
m_SortingOrder: 1
m_TargetDisplay: 0
--- !u!224 &224677920009192142
RectTransform:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1813912364111484}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 224901548203493508}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!224 &224901548203493508
RectTransform:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1208630702526062}
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: 224677920009192142}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1280, y: 720}
m_Pivot: {x: 0, y: 0}
This diff is collapsed.
fileFormatVersion: 2
guid: 6f4b64053265cff4a8f45462c67584a4
NativeFormatImporter:
guid: 496054d9f750988418ab6cc08cc23f5a
DefaultImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:
public enum ItemQuality
{
Study,
Ordinary,
Superior,
Masterpiece
}
public enum AddonType
{
Prop,
Matter,
Component,
Theory
}
fileFormatVersion: 2
guid: 8af377227dc260b4aa0846ed539ffd3c
guid: 54b641ebe19bc8846991ea85e270604b
MonoImporter:
externalObjects: {}
serializedVersion: 2
......
fileFormatVersion: 2
guid: e92df8eed60682643a4380829c5546e2
guid: 575133fc1e178314c984f50cc4f8a508
folderAsset: yes
DefaultImporter:
externalObjects: {}
......
......@@ -2,15 +2,8 @@
using System.Collections.Generic;
using UnityEngine;
public class Addon : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
public abstract class Addon {
public ItemQuality quality;
public AddonType type;
public Sprite sprite;
}
fileFormatVersion: 2
guid: 138c726404f3fd444abdec4d37ba3b85
guid: f4564ddfbadd2d5409b161ec3c82e70b
MonoImporter:
externalObjects: {}
serializedVersion: 2
......
fileFormatVersion: 2
guid: 9131e6c7ac79278499e6a74b49e4ddc2
guid: 3eeb43e73bfaf1f48901afcdbe4f6d11
folderAsset: yes
DefaultImporter:
externalObjects: {}
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class InventoryManager : MonoBehaviour {
List<Item> itemList = new List<Item>();
List<Addon> addonList = new List<Addon>();
public void PushItem(Item item)
{
if(itemList.Count < 9)
itemList.Add(item);
}
public void PushAddon(Addon addon)
{
if (addonList.Count < 9)
addonList.Add(addon);
}
public void DiscardItem(int index)
{
if (itemList.Count > index)
itemList.RemoveAt(index);
}
public void DiscardAddon(int index)
{
if (addonList.Count > index)
addonList.RemoveAt(index);
}
public void DiscardAddon(int itemIndex, AddonType addonType)
{
if (itemList[itemIndex].addons[(int)addonType] != null)
itemList[itemIndex].addons[(int)addonType] = null;
}
public void AttachAddon(int itemIndex, int addonIndex)
{
if(itemList[itemIndex].attachable[(int)addonList[addonIndex].type] && itemList[itemIndex].addons[(int)addonList[addonIndex].type] == null)
{
itemList[itemIndex].addons[(int)addonList[addonIndex].type] = addonList[addonIndex];
addonList.RemoveAt(addonIndex);
}
}
public void DetachAddon(int itemIndex, AddonType addonType)
{
if(addonList.Count < 9 && itemList[itemIndex].addons[(int)addonType] != null)
{
addonList.Add(itemList[itemIndex].addons[(int)addonType]);
itemList[itemIndex].addons[(int)addonType] = null;
}
}
}
fileFormatVersion: 2
guid: 5ac27f5d1dcc7e241b8cffe2a360a604
guid: 674793b622d7c184882dfeb8784bbf92
MonoImporter:
externalObjects: {}
serializedVersion: 2
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public abstract class Item {
public int id;
public ItemQuality quality;
public int skillNum;
public string[] combo = new string[3]; //Capital Letters A B C
public bool[] attachable = new bool[4]; //0: prop 1: matter 2: component 3:theory
public Addon[] addons = new Addon[4]; //0: prop 1: matter 2: component 3:theory
public Sprite sprite;
public bool ComboAction(string currentCombo)
{
for(int i=0; i<skillNum; i++)
{
if (combo[i].Equals(currentCombo))
{
if (i == 0) PlaySkill1();
else if (i == 1) PlaySkill2();
else if (i == 2) PlaySkill3();
return true;
}
}
return false;
}
protected void PlaySkill1()
{
}
protected void PlaySkill2()
{
}
protected void PlaySkill3()
{
}
}
fileFormatVersion: 2
guid: 9574d82cade29e6419b802dfbd1c8c64
guid: c7534dfffe8f56648b7ba462315d576f
MonoImporter:
externalObjects: {}
serializedVersion: 2
......
fileFormatVersion: 2
guid: 2745a1cacafc96b4db1e5ea6b1ddd9fd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -2,7 +2,7 @@
using System.Collections.Generic;
using UnityEngine;
public class Item : MonoBehaviour {
public class Bow : Item {
// Use this for initialization
void Start () {
......
fileFormatVersion: 2
guid: 566497fb2a0c9844daf8249f1466f888
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DroppedItem : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Frame : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Potion : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
fileFormatVersion: 2
guid: d9fdb539a8c32be4bb032f0a7434f6a6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ComboUI : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
fileFormatVersion: 2
guid: f027ec64e7d6cad45ae4d342238ea756
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CoolUI : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
fileFormatVersion: 2
guid: 71a53a3d24852ef4892be554fad7314b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MinimapUI : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
fileFormatVersion: 2
guid: cb82d191362936642bd9900ccc490b83
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TimerUI : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
fileFormatVersion: 2
guid: 6265206b826c8f344a708bf9bf2639e0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class InventoryUI : MonoBehaviour {
Canvas canvas;
bool isActive;
void Start()
{
canvas = gameObject.GetComponent<Canvas>();
canvas.enabled = false;
isActive = false;
}
void Update()
{
if (Input.GetKeyDown(KeyCode.Tab))
{
isActive = !isActive;
canvas.enabled = isActive;
if (isActive)
Time.timeScale = 0;
else
Time.timeScale = 1;
}
}
}
fileFormatVersion: 2
guid: f387f56bed3e2d34b8a70ebc65ac286e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UIManager : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
fileFormatVersion: 2
guid: 3aa5d61e41ea45744acb4da8bd0e45a6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment