// Use this for initialization void Start() { actor = GetComponent <Actor>(); player = this.gameObject; trans = player.transform; //head = GameObject.Find("Head").transform; rigbody = GetComponent <Rigidbody>(); rigbody.useGravity = false; rigbody.freezeRotation = true; //cam = Camera.main; wM = GameObject.Find("WorldManager").GetComponent <WorldManager>(); aW = wM.activeWorld; trans.position = aW.tiles[spawnTile].hexagon.center; //origin = new Vector3(aW.origin.x, aW.origin.y, aW.origin.z); animator = player.GetComponent <Animator>(); animator.enabled = true; animator.Play("Idle"); onTile = spawnTile; //runehex test byte[] testID = new byte[32] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }; List <int> testCast = aW.GetTilesInRadius(1, onTile); runeHex = new Rune(testID).runeHex; runeHex.Initialize(testCast); //move = false; //cast = true; }
public Rune(byte[] id) { ID = id; tile = new Tile(0, 0); foreach (byte b in ID) { UnityEngine.Random.InitState((int)b); tile.uvx += UnityEngine.Random.Range(-20, 20); tile.uvy += UnityEngine.Random.Range(-20, 20); } tile.uvx = Mathf.Abs(tile.uvx % 16) + 1; type = (TileType)tile.uvx; tile.uvy = Mathf.Abs(tile.uvy % 16) + 5; glyph = tile.uvy; //determine runehex //waterattacki test type = TileType.Water; glyph = 5; switch (type) { case 0: break; case TileType.Water: switch (glyph) { case 5: runeHex = new WaterAttackI(); runeHex.Initialize(); break; } break; } }
// Use this for initialization void Start() { actor = GetComponent <Actor>(); player = this.gameObject; trans = player.transform; //head = GameObject.Find("Head").transform; rigbody = GetComponent <Rigidbody>(); rigbody.useGravity = false; rigbody.freezeRotation = true; cam = Camera.main; wM = GameObject.Find("WorldManager").GetComponent <WorldManager>(); aW = wM.activeWorld; trans.position = aW.tiles[spawnTile].hexagon.center; origin = new Vector3(aW.origin.x, aW.origin.y, aW.origin.z); animator = player.GetComponent <Animator>(); animator.enabled = true; animator.Play("Idle"); //runehex test runeHex = new WaterAttackI(); runeHex.Initialize(); //move = false; //cast = true; }
public Rune(byte[] id) { ID = id; tile = new Tile(0, 0); foreach (byte b in ID) { //randomize initializations UnityEngine.Random.InitState((int)b); float castDensity = tile.uvx += UnityEngine.Random.Range(-20, 20); tile.uvy += UnityEngine.Random.Range(-20, 20); if (UnityEngine.Random.Range(0, 1f) > castDensity) { } } tile.uvx = Mathf.Abs(tile.uvx % 16) + 1; type = (TileType)tile.uvx; tile.uvy = Mathf.Abs(tile.uvy % 16) + 5; glyph = tile.uvy; //determine runehex //waterattacki test type = TileType.Water; glyph = 5; switch (type) { case 0: break; case TileType.Water: switch (glyph) { case 5: runeHex = new WaterBurstI(); runeHex.Initialize(tileTargets); break; } break; } }