예제 #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
    public void AddBubbleDialogue(Transform actorRoot, float height, long uuid)
    {
        if (!SystemConfig.IsBillboardOn)
        {
            return;
        }
        this.RemoveBubbleDialogue(uuid, actorRoot);
        BubbleDialogueUnit bubbleDialogueUnit = this.Create2BubbleDialogue(actorRoot, height, uuid);

        bubbleDialogueUnit.SetUUID(uuid);
        bubbleDialogueUnit.SetTargetPositionNode(BillboardManager.AddHeadInfoPosition(actorRoot, height));
    }
예제 #3
0
    public static Transform AddHeadInfoPosition(Transform actorRoot, float height)
    {
        Transform transform = actorRoot.FindChild(BillboardManager.HeadInfoPositionName);

        if (transform == null)
        {
            GameObject gameObject = new GameObject(BillboardManager.HeadInfoPositionName);
            gameObject.get_transform().set_parent(actorRoot);
            transform = gameObject.get_transform();
            transform.set_localPosition(new Vector3(0f, BillboardManager.GetRealHeight(height), 0f));
        }
        return(transform);
    }
예제 #4
0
    private HeadInfoControl AddControl(Transform parent, float height, long uuid, Transform ui, int actorType, bool avc_control)
    {
        Transform       transform       = BillboardManager.AddHeadInfoPosition(parent, height);
        HeadInfoControl headInfoControl = transform.get_gameObject().AddMissingComponent <HeadInfoControl>();

        headInfoControl.uuid         = uuid;
        headInfoControl.m_isInAVC    = avc_control;
        headInfoControl.m_headInfoUI = ui;
        headInfoControl.m_actorType  = actorType;
        headInfoControl.set_enabled(true);
        this.m_controls.Add(headInfoControl);
        return(headInfoControl);
    }
예제 #5
0
    private static void CreatePools()
    {
        Transform transform = new GameObject("Pool2BubbleDialogue").get_transform();

        transform.set_parent(UINodesManager.NoEventsUIRoot);
        transform.SetAsLastSibling();
        transform.get_gameObject().set_layer(LayerSystem.NameToLayer("UI"));
        BubbleDialogueManager.Pool2BubbleDialogue = transform;
        UGUITools.ResetTransform(BubbleDialogueManager.Pool2BubbleDialogue);
        BubbleDialogueManager.BubbleDialoguePool = new UIPool("BubbleDialogueUnit", BubbleDialogueManager.Pool2BubbleDialogue, false);
        TimerHeap.AddTimer(10000u, 2500, delegate
        {
            BillboardManager.ResortOfZ(BubbleDialogueManager.BubbleDialoguePool);
        });
    }
예제 #6
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);
     }
 }
예제 #7
0
 public static void Init(Action callback)
 {
     CombatFrequeny             = GlobalData.dataMap[0].CombatFrequeny;
     CombatNumberInSecond       = (1 / CombatFrequeny);
     BuildingReversionFrequency = GlobalData.dataMap[0].BuildingReversionFrequency;
     BuildingReversionEnergy    = GlobalData.dataMap[0].BuildingReversionEnergy;
     AttackStarFrequeny         = GlobalData.dataMap[0].AttackStarFrequeny;
     //AttackStarEnergy = GlobalData.dataMap[0].AttackStarEnergy;
     GameTime         = GlobalData.dataMap[0].GameTime;
     m_sceneManager   = new ScenesManager();
     m_findServer     = new FindServer();
     m_uiManager      = new MogoUIManager();
     billboardManager = new BillboardManager();
     m_dataMapManager = new MapDataManager();
     SoundManager.Init();
     ServerProxy.InitServerProxy(new RemoteProxy());
     ServerProxy.Instance.Init(callback);
 }
예제 #8
0
    public BillboardManager()
    {
        m_instance      = this;
        m_billBoardDic  = new Dictionary <uint, BillboardInfoUIView>();
        m_floatTextPool = new MogoComponentPool <FloatMsg>();
        m_floatTextPool.ResourceName     = "MsgBoxFbFloat.prefab";
        m_floatTextPool.DoGetCacheObject = (floatMsg) =>
        {
            floatMsg.LoadResourceInsteadOfAwake();
            floatMsg.SetActive(false);
            floatMsg.OnFinished = m_floatTextPool.ReleaseInstance;
        };

        m_bulletUIPool = new MogoComponentPool <BulletUI>();
        m_bulletUIPool.ResourceName     = "BulletUI.prefab";
        m_bulletUIPool.DoGetCacheObject = (bulletUI) =>
        {
            bulletUI.Init();
            bulletUI.OnFinished = m_bulletUIPool.ReleaseInstance;
        };

        AddListeners();
    }
 public void reAnimate()
 {
     if (billy != null)
     {
         billy.destroy();
     }
     billy = null;
     initializeAnimation();
     framecounter = -1;
     currentFrame = 0.0f;
 }
예제 #10
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);
         }
     }
 }