init
This commit is contained in:
commit
fca6784fe7
571 changed files with 84105 additions and 0 deletions
71
Assets/Scripts/Overworld/Grid.cs
Normal file
71
Assets/Scripts/Overworld/Grid.cs
Normal file
|
@ -0,0 +1,71 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Grid : MonoBehaviour{
|
||||
|
||||
public bool empty = false;
|
||||
|
||||
[HideInInspector] public int index;
|
||||
|
||||
[System.Serializable] public enum Enemy { Oso, Driada, Loca }
|
||||
public Enemy enemy;
|
||||
|
||||
[Space]
|
||||
public bool isBoss = false;
|
||||
public bool unlocked;
|
||||
public bool connected;
|
||||
|
||||
[Space]
|
||||
public Grid upGrid;
|
||||
public Grid downGrid;
|
||||
public Grid leftGrid;
|
||||
public Grid rightGrid;
|
||||
|
||||
[Space]
|
||||
public Grid upPathToUnlock;
|
||||
public Grid downPathToUnlock;
|
||||
public Grid leftPathToUnlock;
|
||||
public Grid rightPathToUnlock;
|
||||
|
||||
BoxCollider2D boxCollider;
|
||||
|
||||
void Awake(){
|
||||
float range = Random.Range(0f, 300f);
|
||||
if(range < 100f){
|
||||
enemy = Enemy.Oso;
|
||||
}else if(range >= 100f && range < 200f){
|
||||
enemy = Enemy.Driada;
|
||||
}else{
|
||||
enemy = Enemy.Loca;
|
||||
}
|
||||
|
||||
boxCollider = GetComponent<BoxCollider2D>();
|
||||
}
|
||||
|
||||
public void UpdateEnemies(Enemy enemyType){
|
||||
enemy = enemyType;
|
||||
}
|
||||
|
||||
public void Connect(){
|
||||
|
||||
}
|
||||
|
||||
void Update(){
|
||||
if (unlocked){
|
||||
boxCollider.enabled = false;
|
||||
if(upPathToUnlock != null){
|
||||
upGrid = upPathToUnlock;
|
||||
}
|
||||
if (downPathToUnlock != null){
|
||||
downGrid = downPathToUnlock;
|
||||
}
|
||||
if (leftPathToUnlock != null){
|
||||
leftGrid = leftPathToUnlock;
|
||||
}
|
||||
if (rightPathToUnlock != null){
|
||||
rightGrid = rightPathToUnlock;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue