API
|
|
AltCollider.AltCollisionEnter
public void AltCollisionEnter(AltCollisionInfo collisInfo);
Description
AltCollisionEnter is called when OnCollisionEnter event is come.
Example:
// Attach this script to an object with AltTrees Manager!
using UnityEngine;
using AltSystems.AltTrees;
public class ExampleCollisions : MonoBehaviour
{
void AltCollisionEnter(AltCollisionInfo collisInfo)
{
Debug.Log("AltCollisionEnter");
collisInfo.treeInfo.widthScale = Random.value * 2f + 0.5f;
collisInfo.treeInfo.heightScale = Random.value * 2f + 0.5f;
collisInfo.treeInfo.color = new Color(Random.value, Random.value, Random.value, Random.value * 0.3f);
collisInfo.treeInfo.patch.altTrees.editTree(collisInfo.treeInfo, false);
}
void AltCollisionExit(AltCollisionInfo collisInfo)
{
Debug.Log("AltCollisionExit");
}
void AltCollisionStay(AltCollisionInfo collisInfo)
{
Debug.Log("AltCollisionStay");
}
}
|