API


 

AltCollider.getCollisionInfo
 

public AltCollisionInfo getCollisionInfo();

Description


Get collision and tree(or object) information.

 

Example:

using UnityEngine;
using AltSystems.AltTrees;

public class Example : MonoBehaviour
{
    public AltTrees manager;
    public Camera cam;

    RaycastHit hit;
    Ray ray;

    void Start()
    {
    
    }
    
    void Update()
    {
        if (Input.GetMouseButtonDown(0) && manager.isInitialized)
        {
            ray = cam.ScreenPointToRay(Input.mousePosition);

            if (Physics.Raycast(ray, out hit))
            {
                AltCollider altC = hit.transform.GetComponent
();
                if (altC != null)
                {
                    AltCollisionInfo acInf = altC.getCollisionInfo();
                    if (acInf != null)
                    {
                        acInf.treeInfo.patch.altTrees.removeTrees(acInf, false);
                    }
                }
            }
        }

    }
}