Browse Source

Mainscene added

Sun added
master
MB 5 years ago
parent
commit
846f898d2d
5 changed files with 1165 additions and 14 deletions
  1. +1099
    -0
      Assets/MainScene.unity
  2. +7
    -0
      Assets/MainScene.unity.meta
  3. +1
    -14
      Assets/Scipts/GameMode.cs
  4. +47
    -0
      Assets/Scipts/Timer.cs
  5. +11
    -0
      Assets/Scipts/Timer.cs.meta

+ 1099
- 0
Assets/MainScene.unity
File diff suppressed because it is too large
View File


+ 7
- 0
Assets/MainScene.unity.meta View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9d7efa2ba161d6a4d9b3be077aa13eb5
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 1
- 14
Assets/Scipts/GameMode.cs View File

@ -15,24 +15,11 @@ public class GameMode : MonoBehaviour {
float maxX = 0; float maxX = 0;
float minZ = 0; float minZ = 0;
float maxZ = 0; float maxZ = 0;
//Time stuff
public float MaxTimer = 120.0f;
float Timer = 0.0f;
void Start()
{
Timer = MaxTimer;
}
void Update() void Update()
{ {
//Handle timer
Timer -= 1.0f * Time.deltaTime;
if (Timer <= 0.0f)
{
//Game Lose code here
}
//Check for win condition //Check for win condition
minX = Players[0].transform.position.x; minX = Players[0].transform.position.x;
maxX = minX; maxX = minX;

+ 47
- 0
Assets/Scipts/Timer.cs View File

@ -0,0 +1,47 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Timer : MonoBehaviour {
//Time stuff
public float MaxTimer = 120.0f;
float curTime = 0.0f;
public Transform Pivot;
public Transform Sun;
float curRot = 0;
public Color Dawn;
public Color Noon;
void Start()
{
Sun.gameObject.GetComponent<Image>().Color = Dawn;
}
void Update () {
curTime += 1.0f * Time.deltaTime;
if (curTime >= MaxTimer)
{
//Game Lose code here
}
/*
//Move the sun
float reqRot = (curTime / MaxTimer) * 180;
if (reqRot > 180)
{
reqRot = 180;
}
if (reqRot > curRot)
{
float rotDistance = reqRot - curRot;
// Sun.RotateAround(Pivot.transform.position, Sun.transform.forward, rotDistance);
curRot = reqRot;
}
*/
Sun.RotateAround(Pivot.transform.position, -1 * Sun.transform.forward, (180 / MaxTimer) * Time.deltaTime);
}
}

+ 11
- 0
Assets/Scipts/Timer.cs.meta View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e5bac63f71362b54fb8639d7ed682724
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Loading…
Cancel
Save