码迷,mamicode.com
首页 > 其他好文 > 详细

最近想写一个类似鬼泣 收集红魂的功能,陆续写点东西作为笔记

时间:2016-02-12 18:39:09      阅读:258      评论:0      收藏:0      [点我收藏+]

标签:

OnComponentBeginOverlap事件

当物体有碰撞体,同事碰撞类型设置为OverlapAll时,会触发,同时角色不会被挡住。

这是文档中的OnComponentBeginOverlap的案例代码

  // set up a notification for when this component overlaps something  
    CollisionSphere->OnComponentBeginOverlap.AddDynamic(this, &ALightSwitchCodeOnly::OnOverlapBegin);  


void ALightSwitchCodeOnly::OnOverlapBegin(class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)  
{  
    // Other Actor is the actor that triggered the event. Check that is not ourself.  
    if ( (OtherActor != nullptr ) && (OtherActor != this) && ( OtherComp != nullptr ) )  
    {  
        // Turn off the light  
        PointLight->SetVisibility(false);  
    }  
}  

 

最近想写一个类似鬼泣 收集红魂的功能,陆续写点东西作为笔记

标签:

原文地址:http://www.cnblogs.com/blueroses/p/5187174.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!