mirror of
https://github.com/mixandjam/Splatoon-Ink.git
synced 2026-03-21 17:25:34 -05:00
18 lines
490 B
C#
18 lines
490 B
C#
using UnityEngine;
|
|
|
|
public class CollisionPainter : MonoBehaviour{
|
|
public Color paintColor;
|
|
|
|
public float radius = 1;
|
|
public float strength = 1;
|
|
public float hardness = 1;
|
|
|
|
private void OnCollisionStay(Collision other) {
|
|
Paintable p = other.collider.GetComponent<Paintable>();
|
|
if(p != null){
|
|
Vector3 pos = other.contacts[0].point;
|
|
PaintManager.instance.paint(p, pos, radius, hardness, strength, paintColor);
|
|
}
|
|
}
|
|
}
|