Exemplo n.º 1
0
    public void AddTask(Task task)
    {
        BCCustomizedTask component = GetComponent <BCCustomizedTask>();

        if (component == null)
        {
            component = AddOrGetComponent <BCCustomizedTask>();
        }
        component.AddTask(task);
    }
    public static int AddBulletTask(ILuaState luaState)
    {
        EnemyBulletBase bullet  = luaState.ToUserData(-2) as EnemyBulletBase;
        int             funcRef = InterpreterManager.GetInstance().RefLuaFunction(luaState);

        luaState.Pop(1);
        Task task = ObjectsPool.GetInstance().GetPoolClassAtPool <Task>();

        task.funcRef  = funcRef;
        task.isFinish = false;
        task.luaState = null;
        BCCustomizedTask bc = bullet.GetComponent <BCCustomizedTask>();

        bc.AddTask(task);
        return(0);
    }