public void InitRender() { Rends = new Dictionary <string, Renderer>(); TileSet MyTile = Core_Base.F_GetTileByID(Prm.TileID); if (MyTile == null) { Debug.Log("NOTILE"); return; } LF_RenewSides(); BaseRend.sprite = MyTile.Center[Prm.C]; BaseRend.sortingOrder = Layer * 10; if (Prm.L >= 0) { AddSprite(MyTile.Left[Prm.L], "L", 2 + Layer * 10); } if (Prm.R >= 0) { AddSprite(MyTile.Right[Prm.R], "R", 2 + Layer * 10); } if (Prm.D >= 0) { AddSprite(MyTile.Down[Prm.D], "D", 1 + Layer * 10); } if (Prm.U >= 0) { AddSprite(MyTile.Up[Prm.U], "U", 3 + Layer * 10); } }
public void F_ChangeTileID(string ID) { Debug.Log("ChanegingID"); TileSet wrk = Core_Base.F_GetTileByID(ID); TileID = ID; BlockSiz = wrk.TileSize; F_ShowGeom(); }
public void F_AddGroup() { Lvl_BlockGroup n1 = GameObject.Instantiate(GroupPrefab).transform.GetComponent <Lvl_BlockGroup>(); n1.transform.position = ViewPoint.transform.position; n1.transform.parent = LevelRoot; n1.F_SetTile(Core_Base.F_GetTileByID(GroupTileID)); SetActiveGrp(n1); }
void LF_RenewSides() { TileSet wrk = Core_Base.F_GetTileByID(Prm.TileID); if (Prm.C > wrk.Center.Count - 1 || !Prm.Lock) { Prm.C = Random.Range(0, wrk.Center.Count); } if (Prm.R >= 0) { if (Prm.R > wrk.Right.Count - 1 || !Prm.Lock) { Prm.R = Random.Range(0, wrk.Right.Count); } } if (Prm.L >= 0) { if (Prm.L > wrk.Left.Count - 1 || !Prm.Lock) { Prm.L = Random.Range(0, wrk.Left.Count); } } if (Prm.D >= 0) { if (Prm.D > wrk.Down.Count - 1 || !Prm.Lock) { Prm.D = Random.Range(0, wrk.Down.Count); } } if (Prm.U >= 0) { if (Prm.U > wrk.Up.Count - 1 || !Prm.Lock) { Prm.U = Random.Range(0, wrk.Up.Count); } } }
// Start is called before the first frame update void Start() { M = this; }