Commit d6949141 authored by 황호기's avatar 황호기

make objects

parent eef49ee5
fileFormatVersion: 2
guid: 79643074544e73640a7e1a17aea69d62
folderAsset: yes
timeCreated: 1452865910
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 8ebf1270c910c9244b74eb826b2ae20d
timeCreated: 1452865927
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 808d81124f19d3345b436410d5ec2459
timeCreated: 1452875848
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
public class Enemy : MonoBehaviour {
// Use this for initialization
Vector3 movedirection;
public MainLogic mainLogic;
void Start () {
}
// Update is called once per frame
void Update () {
if (movedirection.magnitude != 0 && (movedirection.x * (new Vector3(-2.2f, 0f, 0) - transform.position).x < 0 || movedirection.y * (new Vector3(-2.2f, 0f, 0) - transform.position).y < 0))
{
mainLogic.OnGodnessClicked();
Destroy(gameObject);
return;
}
movedirection = new Vector3(-2.2f, 0f, 0) - transform.position;
if (movedirection.magnitude == 0)
{
mainLogic.OnGodnessClicked();
Destroy(gameObject);
return;
}
transform.Translate(movedirection / movedirection.magnitude / 60);
}
}
fileFormatVersion: 2
guid: 8bd0448e20e4b854ebf4db72453a8f63
timeCreated: 1452865537
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class GameOverUI : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
public void ReturnIntro()
{
SceneManager.LoadScene("IntroScene");
}
}
fileFormatVersion: 2
guid: 4dbfded2c9172ba44b4c0b64ff272ba3
timeCreated: 1452858681
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
public class Hole : MonoBehaviour {
int level;
// Use this for initialization
void Start () {
level = 1;
}
// Update is called once per frame
void Update () {
}
public void SetPosition(int index)
{
if(index>4)
index++;
transform.position = new Vector3(Random.Range(-6.6f + 2.9f * (index % 3), -3.7f + 2.9f * (index % 3)), Random.Range(-4.8f + 3.2f * (index / 3), -1.6f + 3.2f * (index / 3)), 0);
}
}
fileFormatVersion: 2
guid: 4166d603f5d10f746af6f4f157e6820c
timeCreated: 1452870665
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
public class Intro : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
public void Exit()
{
Application.Quit();
}
public void StartGame()
{
Application.LoadLevel("GameScene");
}
}
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class Intro : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
public void Exit()
{
Application.Quit();
}
public void StartGame()
{
SceneManager.LoadScene("GameScene");
}
}
using UnityEngine;
using System.Collections;
public class MainLogic : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
public void OnGodnessClicked()
{
Application.LoadLevel("IntroScene");
}
}
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.SceneManagement;
public class MainLogic : MonoBehaviour {
public GameOverUI gameOverUI;
public MoneyManager moneyManager;
public Enemy EnemyObject;
public Hole HoleObject;
Hole[] Holes = new Hole[8];
float nextSpwnTime = 2f;
// Use this for initialization
void Start () {
StartCoroutine(GameLogic());
}
// Update is called once per frame
void Update () {
}
public void OnGodnessClicked()
{
gameOverUI.gameObject.SetActive(true);
}
public void Create()
{
int nowIndex = Random.Range(0, 8);
if(Holes[nowIndex] != null)
{
}
else
{
(Holes[nowIndex] = Instantiate<Hole>(HoleObject)).SetPosition(nowIndex);
moneyManager.holeMoney += 1000;
}
}
IEnumerator GameLogic()
{
while (gameOverUI.gameObject.activeSelf == false)
{
int direction = Random.Range(0, 4);
Enemy nowEnemy;
if (direction == 0)
(nowEnemy = Instantiate<Enemy>(EnemyObject)).transform.position = new Vector3(2.1f, Random.Range(-4.8f, 4.8f), 0);
else if (direction == 1)
(nowEnemy = Instantiate<Enemy>(EnemyObject)).transform.position = new Vector3(-6.5f, Random.Range(-4.8f, 4.8f), 0);
else if (direction == 2)
(nowEnemy = Instantiate<Enemy>(EnemyObject)).transform.position = new Vector3(Random.Range(-6.5f, 2.1f), -4.8f, 0);
else
(nowEnemy = Instantiate<Enemy>(EnemyObject)).transform.position = new Vector3(Random.Range(-6.5f, 2.1f), 4.8f, 0);
nowEnemy.mainLogic = this;
yield return new WaitForSeconds(nextSpwnTime);
}
}
}
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class MoneyManager : MonoBehaviour {
int maxMoney = 291000;
int nowMoney = 39393;
int baseMoneyDelta = 3939;
public int holeMoney = 0;
public int peopleMoney = 0;
int index = 0;
public Slider moneySlider;
public Text moneyText;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
index++;
int totalMoneyDelta = baseMoneyDelta - holeMoney - peopleMoney;
if (index > 50)
{
index = 0;
nowMoney += totalMoneyDelta;
baseMoneyDelta++;
}
moneySlider.value = (float)nowMoney / maxMoney;
if (baseMoneyDelta>0)
moneyText.text = nowMoney + "(+" + totalMoneyDelta + ")";
else
moneyText.text = nowMoney + "(" + totalMoneyDelta + ")";
}
}
fileFormatVersion: 2
guid: 837411e6788a4ef4ba323421a8a64175
timeCreated: 1452861407
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading;
public static class Util
{
}
\ No newline at end of file
fileFormatVersion: 2
guid: 264c2d1a86a3eb54c80bbe9d2a66fa07
timeCreated: 1452867996
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: c1990483aef559e4e8278a77f449bfff
timeCreated: 1452864126
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: 16
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 8
buildTargetSettings: []
spriteSheet:
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
m_EditorVersion: 5.1.2f1
m_EditorVersion: 5.3.1f1
m_StandardAssetsVersion: 0
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