Ajout Interface Grabable + Start Mug Implementation
This commit is contained in:
parent
594de91135
commit
71d6586baf
5 changed files with 81 additions and 0 deletions
|
@ -348,6 +348,7 @@ GameObject:
|
||||||
- component: {fileID: 698542427}
|
- component: {fileID: 698542427}
|
||||||
- component: {fileID: 698542426}
|
- component: {fileID: 698542426}
|
||||||
- component: {fileID: 698542425}
|
- component: {fileID: 698542425}
|
||||||
|
- component: {fileID: 698542428}
|
||||||
m_Layer: 8
|
m_Layer: 8
|
||||||
m_Name: Chicken
|
m_Name: Chicken
|
||||||
m_TagString: Grabable
|
m_TagString: Grabable
|
||||||
|
@ -447,6 +448,19 @@ Transform:
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 2
|
m_RootOrder: 2
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &698542428
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 698542424}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 06f2e18c7d91f7f4d99cd5e5c7d12b45, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
size: 1
|
||||||
--- !u!1001 &5841415791122168402
|
--- !u!1001 &5841415791122168402
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
12
Assets/Scripts/IGrabable.cs
Normal file
12
Assets/Scripts/IGrabable.cs
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public interface IGrabable
|
||||||
|
{
|
||||||
|
//Unity inspector doesn't handle interface...
|
||||||
|
// int size {get; set;} //Size (1 or 2 hands) of the object
|
||||||
|
void use();
|
||||||
|
void take();
|
||||||
|
void drop(Transform position); //Drop to position
|
||||||
|
}
|
11
Assets/Scripts/IGrabable.cs.meta
Normal file
11
Assets/Scripts/IGrabable.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8b361e6ffedda81479039894641446ce
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
33
Assets/Scripts/Mug.cs
Normal file
33
Assets/Scripts/Mug.cs
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class Mug : MonoBehaviour, IGrabable
|
||||||
|
{
|
||||||
|
public int size = 1; //Size (1 or 2 hands) of the object
|
||||||
|
|
||||||
|
public void use()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public void take()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public void drop(Transform position) //Drop to position
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start is called before the first frame update
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Scripts/Mug.cs.meta
Normal file
11
Assets/Scripts/Mug.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 06f2e18c7d91f7f4d99cd5e5c7d12b45
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue