コード例 #1
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="data"></param>
        public ColliderObject(Neptune.Collider data)
            : base(data)
        {
            LevelObjectHelper.SetObjectShapeCollider(gameObject, data.Shape);
            mLoadPrefabCoroutine = LevelObjectHelper.SetObjectPrefab(gameObject, data.PrefabInfo);

            var behaivour = gameObject.AddComponent <ColliderObjectBehaviour>();

            behaivour.Id = data.Id;
            m_collider   = gameObject.GetComponent <SphereCollider>();
            if (m_collider != null)
            {
                m_initRadius = m_collider.radius;
            }
            DummyEventCollider info = data.EventInfo as DummyEventCollider;

            if (info != null)
            {
                behaivour.EnterId  = (uint)info.EnterEventId;
                behaivour.ExitId   = (uint)info.ExitEventId;
                behaivour.LifeTime = data.LifeTime;
            }

            NeedNavigate = data.NeedNavigate;
        }
コード例 #2
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="data"></param>
        public OrdinaryObjectObject(Neptune.OrdinaryObject data)
            : base(data)
        {
            mLoadPrefabCoroutine = LevelObjectHelper.SetObjectPrefab(gameObject, data.PrefabInfo);

            // 头顶名字
            if (string.IsNullOrEmpty(data.HeadName) == false)
            {
                UI3DText           textComponent = gameObject.AddComponent <UI3DText>();
                UI3DText.StyleInfo styleInfo     = new UI3DText.StyleInfo();
                styleInfo.Offset = data.HeadNamePosOffset;
                textComponent.ResetStyleInfo(styleInfo);
                var str = xc.TextHelper.GetTranslateText(data.HeadName);
                textComponent.Text = str;
            }
        }
コード例 #3
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="data"></param>
        public DoorObject(Neptune.Door data)
            : base(data)
        {
            List <string> prefabPaths = DBManager.Instance.QuerySqliteField <string>(GlobalConfig.DBFile, "data_door", "id", data.ExcelId.ToString(), "res_path");

            if (prefabPaths.Count > 0)
            {
                NodePrefabInfo prefabInfo = new NodePrefabInfo();
                prefabInfo.PrefabFile    = "Res" + prefabPaths[0] + ".prefab";
                prefabInfo.LocalPosition = Vector3.zero;
                prefabInfo.LocalScale    = Vector3.one;
                prefabInfo.LocalRotation = Quaternion.identity;
                mLoadPrefabCoroutine     = LevelObjectHelper.SetObjectPrefab(gameObject, prefabInfo);
            }

            xc.Dungeon.LevelManager.Instance.SetAreaClose(1 << (1 + data.Flag));
        }
コード例 #4
0
        /// <summary>
        /// 更新模型
        /// </summary>
        void UpdateModel()
        {
            DestroyModel();

            if (mDBConfig == null)
            {
                return;
            }

            NodePrefabInfo prefabInfo       = new NodePrefabInfo();
            bool           isMiddleRes      = false;
            string         haveMiddleResStr = mDBConfig["has_middle_res"];

            if (QualitySetting.GraphicLevel > 0 && string.IsNullOrEmpty(haveMiddleResStr) == false && haveMiddleResStr.Equals("1") == true)
            {
                isMiddleRes = true;
            }
            if (isMiddleRes == true)
            {
                prefabInfo.PrefabFile = "Res" + mDBConfig["res_path"] + "_middle.prefab";
            }
            else
            {
                prefabInfo.PrefabFile = "Res" + mDBConfig["res_path"] + ".prefab";
            }
            prefabInfo.LocalPosition = Vector3.zero;
            prefabInfo.LocalScale    = Vector3.one;
            prefabInfo.LocalRotation = Quaternion.identity;
            mLoadPrefabCoroutine     = LevelObjectHelper.SetObjectPrefab(gameObject, prefabInfo, () =>
            {
                if (mGuildBossFireComponent != null)
                {
                    mGuildBossFireComponent.OnResLoaded();
                }
            });
        }
コード例 #5
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="data"></param>
 public InteractionObject(Neptune.Interaction data)
 : base(data)
 {
     mLoadPrefabCoroutine = LevelObjectHelper.SetObjectPrefab(gameObject, data.PrefabInfo);
 }