public Wall(int x, int y, int unit, MultiWallScript.Mode topMode, MultiWallScript.Mode rightMode, MultiWallScript.Mode bottomMode, MultiWallScript.Mode leftMode)
    {
        X = x;
        Y = y;
        Unit = unit;
        var instance = Resources.Load("Prefabs/wallSegment") as GameObject;
        gameObject = (GameObject)Object.Instantiate(instance, new Vector3(y * unit, 0, -x * unit), Quaternion.identity);
        gameObject.transform.rotation = instance.transform.rotation;

        sides = gameObject.GetComponent<MultiWallScript>();
        sides.Top = topMode;
        sides.Right = rightMode;
        sides.Bottom = bottomMode;
        sides.Left = leftMode;
    }
Esempio n. 2
0
    public Wall(int x, int y, int unit, MultiWallScript.Mode topMode, MultiWallScript.Mode rightMode, MultiWallScript.Mode bottomMode, MultiWallScript.Mode leftMode)
    {
        X    = x;
        Y    = y;
        Unit = unit;
        var instance = Resources.Load("Prefabs/wallSegment") as GameObject;

        gameObject = (GameObject)Object.Instantiate(instance, new Vector3(y * unit, 0, -x * unit), Quaternion.identity);
        gameObject.transform.rotation = instance.transform.rotation;

        sides        = gameObject.GetComponent <MultiWallScript>();
        sides.Top    = topMode;
        sides.Right  = rightMode;
        sides.Bottom = bottomMode;
        sides.Left   = leftMode;
    }