Esempio n. 1
0
    public void CreateNewPylon(Vector3 pos, bool dome)
    {
        if (firstTreeGrown == false)
        {
            firstTreeGrown = true;
            Services.EventManager.Fire(new FirstTreeGrown());
        }
        RaycastHit hit;

        if (Physics.Raycast(pos, -Vector3.up, out hit))
        {
            texEdit.PaintCircle(hit.textureCoord, dome ? Services.GameController.domePylonRadius : Services.GameController.pylonRadius);
        }
        pylonPositions.Add(pos);
    }
Esempio n. 2
0
    void Start()
    {
        RaycastHit hit;

        if (Physics.Raycast(transform.position, -Vector3.up, out hit))
        {
            Canvas    = hit.transform.gameObject;
            textCoord = hit.textureCoord;
        }
        else
        {
            print("F**K");
        }
        texE     = Canvas.GetComponent <TextureEditor>();
        alphaTex = (Texture2D)Canvas.GetComponent <Renderer>().material.GetTexture("_SplatTex");

        textCoord = textCoord * alphaTex.width;

        texE.FillTexture();
        texE.PaintCircle(textCoord, 50);
    }