public void init(int tileType, BoardManager board) { this.board = board; turnCount = 0; tileObj = GameObject.CreatePrimitive(PrimitiveType.Quad); tileMod = tileObj.AddComponent<TileModel>(); tileMod.init(this, type); }
public void addCloud(bool isRainy) { if (type == AIR && !hasCloud) { hasCloud = true; var modelObject2 = GameObject.CreatePrimitive(PrimitiveType.Quad); extraTileModel = modelObject2.AddComponent <TileModel> (); if (isRainy) { extraTileModel.init(this, TileModel.RAIN_CLOUD_MODEL); } else { extraTileModel.init(this, TileModel.CLOUD_MODEL); } } }
public void init(int tileType, BoardManager board) { this.board = board; turnCount = 0; tileObj = GameObject.CreatePrimitive(PrimitiveType.Quad); tileMod = tileObj.AddComponent <TileModel>(); tileMod.init(this, type); }
public void init(int tile_type) { this.tile_type = tile_type; GameObject modelObject = GameObject.CreatePrimitive(PrimitiveType.Quad); model = modelObject.AddComponent<TileModel>(); model.init(tile_type, this); orientation = Quaternion.Euler(0f, 0f, (orientation.eulerAngles.z - (90f*Random.Range(0, 4))) % 360f); transform.localRotation = orientation; }
public void addTurn(){ this.tiletype = 2; turn = true; S = true; E = true; var modelObject2 = GameObject.CreatePrimitive (PrimitiveType.Quad); model2 = modelObject2.AddComponent<TileModel> (); model2.init (x, y, 2, this, modelObject2); }
public void init(int tile_type) { this.tile_type = tile_type; GameObject modelObject = GameObject.CreatePrimitive(PrimitiveType.Quad); model = modelObject.AddComponent <TileModel>(); model.init(tile_type, this); orientation = Quaternion.Euler(0f, 0f, (orientation.eulerAngles.z - (90f * Random.Range(0, 4))) % 360f); transform.localRotation = orientation; }
private bool hasTower; // if a tower has been placed public void init(int x, int y, GameManager m) { manager = m; hasTower = false; var modelObject = GameObject.CreatePrimitive(PrimitiveType.Quad); // create quad modelObject.SetActive(true); // makes sure the quad is being displayed model = modelObject.AddComponent <TileModel>(); // add TileModel script to quad model.transform.parent = this.transform; // make it the child of the Tile object model.transform.localPosition = new Vector3(0, 0, 0); // position relative to global coords model.init(this); }
public void init(int coordX, int coordY, float realX, float realY, Controller c) { this.coordX = coordX; this.coordY = coordY; this.realX = realX; this.realY = realY; controller = c; contains = NOTHING; hasCloud = false; collider = this.gameObject.AddComponent <CircleCollider2D> (); collider.radius = Mathf.Sqrt(3) / 4f - 0.05f; collider.isTrigger = true; var modelObject = GameObject.CreatePrimitive(PrimitiveType.Quad); model = modelObject.AddComponent <HexModel> (); model.init(this); hex_edges = new ArrayList(); branches_leaving = new ArrayList(); occupied = false; //rootSounds = new ArrayList (controller.audioM.root1, controller.audioM.root2, controller.audioM.root3, // controller.audioM.root4, controller.audioM.root5, controller.audioM.root6, controller.audioM.root7, // controller.audioM.root8, controller.audioM.root9, controller.audioM.root10, controller.audioM.root11, // controller.audioM.root12); if (coordY < 0) { type = GROUND; this.gameObject.tag = "ground_hex"; var modelObject2 = GameObject.CreatePrimitive(PrimitiveType.Quad); tileModel = modelObject2.AddComponent <TileModel> (); tileModel.init(this, TileModel.GROUND_MODEL); } else { type = AIR; this.gameObject.tag = "air_hex"; } }
public void init(int type, int boardx, int boardy) { //determine the type, make the correct quad, add quad to currentMarbles, build the dictionary map whatever thing for outward direction this.type = type; source = GetComponent <AudioSource>(); getOutward = new Dictionary <int, int>(); boardPosition = new Vector2(boardx, boardy); GameObject modelObject; parent = GameObject.Find("MarbleManager").GetComponent <MarbleManager>();; currentMarbles = new List <Marble>(); hasGem = false; if (type == 0) { modelObject = GameObject.CreatePrimitive(PrimitiveType.Quad); // Create a quad object for holding the gem texture. out1 = 7; out2 = out1; } else if (type == 2) { modelObject = GameObject.CreatePrimitive(PrimitiveType.Quad); out1 = -1; out2 = out1; } else { modelObject = new GameObject(); out1 = 1; out2 = 2; //make a new child with two quads and a script for controlling the quads } //tileModel.init(type, position, owner) populateOutward(); model = modelObject.AddComponent <TileModel>(); model.init(type, this); }
public void addPit(){ this.tiletype = 3; pit = true; var modelObject2 = GameObject.CreatePrimitive (PrimitiveType.Quad); modelObject2.tag = "pit"; model2 = modelObject2.AddComponent<TileModel> (); MeshCollider mc = modelObject2.GetComponent<MeshCollider> (); mc.enabled = false; BoxCollider bc = modelObject2.AddComponent<BoxCollider> (); bc.size = new Vector3(.1f, .1f, 3); Rigidbody rb = modelObject2.AddComponent<Rigidbody> (); rb.useGravity = false; rb.isKinematic = false; model2.init (x, y, 3, this, modelObject2); }
public void addEmptyTexture(){ var modelObject1 = GameObject.CreatePrimitive (PrimitiveType.Quad); model1 = modelObject1.AddComponent<TileModel> (); model1.init (x, y, 1, this, modelObject1); }