ToVector2() public method

public ToVector2 ( ) : Vector2
return Vector2
Exemplo n.º 1
0
        public static Block Instantiate(BlockType type, Coor position)
        {
            var data = BlockDB._.Find(type);
            if (data == null)
            {
                Debug.LogError("Block for type not exists: " + type);
                return null;
            }

            var obj = (GameObject)GameObject.Instantiate(data.Prefab.gameObject, position.ToVector2(), Quaternion.identity);
            return obj.GetComponent<Block>();
        }
Exemplo n.º 2
0
        public static Block Instantiate(BlockType type, Coor position)
        {
            var data = BlockDB._.Find(type);

            if (data == null)
            {
                Debug.LogError("Block for type not exists: " + type);
                return(null);
            }

            var obj = (GameObject)GameObject.Instantiate(data.Prefab.gameObject, position.ToVector2(), Quaternion.identity);

            return(obj.GetComponent <Block>());
        }
Exemplo n.º 3
0
        public static Ball InstantiateBall(Coor position)
        {
            var go = (GameObject)GameObject.Instantiate(LevelDB._.Ball.gameObject, position.ToVector2(), Quaternion.identity);

            return(go.GetComponent <Ball>());
        }
Exemplo n.º 4
0
        public static Star InstantiateStar(Coor position)
        {
            var go = (GameObject)GameObject.Instantiate(LevelDB._.Star.gameObject, position.ToVector2(), Quaternion.identity);

            return(go.GetComponent <Star>());
        }
Exemplo n.º 5
0
 public static Star InstantiateStar(Coor position)
 {
     var go = (GameObject)GameObject.Instantiate(LevelDB._.Star.gameObject, position.ToVector2(), Quaternion.identity);
     return go.GetComponent<Star>();
 }
Exemplo n.º 6
0
 public static Ball InstantiateBall(Coor position)
 {
     var go = (GameObject)GameObject.Instantiate(LevelDB._.Ball.gameObject, position.ToVector2(), Quaternion.identity);
     return go.GetComponent<Ball>();
 }