예제 #1
0
    private void SelectModel()
    {
        Transform transform = null;
        Actor     actor     = null;

        if (this.TryCastRay(BillboardManager.GetDistanceOfAVC(31), LayerMask.GetMask(FollowCamera.LAYER_NPC), ref transform))
        {
            if (transform != null && transform.GetComponent <Actor>() != null)
            {
                actor = transform.GetComponent <Actor>();
            }
            if (actor != null)
            {
                EventDispatcher.Broadcast <Actor>(CameraEvent.SelectModel, actor);
                Debug.LogError(actor);
            }
        }
        else if (this.TryCastRay(BillboardManager.GetDistanceOfAVC(21), LayerMask.GetMask(FollowCamera.LAYER_PLAYER), ref transform))
        {
            if (transform != null && transform.GetComponent <Actor>() != null)
            {
                actor = transform.GetComponent <Actor>();
            }
            if (actor != null)
            {
                EventDispatcher.Broadcast <Actor>(CameraEvent.SelectModel, actor);
                Debug.LogError(actor);
            }
        }
    }
예제 #2
0
 private void DealOcclusion(ref Vector3 target_screen, ref Vector3 actor_screen)
 {
     if (EntityWorld.Instance.EntSelf == null)
     {
         return;
     }
     if (HeadInfoManager.Instance.SelfHeadInfoPosition == null)
     {
         return;
     }
     if (base.get_transform() == null)
     {
         return;
     }
     if (this.m_isOcclusionOn)
     {
         float num = Vector3.Distance(base.get_transform().get_position(), HeadInfoManager.Instance.SelfHeadInfoPosition.get_position());
         if (Mathf.Abs(num) > BillboardManager.GetDistanceOfAVC(this.m_actorType))
         {
             HeadInfoManager.Instance.show_control_normal(this.uuid, false);
             return;
         }
         if (EntityWorld.Instance.EntSelf.IsInBattle)
         {
             if (actor_screen.z - target_screen.z >= 5f)
             {
                 HeadInfoManager.Instance.show_control_normal(this.uuid, false);
             }
             else if (actor_screen.z - target_screen.z <= 4f)
             {
                 HeadInfoManager.Instance.show_control_normal(this.uuid, true);
             }
         }
         else if (actor_screen.z - target_screen.z >= 5f)
         {
             HeadInfoManager.Instance.show_control_normal(this.uuid, false);
         }
         else if (actor_screen.z - target_screen.z <= 4f)
         {
             HeadInfoManager.Instance.show_control_normal(this.uuid, true);
         }
     }
     else
     {
         HeadInfoManager.Instance.show_control_normal(this.uuid, true);
     }
 }
예제 #3
0
 private void UpdateShow(bool isInited = false)
 {
     if (EntityWorld.Instance.ActSelf == null)
     {
         return;
     }
     if (EntityWorld.Instance.EntSelf.IsInBattle)
     {
         return;
     }
     if (CamerasMgr.CameraMain == null)
     {
         return;
     }
     if (!CamerasMgr.CameraMain.get_enabled())
     {
         if (isInited)
         {
             this.ShowByDistance(false, true);
         }
         return;
     }
     if (this.m_objType == 22)
     {
         this.ShowByDistance(ActorVisibleManager.Instance.IsShow(this.ownerId), isInited);
     }
     else
     {
         Vector3 vector  = CamerasMgr.CameraMain.WorldToScreenPoint(base.get_transform().get_position());
         Vector3 vector2 = CamerasMgr.CameraMain.WorldToScreenPoint(EntityWorld.Instance.ActSelf.FixTransform.get_position());
         if (Vector3.Distance(base.get_transform().get_position(), EntityWorld.Instance.ActSelf.FixTransform.get_position()) > BillboardManager.GetDistanceOfAVC(this.m_objType))
         {
             this.ShowByDistance(false, isInited);
         }
         else if (vector2.z - vector.z >= 6f)
         {
             this.ShowByDistance(false, isInited);
         }
         else if (vector2.z - vector.z <= 5f)
         {
             this.ShowByDistance(true, isInited);
         }
     }
 }