Permalink
Browse files

refractored, added colour in inspector, created demo scene

  • Loading branch information...
GandhiGames committed Nov 22, 2016
1 parent 1c2f079 commit 0a7b843406b937fb282a914639d00f7c18fc22cd
Showing 784 changed files with 406 additions and 243 deletions.

This file was deleted.

Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
@@ -0,0 +1,55 @@
using UnityEngine;
using System.Collections;
public class Demo_Grid : MonoBehaviour {
public Grid grid;
[Header("Explosive")]
public float explosiveForce = 2f;
public float explosiveRadius = 2f;
[Header("Implosive")]
public float implosiveForce = 2f;
public float implosiveRadius = 2f;
[Header("Directional")]
public float directionalForce = 2f;
public float directionalRadius = 2f;
void Update () {
if(Input.GetMouseButtonUp(0))
{
grid.ApplyExplosiveForce(explosiveForce, Camera.main.ScreenToWorldPoint(Input.mousePosition), explosiveRadius);
}
else if(Input.GetMouseButtonUp(1))
{
grid.ApplyImplosiveForce(implosiveForce, Camera.main.ScreenToWorldPoint(Input.mousePosition), implosiveRadius);
}
var direction = Vector2.zero;
if(Input.GetKeyUp(KeyCode.LeftArrow))
{
direction = Vector2.left;
}
else if (Input.GetKeyUp(KeyCode.DownArrow))
{
direction = Vector2.down;
}
else if (Input.GetKeyUp(KeyCode.RightArrow))
{
direction = Vector2.right;
}
else if (Input.GetKeyUp(KeyCode.UpArrow))
{
direction = Vector2.up;
}
if (direction != Vector2.zero)
{
grid.ApplyDirectedForce(direction * directionalForce, Vector3.zero, directionalRadius);
}
}
}
Oops, something went wrong.

0 comments on commit 0a7b843

Please sign in to comment.