public void set_curve(int X, int Y, Common.Direction entrance, Common.Direction exit) { x = X; y = Y; move_from = entrance; move_to = exit; }
public Common.Direction Curve_direction(Common.Direction entrance)//どこから入ったらどう曲がるか、(使わなければ消す) { Common.Direction curve = Common.Direction.None; if (type == Common.Direction.Straight)//まっすぐ { curve = Common.Direction.Straight; } else if (type == Common.Direction.Right)//右 { if (entrance == Common.Direction.Down || entrance == Common.Direction.Up) { curve = Common.Direction.Right; } else if (entrance == Common.Direction.Right || entrance == Common.Direction.Left) { curve = Common.Direction.Left; } } else if (type == Common.Direction.Left)//左 { if (entrance == Common.Direction.Down || entrance == Common.Direction.Up) { curve = Common.Direction.Left; } else if (entrance == Common.Direction.Right || entrance == Common.Direction.Left) { curve = Common.Direction.Right; } } return(curve); }
public void back() { Debug.Log("back"); Common.Direction tmp = move_from; move_from = move_to; move_to = tmp; count = (int)speed - count; }
public void Copy(Data_box original) { Set_address(original.x, original.y); this.type = original.type; this.condition = original.condition; this.treasure = original.treasure; this.walk = original.walk; }
public void Refresh() { if (BaseItem.direction != _oldDirection || BaseItem.state != _oldState) { this.Clear(); this.UpdateRenderQuads(); _oldDirection = BaseItem.direction; _oldState = BaseItem.state; } }
public void SetTeamIndex(int index) { if (index == 0) { direction = Common.Direction.right; } else { direction = Common.Direction.left; } }
/// <summary> /// Sets the angle. /// </summary> /// <param name="angle">Angle.</param> public void SetAngle(float angle) { Common.Direction direction = Common.Direction.BOTTOM_RIGHT; float minAnge = 999; foreach (KeyValuePair <float, Common.Direction> entry in this._angleToDirectionMap) { float a = Mathf.Abs(angle - entry.Key); if (a < minAnge) { minAnge = a; direction = entry.Value; } } this.SetDirection(direction); }
public void Set_img(Common.Direction img_type)//形を入れたらデータを作る { if (time) { obj.GetComponent <SpriteRenderer>().sprite = Red_sprites[(int)img_type]; } else { obj.GetComponent <SpriteRenderer>().sprite = sprites[(int)img_type]; } if (img_type == Common.Direction.Down) { Layer(15); Sprite().color = new Color(1, 1, 1, 1); } }
public Common.Direction Exit_direction(Common.Direction entrance)//どこから入ったらどこに出るか { Common.Direction exit = Common.Direction.None; if (type == Common.Direction.Straight)//まっすぐ { exit = reverse(entrance); } else if (type == Common.Direction.Right)//右 { if (entrance == Common.Direction.Down) { exit = Common.Direction.Right; } else if (entrance == Common.Direction.Up) { exit = Common.Direction.Left; } else if (entrance == Common.Direction.Right) { exit = Common.Direction.Down; } else if (entrance == Common.Direction.Left) { exit = Common.Direction.Up; } } else if (type == Common.Direction.Left)//左 { if (entrance == Common.Direction.Down) { exit = Common.Direction.Left; } else if (entrance == Common.Direction.Up) { exit = Common.Direction.Right; } else if (entrance == Common.Direction.Right) { exit = Common.Direction.Up; } else if (entrance == Common.Direction.Left) { exit = Common.Direction.Down; } } return(exit); }
public TextureData GetTextureData(Common.Direction direction) { TextureData textureData = null; switch (direction) { case Common.Direction.BOTTOM: textureData = bottomTexture; break; case Common.Direction.BOTTOM_RIGHT: textureData = bottomRightTexture; break; case Common.Direction.RIGHT: textureData = rightTexture; break; case Common.Direction.TOP_RIGHT: textureData = topRightTexture; break; case Common.Direction.TOP: textureData = topTexture; break; case Common.Direction.TOP_LEFT: textureData = topRightTexture; break; case Common.Direction.LEFT: textureData = rightTexture; break; case Common.Direction.BOTTOM_LEFT: textureData = bottomRightTexture; break; } if (textureData.texture == null) { textureData = bottomTexture; } return(textureData); }
private SpriteCollection.TextureData[] _GetCurrentImageLayers() { List <SpriteCollection.TextureData> layers = new List <SpriteCollection.TextureData>(); Common.State state = BaseItem.state; Common.Direction direction = BaseItem.direction; List <int> spriteIds = BaseItem.itemData.GetSprites(state); if (spriteIds == null || spriteIds.Count == 0) { return(null); } for (int index = 0; index < spriteIds.Count; index++) { SpriteCollection.SpriteData sprite = Sprites.GetSprite(spriteIds[index]); layers.Add(sprite.GetTextureData(direction)); } return(layers.ToArray()); }
public Common.Direction reverse(Common.Direction direct)//逆向き化 { if (direct == Common.Direction.Down) { return(Common.Direction.Up); } else if (direct == Common.Direction.Up) { return(Common.Direction.Down); } else if (direct == Common.Direction.Right) { return(Common.Direction.Left); } else if (direct == Common.Direction.Left) { return(Common.Direction.Right); } else { return(Common.Direction.None); } }
public Vector3 Dire_to_Vec(Common.Direction d)//ベクトル化 { if (d == Common.Direction.Up) { return(new Vector3(0, 1, 0)); } else if (d == Common.Direction.Down) { return(new Vector3(0, -1, 0)); } else if (d == Common.Direction.Right) { return(new Vector3(1, 0, 0)); } else if (d == Common.Direction.Left) { return(new Vector3(-1, 0, 0)); } else { return(new Vector3(0, 0, 0)); } }
/// <summary> /// Sets the direction. /// </summary> /// <param name="direction">Direction.</param> public void SetDirection(Common.Direction direction) { this.direction = direction; this.UpdateConnectedItems(); }
public void set_position(int X, int Y, Common.Direction entrance, Common.Direction exit) { set_curve(X, Y, entrance, exit); obj.transform.position = new Vector3(X, Y, 0) + Dire_to_Vec(entrance) / 2f; }