public override void SetCollisionHandler(CollisionHandler collisionHandler) { this.collisionHandler = collisionHandler; if (collisionHandler) { if (collisionHandler.item) { if (!(module as EffectModulePaint).allowItem) { Despawn(); return; } } else if (collisionHandler.ragdollPart) { if (!(module as EffectModulePaint).allowRagdollPart) { Despawn(); return; } } else { Despawn(); return; } } else { Despawn(); return; } }
public override void SetCollisionHandler(CollisionHandler collisionHandler) { if (collisionHandler) { if (collisionHandler.item) { if (!(module as EffectModuleDecal).allowItem || !collisionHandler.item.data.allowDecals) { Despawn(); return; } meshRenderer.material.SetInt("_StencilRef", collisionHandler.item.stencilReference); } else if (collisionHandler.ragdollPart && !collisionHandler.ragdollPart.ragdoll.creature.body.player) { if (!(module as EffectModuleDecal).allowRagdollPart) { Despawn(); return; } meshRenderer.material.SetInt("_StencilRef", collisionHandler.ragdollPart.ragdoll.creature.stencilReference); } else { meshRenderer.material.SetInt("_StencilRef", 0); } } else { meshRenderer.material.SetInt("_StencilRef", 0); } }
public override void Despawn() { CancelInvoke(); #if ProjectCore collisionHandler = null; if (Application.isPlaying) { EffectModulePaint.Despawn(this); InvokeDespawnCallback(); } #endif }
protected void Start() { collisionHandler = this.GetComponentInParent <CollisionHandler>(); }
public virtual void SetCollisionHandler(CollisionHandler collisionHandler) { }