Esempio n. 1
0
        /// <summary>
        /// 工厂方法,创建SceneCharacter
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public static SceneCharacter CreateSceneCharacter(string path, AnimCtrlEnum animCtrlEnum, bool isMainPlayer)
        {
            GameObject prefab = AssetLoader.Load <GameObject>(path);
            GameObject Entity = CommonHelper.InstantiateGoByPrefab(prefab, null);

            return(new SceneCharacter(Entity, animCtrlEnum, isMainPlayer));
        }
Esempio n. 2
0
    static int IntToEnum(IntPtr L)
    {
        int          arg0 = (int)LuaDLL.lua_tonumber(L, 1);
        AnimCtrlEnum o    = (AnimCtrlEnum)arg0;

        ToLua.Push(L, o);
        return(1);
    }
Esempio n. 3
0
 /// <summary>
 /// 构造函数私有化,外部只能使用工厂方法接口创建
 /// </summary>
 private SceneCharacter(GameObject entity, AnimCtrlEnum animCtrlEnum, bool isMainPlayer)
 {
     gameObject        = entity;
     transform         = entity.transform;
     this.animCtrlEnum = animCtrlEnum;
     this.isMainPlayer = isMainPlayer;
     AssembleAnimCtrl();
     if (isMainPlayer)
     {
         AssembleMoveCtrl();
         PrepareMainCamera();
     }
 }
 static int CreateSceneCharacter(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         string       arg0 = ToLua.CheckString(L, 1);
         AnimCtrlEnum arg1 = (AnimCtrlEnum)ToLua.CheckObject(L, 2, typeof(AnimCtrlEnum));
         bool         arg2 = LuaDLL.luaL_checkboolean(L, 3);
         ColaFramework.SceneCharacter o = ColaFramework.SceneCharacter.CreateSceneCharacter(arg0, arg1, arg2);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 5
0
        /// <summary>
        /// 工厂方法,创建SceneCharacter
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public static SceneCharacter CreateSceneCharacter(string path, AnimCtrlEnum animCtrlEnum, bool isMainPlayer)
        {
            GameObject Entity = CommonUtil.AssetTrackMgr.GetGameObject(path, null);

            return(new SceneCharacter(path, Entity, animCtrlEnum, isMainPlayer));
        }
Esempio n. 6
0
 /// <summary>
 /// 工厂方法,创建ISceneCharacter
 /// </summary>
 /// <param name="path"></param>
 /// <returns></returns>
 public static ISceneCharacter CreateSceneCharacterInf(string path, AnimCtrlEnum animCtrlEnum, bool isMainPlayer)
 {
     return(CreateSceneCharacter(path, animCtrlEnum, isMainPlayer));
 }
Esempio n. 7
0
 static void Push(IntPtr L, AnimCtrlEnum arg)
 {
     ToLua.Push(L, arg);
 }