Commit 308b6471 authored by 15박보승's avatar 15박보승

상호작용 오브젝트, 총알 프레임워크 추가

parent 5ba20e68
fileFormatVersion: 2
guid: 11340b2c2338e5f4b94723a20f6d91c9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 6f3e639ab94a86c4782207a42aaa98a4
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 861814882eb1bba48a822f211b7b30f9
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 23800000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: d27b236805058644facdc746ba74eccd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: d26f2f9ee3645e34ca40f7c7630f9987
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public interface IInteractor
{
void Interact(Bullet bullet);
}
\ No newline at end of file
fileFormatVersion: 2
guid: ea02f7308b65dce44b8d87e2682ff2f0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public class Mirror : MonoBehaviour, IInteractor
{
private Camera camera;
private RenderTexture rt;
public void Interact(Bullet bullet)
{
if (bullet is TruthBullet)
{
//Break Mirror
}
else if (bullet is FakeBullet)
{
//Break Mirror & Make reflected objects
}
else if (bullet is MirrorBullet)
{
//Nothing happens
}
}
private void Start()
{
camera = GetComponent<Camera>();
//TODO : Create RenderTexture and put it into Camera's targeTexture
}
private void Update()
{
//TODO :Calculate Camera's Position and Rotation
}
}
fileFormatVersion: 2
guid: 1436eae8f715791448d7d56c6d6b6fb4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NormalWall : MonoBehaviour, IInteractor
{
public void Interact(Bullet bullet)
{
if (bullet is TruthBullet)
{
//Break Wall
}
else if (bullet is FakeBullet)
{
//Nothing happens
}
else if (bullet is MirrorBullet)
{
//Nothing happens
}
}
}
fileFormatVersion: 2
guid: a6d2b4a608022ae47a6546f7b81357da
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 3b9d5a5a76ee6064faf4495a3b418cc0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public abstract class Bullet : MonoBehaviour
{
private Rigidbody rb;
protected abstract void OnTriggerEnter(Collider other);
private void Start()
{
rb = GetComponent<Rigidbody>();
}
public void Init(Vector3 velocity)
{
rb.velocity = velocity;
}
}
fileFormatVersion: 2
guid: e35d2154e31884f4a80dda19fb5f84ed
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public enum BulletCode
{
True,
False,
Mirror
}
public static class BulletFactory
{
/// <summary>
/// Returns new bullet gameobject with bullet script on it
/// </summary>
/// <param name="bulletCode">Type of bullet that wants to make</param>
/// <returns></returns>
public static GameObject MakeBullet(BulletCode bulletCode)
{
switch (bulletCode)
{
case BulletCode.True:
break;
case BulletCode.False:
break;
case BulletCode.Mirror:
break;
default:
break;
}
return null;
}
}
fileFormatVersion: 2
guid: 95e509d872294d848bd8d3ad8832d7a3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FakeBullet : Bullet
{
protected override void OnTriggerEnter(Collider other)
{
//TODO : if mirror, break mirror and make objects
}
}
fileFormatVersion: 2
guid: 5c2fdfcbe8159374a87a0cc0d3ef8ab4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MirrorBullet : Bullet
{
protected override void OnTriggerEnter(Collider other)
{
//If wall, make a new mirror on the wall
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: c83ac5446f00c574b9693063e47d9125
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TruthBullet : Bullet
{
protected override void OnTriggerEnter(Collider other)
{
//TODO : if breakable, break
}
}
fileFormatVersion: 2
guid: e5f8ba3dd55623f42b27096d5298af36
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